Skip to content

Commit

Permalink
[mono][amd64] Fix Vector128 relational comparison API's for nuint type (
Browse files Browse the repository at this point in the history
#96515)

* Fix uint greatetThan

* Enable disabled tests

* Add a new test
  • Loading branch information
fanyang-mono committed Jan 8, 2024
1 parent cd0e33b commit f0ca0fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,6 @@ public void MaxMagnitude_Tensor_ThrowsForEmpty()
Assert.Throws<ArgumentException>(() => MaxMagnitude(ReadOnlySpan<T>.Empty));
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/96443", TestRuntimes.Mono)]
[Fact]
public void MaxMagnitude_Tensor()
{
Expand Down Expand Up @@ -1483,7 +1482,6 @@ public void MaxMagnitude_Tensor_Negative0LesserThanPositive0()
Assert.Equal(ConvertFromSingle(1), MaxMagnitude( [ConvertFromSingle(-0f), ConvertFromSingle(-0f), ConvertFromSingle(-0f), ConvertFromSingle(-0f), ConvertFromSingle(-1), ConvertFromSingle(-0f), ConvertFromSingle(0f), ConvertFromSingle(1)]));
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/96443", TestRuntimes.Mono)]
[Fact]
public void MaxMagnitude_TwoTensors()
{
Expand All @@ -1502,7 +1500,6 @@ public void MaxMagnitude_TwoTensors()
});
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/96443", TestRuntimes.Mono)]
[Fact]
public void MaxMagnitude_TwoTensors_InPlace()
{
Expand Down Expand Up @@ -1531,7 +1528,6 @@ public void MaxMagnitude_TwoTensors_InPlace()
});
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/96443", TestRuntimes.Mono)]
[Fact]
public void MaxMagnitude_TwoTensors_SpecialValues()
{
Expand Down Expand Up @@ -1789,7 +1785,6 @@ public void MinMagnitude_Tensor_ThrowsForEmpty()
Assert.Throws<ArgumentException>(() => MinMagnitude(ReadOnlySpan<T>.Empty));
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/96443", TestRuntimes.Mono)]
[Fact]
public void MinMagnitude_Tensor()
{
Expand Down Expand Up @@ -1859,7 +1854,6 @@ public void MinMagnitude_Tensor_Negative0LesserThanPositive0()
Assert.Equal(ConvertFromSingle(0), MinMagnitude([ConvertFromSingle(-1), ConvertFromSingle(-0f), ConvertFromSingle(1)]));
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/96443", TestRuntimes.Mono)]
[Fact]
public void MinMagnitude_TwoTensors()
{
Expand All @@ -1878,7 +1872,6 @@ public void MinMagnitude_TwoTensors()
});
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/96443", TestRuntimes.Mono)]
[Fact]
public void MinMagnitude_TwoTensors_InPlace()
{
Expand Down Expand Up @@ -1907,7 +1900,6 @@ public void MinMagnitude_TwoTensors_InPlace()
});
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/96443", TestRuntimes.Mono)]
[Fact]
public void MinMagnitude_TwoTensors_SpecialValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4544,6 +4544,13 @@ public void Vector128SByteAbs_MinValue()
}
}

[Fact]
public void Vector128NuintGreaterThan_MaxValue()
{
Vector128<nuint> vector = Vector128.Create(nuint.MaxValue);
Assert.True(Vector128.EqualsAll(Vector128.GreaterThan(vector, Vector128<nuint>.Zero), vector));
}

[Fact]
public void IsSupportedByte() => TestIsSupported<byte>();

Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/mini/mini-amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -3415,9 +3415,9 @@ simd_type_to_shl_op (int t)
case MONO_TYPE_I:
case MONO_TYPE_U:
#if TARGET_SIZEOF_VOID_P == 8
return OP_PSHLD;
#else
return OP_PSHLQ;
#else
return OP_PSHLD;
#endif
default:
g_assert_not_reached ();
Expand Down

0 comments on commit f0ca0fa

Please sign in to comment.