Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit c07edfa

Browse files
committed
fix SSE scalar intrinsic tests
1 parent d3018ef commit c07edfa

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tests/src/JIT/HardwareIntrinsics/X86/Sse/ReciprocalScalar.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ static unsafe int Main(string[] args)
3131

3232
if (!floatTable.CheckResult((x, y) => {
3333
var expected = 1 / x[0];
34+
var remain = Avx.IsSupported ? (y[1] == x[1]) && (y[2] == x[2]) && (y[3] == x[3]) : true; // VEX-encoding copies remain elements
3435
return ((Math.Abs(expected - y[0]) <= 0.0003662109375f) // |Relative Error| <= 1.5 * 2^-12
3536
|| (float.IsNaN(expected) && float.IsNaN(y[0]))
3637
|| (float.IsNegativeInfinity(expected) && float.IsNegativeInfinity(y[0]))
3738
|| (float.IsPositiveInfinity(expected) && float.IsPositiveInfinity(y[0])))
38-
&& (y[1] == x[1]) && (y[2] == x[2]) && (y[3] == x[3]);
39+
&& remain;
3940
}))
4041
{
4142
Console.WriteLine("SSE ReciprocalScalar failed on float:");

tests/src/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrtScalar.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ static unsafe int Main(string[] args)
3131

3232
if (!floatTable.CheckResult((x, y) => {
3333
var expected = 1 / MathF.Sqrt(x[0]);
34+
var remain = Avx.IsSupported ? (y[1] == x[1]) && (y[2] == x[2]) && (y[3] == x[3]) : true;
3435
return ((Math.Abs(expected - y[0]) <= 0.0003662109375f) // |Relative Error| <= 1.5 * 2^-12
3536
|| (float.IsNaN(expected) && float.IsNaN(y[0]))
3637
|| (float.IsNegativeInfinity(expected) && float.IsNegativeInfinity(y[0]))
3738
|| (float.IsPositiveInfinity(expected) && float.IsPositiveInfinity(y[0])))
38-
&& (y[1] == x[1]) && (y[2] == x[2]) && (y[3] == x[3]);
39+
&& remain;
3940
}))
4041
{
4142
Console.WriteLine("SSE ReciprocalSqrtScalar failed on float:");

tests/src/JIT/HardwareIntrinsics/X86/Sse/SqrtScalar.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ static unsafe int Main(string[] args)
3131

3232
if (!floatTable.CheckResult((x, y) => {
3333
var expected = MathF.Sqrt(x[0]);
34+
var remain = Avx.IsSupported ? (y[1] == x[1]) && (y[2] == x[2]) && (y[3] == x[3]) : true; // VEX-encoding copies remain elements
3435
return ((expected == y[0])
3536
|| (float.IsNaN(expected) && float.IsNaN(y[0])))
36-
&& (y[1] == x[1]) && (y[2] == x[2]) && (y[3] == x[3]);
37+
&& remain;
3738
}))
3839
{
3940
Console.WriteLine("SSE SqrtScalar failed on float:");

0 commit comments

Comments
 (0)