JIT: Added SVE GetFfr, SetFfr, LoadVectorFirstFaulting, GatherVectorFirstFaulting#105595
JIT: Added SVE GetFfr, SetFfr, LoadVectorFirstFaulting, GatherVectorFirstFaulting#105595TIHan merged 88 commits intodotnet:mainfrom
Conversation
…ectorFirstFaulting.
…ly without the FirstFaulting test. Added SveFfrTest template.
somewhat workable code cleanup Remove FFR Add all the GetFfr* wip Work with MskCns() model Use physReg approach Remove commented prototypes working Remove bunch of unnecessary code Remove SpecialImport from GetFFR/SetFFR/LoadFirstFaulting some more code cleanup some fixup
| private const string SystemNative = "libSystem.Native"; | ||
|
|
||
| // NOTE: Shim returns null pointer on failure, not non-null MAP_FAILED sentinel. | ||
| [DllImport(SystemNative, EntryPoint = "SystemNative_MMap", SetLastError = true)] |
There was a problem hiding this comment.
nit: you should be able to access Interop.Libraries.SystemNative here for the lib name constant
There was a problem hiding this comment.
or maybe just consume Interop.MMap.cs which is already in the shared location?
There was a problem hiding this comment.
Because we directly reference BoundedMemory.cs and its implementations in Sve_r.csproj and Sve_ro.csproj, I do not have access to any other API in the TestUtilities.csproj nor do I have access to library internals; which means I cannot access Interop.Libraries.SystemNative.
src/libraries/Common/tests/TestUtilities/System/Buffers/BoundedMemory.Creation.cs
Outdated
Show resolved
Hide resolved
SystemNative is not runtime specific. It is available when running on Mono too. We have number libraries that use it and that work on Mono just fine. |
Ok, that's good to know. I assumed it wouldn't be able to access it as I got an error calling into the library here: https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-105595-merge-e7641fefa451458d81/Invariant.Tests/1/console.5fc11457.log?helixlogtype=result |
|
It looks like the error is just wasm specific. |
This is wasm build. This error says that |
|
I added the check for wasm, @jkotas does it look ok? |
| LIR::Use use; | ||
| bool foundUse = BlockRange().TryGetUse(node, &use); | ||
|
|
||
| if (m_ffrTrashed) |
There was a problem hiding this comment.
Is this code adding the extra arg that is checked for in hwintrinsiccodegenarm64.cpp which causes the wrFFR ?
There was a problem hiding this comment.
Hmm, now I'm wondering if this code was left over from a merge.
There was a problem hiding this comment.
Ok, this was not left over. @kunalspathak added this for this PR.
When looking at hwintrinsiccodegenarm64.cpp, it does seem to be the case as it checks for the num of operands.
| public static unsafe Vector<ulong> GatherVectorByteZeroExtend(Vector<ulong> mask, byte* address, Vector<ulong> indices) { throw new PlatformNotSupportedException(); } | ||
|
|
||
|
|
||
| /// <summary> |
There was a problem hiding this comment.
Could you add the "// Unextended load, first-faulting" above this similar to the other APIs. In both API files. And for the other APIs you're adding too.
| public static unsafe System.Numerics.Vector<ulong> GatherVectorByteZeroExtend(System.Numerics.Vector<ulong> mask, byte* address, System.Numerics.Vector<long> indices) { throw null; } | ||
| public static System.Numerics.Vector<ulong> GatherVectorByteZeroExtend(System.Numerics.Vector<ulong> mask, System.Numerics.Vector<ulong> addresses) { throw null; } | ||
| public static unsafe System.Numerics.Vector<ulong> GatherVectorByteZeroExtend(System.Numerics.Vector<ulong> mask, byte* address, System.Numerics.Vector<ulong> indices) { throw null; } | ||
|
|
There was a problem hiding this comment.
Remove any new blank lines from this file please.
|
Merging. I carefully looked into each of the current failing CI legs and they are not related to the changes made here. |
Contributes to #99957
Same as #104502 but with a separate impl of BoundedMemory specifically used for SVE first faulting APIs.