Uh oh!
There was an error while loading. Please reload this page.
ARM64-SVE: gathervector - #103159
Conversation
ghost
commented
Jun 7, 2024
Note regarding the |
1 similar comment
ghost
commented
Jun 7, 2024
Note regarding the |
Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics |
a74nh
commented
Jun 7, 2024
This is working. However, 3 tests are commented out. These are the ones with publicstaticunsafeVector<float>GatherVector(Vector<float>mask,Vector<uint>addresses);I don't think this works for C#. Each address is a 32bit value. Sve is only for Arm64. @tannergooding : thoughts? |
a74nh
commented
Jun 7, 2024
@dotnet/arm64-contrib @kunalspathak |
Looks like two errors:
|
a74nh
commented
Jun 7, 2024
Scratch error 2 - those were due to running on a 256bit machine (and therefore issues around storing to the stack). |
kunalspathak
left a comment
There was a problem hiding this comment.
looks good overall. added some comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| if (auxSize == EA_8BYTE) | ||
| { | ||
| opt = varTypeIsUnsigned(auxType) ? INS_OPTS_SCALABLE_D_UXTW : INS_OPTS_SCALABLE_D_SXTW; |
There was a problem hiding this comment.
From the summary docs, we are emitting
LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3],
Correct
which does not take
xsfield, so we do not have to embedUXTWorSXTWbit, right?
Removing this, I get an asset (in emitarm64sve.cpp:6441). Looks like emit is expecting this field. I'll have to debug it a little more. There are a lot of different loads and I don't want to break any of them.
There was a problem hiding this comment.
so you are saying that although we pass the *XTW flag, we are not using it in for this instruction, although the code path flows through the emitarm64sve.cpp that you mentioned?
There was a problem hiding this comment.
Looks like it's using the flag to make a decision to decide on the correct encoding. Then doesn't use it later. Probably just needs a fix in emit.
There was a problem hiding this comment.
Probably just needs a fix in emit.
Did you fix it in this PR?
There was a problem hiding this comment.
Addressing modes now fixed. There are three variants for "address with vector of offsets":
Vector<64bit> GatherVector(Vector<64bit> mask, 64bit* address, Vector<64bit> indices)
-> LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3]
Vector<32bit> GatherVector(Vector<32bit> mask, 32bit* address, Vector<signed32bit> indices)
-> LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2]
Vector<32bit> GatherVector(Vector<32bit> mask, 32bit* address, Vector<unsigned32bit> indices)
-> LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2]
Codegen now picks the correct ones
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tannergooding
commented
Jun 7, 2024
If there is an encoding that allows this parameter to be Having trouble following the SVE docs here since there are like 8+ different instructions called But it looks like
In all cases, it looks like |
a74nh
commented
Jun 10, 2024
This is for: Which maps to Gather load unsigned words to vector (immediate index) with an immediate value of 0. Unless we can the address of a C# object to fit into a 32bit address I can't see this working. |
tannergooding
commented
Jun 10, 2024
I don't see the issue. This doesn't have anything to do with objects, but rather truncated pointers. That is, While it isn't usable for an arbitrary |
a74nh
commented
Jun 10, 2024
Ok, that's fair, I wasn't sure it was possible to restrict memory in that way in C#. Do you have any pointers on how I might construct a blob of memory the first 4GB in C# for the test case? |
tannergooding
commented
Jun 10, 2024
You'd need to use an API like It should be roughly equivalent to how you'd test the same functionality in C/C++ |
kunalspathak
commented
Jun 10, 2024
I don't want to spend too much time on writing test for this scenario, given that we have around 40% APIs to complete in .NET 9. For now, I will just comment out exposing these APIs and come back to it once we have some cycles. |
a74nh
commented
Jun 11, 2024
Agreed - gather vector is likely to be infrequently used. Use of variants with a 32bit address will be much rarer. I've removed them from the external API files, but left them commented out in internal files. That should make it easier to revive later. |
a74nh
commented
Jun 11, 2024
Stress results. |
Uh oh!
There was an error while loading. Please reload this page.
kunalspathak
left a comment
There was a problem hiding this comment.
LGTM, after we put back the 32-bit address APIs with a comment pointing to #103297
kunalspathak
commented
Jun 12, 2024
/ba-g failures are because of #103354 |

No description provided.