Skip to content

Commit 0d8ae56

Browse files
authored
Merge pull request #5 from crookseta/dev
Fixed major bug and updated dependencies.
2 parents 16b9594 + 8481803 commit 0d8ae56

File tree

7 files changed

+33
-57
lines changed

7 files changed

+33
-57
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,4 @@ FodyWeavers.xsd
399399
/src/MissingValues/MathQ.MathFunctions.cs
400400
/src/MissingValues/Properties/MissingValues.AssemblyInfo.cs
401401
/src/MissingValues/Properties/AssemblyInfo.cs
402+
/src/MissingValues.Benchmarks/MissingValues.Benchmarks.csproj

src/MissingValues.Benchmarks/MissingValues.Benchmarks.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
11+
<PackageReference Include="BenchmarkDotNet" Version="0.13.11" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

src/MissingValues.Benchmarks/Program.cs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,25 @@
1010
using System.Runtime.Intrinsics;
1111
using System.Windows.Markup;
1212

13-
BenchmarkRunner.Run(
14-
new Type[]
15-
{
16-
typeof(UInt256Benchmarks.MathOperators),
17-
typeof(UInt256Benchmarks.Formatting),
18-
typeof(UInt256Benchmarks.Parsing),
19-
typeof(UInt256Benchmarks.Operations),
20-
typeof(UInt512Benchmarks.MathOperators),
21-
typeof(UInt512Benchmarks.Formatting),
22-
typeof(UInt512Benchmarks.Parsing),
23-
typeof(UInt512Benchmarks.Operations),
24-
typeof(QuadBenchmarks.MathOperators),
25-
typeof(QuadBenchmarks.Parser),
26-
}
27-
);
13+
//BenchmarkRunner.Run(
14+
// new Type[]
15+
// {
16+
// typeof(UInt256Benchmarks.MathOperators),
17+
// typeof(UInt256Benchmarks.Formatting),
18+
// typeof(UInt256Benchmarks.Parsing),
19+
// typeof(UInt256Benchmarks.Operations),
20+
// typeof(UInt512Benchmarks.MathOperators),
21+
// typeof(UInt512Benchmarks.Formatting),
22+
// typeof(UInt512Benchmarks.Parsing),
23+
// typeof(UInt512Benchmarks.Operations),
24+
// typeof(QuadBenchmarks.MathOperators),
25+
// typeof(QuadBenchmarks.Parser),
26+
// }
27+
//);
2828

29+
//BenchmarkRunner.Run<QuadBenchmarks.MathOperators>();
30+
31+
UInt128 uInt = new UInt128(0xFFFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF);
32+
33+
Console.WriteLine(uInt.GetUpperBits());
2934
Console.ReadLine();

src/MissingValues.Benchmarks/QuadBenchmarks.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using BenchmarkDotNet.Attributes;
2+
using BenchmarkDotNet.Jobs;
23
using System;
34
using System.Collections.Generic;
45
using System.Globalization;

src/MissingValues.Tests/MissingValues.Tests.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

@@ -10,14 +10,14 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="FluentAssertions" Version="6.11.0" />
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
15-
<PackageReference Include="xunit" Version="2.4.2" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
13+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
15+
<PackageReference Include="xunit" Version="2.6.4" />
16+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
<PrivateAssets>all</PrivateAssets>
1919
</PackageReference>
20-
<PackageReference Include="coverlet.collector" Version="3.2.0">
20+
<PackageReference Include="coverlet.collector" Version="6.0.0">
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
<PrivateAssets>all</PrivateAssets>
2323
</PackageReference>

src/MissingValues/Internals/BitHelper.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,7 @@ public static void GetUpperAndLowerBits(Int128 value, out ulong upper, out ulong
2525
upper = value.GetUpperBits();
2626
}
2727

28-
#if NET8_0_OR_GREATER
29-
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_upper")]
30-
private static extern ref ulong GetUpperBitsInternal(UInt128 uInt128);
31-
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_lower")]
32-
private static extern ref ulong GetLowerBitsInternal(UInt128 uInt128);
33-
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_upper")]
34-
private static extern ref ulong GetUpperBitsInternal(Int128 int128);
35-
[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_lower")]
36-
private static extern ref ulong GetLowerBitsInternal(Int128 int128);
3728

38-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
39-
public static ulong GetUpperBits(this in UInt128 value)
40-
{
41-
return GetUpperBitsInternal(value);
42-
}
43-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
44-
public static ulong GetUpperBits(this in Int128 value)
45-
{
46-
return GetUpperBitsInternal(value);
47-
}
48-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
49-
public static ulong GetLowerBits(this in UInt128 value)
50-
{
51-
return GetLowerBitsInternal(value);
52-
}
53-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
54-
public static ulong GetLowerBits(this in Int128 value)
55-
{
56-
return GetLowerBitsInternal(value);
57-
}
58-
#else
5929
[MethodImpl(MethodImplOptions.AggressiveInlining)]
6030
public static ulong GetUpperBits(this in UInt128 value)
6131
{
@@ -76,7 +46,6 @@ public static ulong GetLowerBits(this in Int128 value)
7646
{
7747
return unchecked((ulong)(value));
7848
}
79-
#endif
8049

8150
public static void GetDoubleParts(double dbl, out int sign, out int exp, out ulong man, out bool fFinite)
8251
{

src/MissingValues/MissingValues.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<DefineConstants Condition="'$(IsBigEndian)' == 'true'">$(DefineConstants);BIGENDIAN</DefineConstants>
2929

30-
<Version>1.2.0</Version>
30+
<Version>1.2.1</Version>
3131
</PropertyGroup>
3232

3333
<ItemGroup>

0 commit comments

Comments
 (0)