Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/AdvSimd_r.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- https://github.com/dotnet/runtime/issues/118234 -->
<NativeAotIncompatible>true</NativeAotIncompatible>
</PropertyGroup>
<PropertyGroup>
<DebugType>Embedded</DebugType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- https://github.com/dotnet/runtime/issues/118234 -->
<NativeAotIncompatible>true</NativeAotIncompatible>
</PropertyGroup>
<PropertyGroup>
<DebugType>Embedded</DebugType>
Expand Down
36 changes: 17 additions & 19 deletions src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7789,35 +7789,33 @@ public static W MultiplyAddWidening<W, N>(W op1, N op2, N op3)
where W : IBinaryInteger<W>
where N : IBinaryInteger<N>
{
dynamic a = op2;
dynamic b = op3;
W product = (W)((W)a * (W)b);
W r = (W)(op1 + product);
return r;
W a = W.CreateChecked(op2);
W b = W.CreateChecked(op3);
W product = W.CreateTruncating(a * b);
return W.CreateTruncating(op1 + product);
}

public static W MultiplySubtractWidening<W, N>(W op1, N op2, N op3)
where W : IBinaryInteger<W>
where N : IBinaryInteger<N>
{
dynamic a = op2;
dynamic b = op3;
W product = (W)((W)a * (W)b);
W r = (W)(op1 - product);
return r;
W a = W.CreateChecked(op2);
W b = W.CreateChecked(op3);
W product = W.CreateTruncating(a * b);
return W.CreateTruncating(op1 - product);
}

public static N AddRoundedHighNarrowing<W, N>(W op1, W op2)
where W : IBinaryInteger<W>
where N : IBinaryInteger<N>
{
int halfsize = default(N).GetByteCount() * 8;
dynamic a = op1;
dynamic b = op2;
ulong sum = (ulong)a + (ulong)b;
ulong a = ulong.CreateChecked(op1);
ulong b = ulong.CreateChecked(op2);
ulong sum = a + b;
ulong bias = 1UL << (halfsize - 1);
dynamic result = sum + bias;
return (N)(result >> halfsize);
ulong result = (sum + bias) >> halfsize;
return N.CreateTruncating(result);
}

public static N AddRoundedHighNarrowingEven<W, N>(W op1, W op2, int i)
Expand All @@ -7839,12 +7837,12 @@ public static N SubtractRoundedHighNarrowing<W, N>(W op1, W op2)
where N : IBinaryInteger<N>
{
int halfsize = default(N).GetByteCount() * 8;
dynamic a = op1;
dynamic b = op2;
ulong a = ulong.CreateChecked(op1);
ulong b = ulong.CreateChecked(op2);
ulong sum = (ulong)a - (ulong)b;
ulong bias = 1UL << (halfsize - 1);
dynamic result = sum + bias;
return (N)(result >> halfsize);
ulong result = (sum + bias) >> halfsize;
return N.CreateTruncating(result);
}

public static N SubtractRoundedHighNarrowingEven<W, N>(W op1, W op2, int i)
Expand Down