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

Make sve_128 portable and support true march=native builds #504

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

solidpixel
Copy link
Contributor

@solidpixel solidpixel commented Sep 21, 2024

This PR makes two changes to improve support for SVE.

The first change makes the sve_128 build portable to any system implementing SVE by removing the fixed vector length at compile time. This code is merely augmented NEON, using native gathers, and will use predicates to force the 128-bit data path no matter what the host vector size is. Testing on Graviton 4 shows that there is no measurable performance difference between portable sve_128 and compile-time enforced sve_128, and testing on Graviton 3 shows that the portability part works fine.

The second change makes the "native" build type actually use -march=native and -mcpu=native, allowing native builds to pick up SVE if the host CPU supports it, as currently native builds rely on compiler defaults which are baseline Arm-v8. Note that this needs Clang-18 or newer to pick up SVE automatically, which is newer than the default compiler on current AWS Linux images for Graviton 3 and 4.

#define ASTCENC_SVE 8
// Auto-detected SVE can only assume vector width of 4 is available, but
// must also allow for hardware being longer and so all use of intrinsics
// must explicitly use predicate masks to limit to 4-wide.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we could (in future) do the same for >8wide? (with ASTENC_SVE 8)

@ARM-software ARM-software deleted a comment from Dreamer1 Oct 8, 2024
@solidpixel solidpixel merged commit ff7e9f8 into main Oct 8, 2024
7 checks passed
@solidpixel solidpixel deleted the sve_native branch October 8, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants