Arm64/Sve: Implement LoadVector*NonFaultingSignExtendTo* APIs#102903
Arm64/Sve: Implement LoadVector*NonFaultingSignExtendTo* APIs#102903kunalspathak merged 10 commits intodotnet:mainfrom
Conversation
|
Note regarding the |
|
@dotnet/arm64-contrib @TIHan PTAL |
|
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics |
TIHan
left a comment
There was a problem hiding this comment.
LGTM. Minor comment on the category. Test template works great.
| ("SveLoadMaskedUnOpTest.template", new Dictionary<string, string> { ["TestName"] = "SveLoadVectorUInt16ZeroExtendToUInt64", ["Isa"] = "Sve", ["Method"] = "LoadVectorUInt16ZeroExtendToUInt64", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "64", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), | ||
| ("SveLoadMaskedUnOpTest.template", new Dictionary<string, string> { ["TestName"] = "SveLoadVectorUInt32ZeroExtendToInt64", ["Isa"] = "Sve", ["Method"] = "LoadVectorUInt32ZeroExtendToInt64", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Int64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), | ||
| ("SveLoadMaskedUnOpTest.template", new Dictionary<string, string> { ["TestName"] = "SveLoadVectorUInt32ZeroExtendToUInt64", ["Isa"] = "Sve", ["Method"] = "LoadVectorUInt32ZeroExtendToUInt64", ["RetVectorType"] = "Vector", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "UInt64", ["Op2BaseType"] = "UInt32", ["LargestVectorSize"] = "64", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), | ||
| ("SveLoadMaskedUnOpTest.template", new Dictionary<string, string> { ["TestName"] = "Sve_LoadVector_float", ["Isa"] = "Sve", ["Method"] = "LoadVector", ["RetVectorType"] = "Vector", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector", ["Op1BaseType"] = "Single", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "64", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), |
There was a problem hiding this comment.
What did you change on these lines? Was it just the TestName?
There was a problem hiding this comment.
yes, just to have them consistent naming of Sve_*
| // Validates passing an instance member of a struct works | ||
| test.RunStructFldScenario(); | ||
|
|
||
| // Validates using inside ConditionalSelect with value falseValue |
There was a problem hiding this comment.
I'm surprised we've not hit this before - there are other instructions that are Pg/Z.
There was a problem hiding this comment.
All the APIs we have implemented that has Pg/Z are either the ones that explicitly takes mask as first argument like LoadVector for which we don't use it inside ConditionalSelect or the ones that operates on purely predicate registers like EOR Presult.B, Pg/Z, Pop1.B, Pop2.B which we have not exposed it via API. This is the first API that implicitly has a mask argument and has Pg/Z format in the instruction.
|
|
||
| // Validates using inside ConditionalSelect with zero falseValue | ||
| test.ConditionalSelect_ZeroOp(); | ||
| } |
There was a problem hiding this comment.
Maybe not for this PR, but I remember discussion about testing with addresses that fault. Use an address that is invalid/partially invalid, then test an exception is not raised.
Then maybe add the same test to the normal loads and check it does fault.
There was a problem hiding this comment.
| @@ -0,0 +1,413 @@ | |||
| // Licensed to the .NET Foundation under one or more agreements. | |||
| // The .NET Foundation licenses this file to you under the MIT license. | |||
There was a problem hiding this comment.
What's special about this template that means it can't use the standard load template?
There was a problem hiding this comment.
Having a RunBasicScenario_LoadNonFaulting() test case that will make sure we do not fault even for invalid memory.
There was a problem hiding this comment.
I was looking for a try/catch ... but we don't need to add that.
|
/ba-g opened #102919 |
All stress tests passing: https://gist.github.com/kunalspathak/355fa828453c9f4fbe76c7d4dbfa0d9a
Contributes to #99957