Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scatter/gather support for AArch64's Scalable Vector Extension (SVE) #5844

Closed
AssadHashmi opened this issue Jan 31, 2023 · 3 comments
Closed

Comments

@AssadHashmi
Copy link
Contributor

We will shortly be upstreaming SVE scatter/gather instructions as part of AArch64 SVE codec and core/tools work (#5365, #3044). There are two aspects of this work:

  • IR and codec: new AArch64 addressing modes, an extension of the existing opnd_create_base_disp_aarch64() or a new opnd_create_base_disp_ function for SVE.
  • Core and tools: emulation of SVE scatter/gather for observing memory, similar to AVX512, see https://dynamorio.org/page_scatter_gather_emulation.html

In both cases we would like to be consistent with the design of the AVX512 IR API and emulation implementation, as much as possible. We would appreciate any advice on the best approach and the avoidance of pitfalls which you may have have encountered during your work on AVX512. As well as pointers to code which is relevant to and/or will help us with implementing for SVE.

@derekbruening
Copy link
Contributor

AVX-2 and AVX-512 scatter/gather expansion was implemented by @abhinav92003 and there is a doc here: https://dynamorio.org/page_scatter_gather_emulation.html

Abhinav may have more to say as well. From my side: it is maybe surprisingly complex for originating from a single instruction, as the example expansions in that doc show, and you can see in the code the state restore is equally complex with a giant state machine.

@derekbruening
Copy link
Contributor

I think this is a dup of #5036 which has a bunch of observations

cmannett85-arm added a commit that referenced this issue May 11, 2023
This work is being done in #5844
Change-Id: Ie3c6b3da0785fc3caa34ce363f2d929687f527a6
jackgallagher-arm added a commit that referenced this issue Jun 26, 2023
The existing drx_expand_scatter_gather() function is > 2000 lines of
code, including helper functions, and most of it is very x86 specific.

In preparation for writing the AArch64 version of this function, this
commit moves the x86 implementation of drx_expand_scatter_gather() out
of drx.c into its own architecture specific files, and creates dummy
implementations for other architectures.

The behaviour of the function should be unchanged on all platforms.

As we develop the AArch64 version of drx_expand_scatter_gather(), any
parts of the original x86 implementation which are usefull to both can
be pulled out into helper functions which are shared between both
architectures.

Issues: #5844, #5036, #3837
github-merge-queue bot pushed a commit that referenced this issue Jun 27, 2023
The existing drx_expand_scatter_gather() function is > 2000 lines of
code, including helper functions, and most of it is very x86 specific.

In preparation for writing the AArch64 version of this function, this
commit moves the x86 implementation of drx_expand_scatter_gather() out
of drx.c into its own architecture specific files, and creates dummy
implementations for other architectures.

The behaviour of the function should be unchanged on all platforms.

As we develop the AArch64 version of drx_expand_scatter_gather(), any
parts of the original x86 implementation which are usefull to both can
be pulled out into helper functions which are shared between both
architectures.

Issues: #5844, #5036, #3837
derekbruening added a commit that referenced this issue Jun 28, 2023
Fixes a build breakage introduced in PR #6173 with an invalid include path.

Issue: #5844
derekbruening added a commit that referenced this issue Jun 28, 2023
Fixes a build breakage introduced in PR #6173 with an invalid include
path.

Issue: #5844
cmannett85-arm added a commit that referenced this issue Jul 20, 2023
This is temporary measure until #5844 is implemented.

Change-Id: Iac82edc974435bfed9285a23988db159ea0d731d
jackgallagher-arm added a commit that referenced this issue Aug 16, 2023
Creates an AArch64 version of drx_expand_scatter_gather() and unit tests
for it. So far only SVE scalar+vector loads are supported.
Support and tests for more instructions will follow in future commits.

Issues: #5844, #5036, #3837
@derekbruening
Copy link
Contributor

Closing as duplicate as it is confusing having multiple issues on the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants