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

Architecture-specific dispatching #6

Merged
merged 13 commits into from
Sep 11, 2024
Merged

Architecture-specific dispatching #6

merged 13 commits into from
Sep 11, 2024

Conversation

Wunkolo
Copy link
Owner

@Wunkolo Wunkolo commented Sep 26, 2022

Implements patterns and abstractions to dispatch architecture-specific accelerations.

This also adds an ARM64 accelerated CRC32 implementation

@Wunkolo Wunkolo added the enhancement New feature or request label Sep 26, 2022
@Wunkolo Wunkolo self-assigned this Sep 26, 2022
@Wunkolo Wunkolo force-pushed the arch-dispatch branch 3 times, most recently from 7240c28 to dd1d62f Compare October 5, 2022 02:30
@Wunkolo Wunkolo force-pushed the arch-dispatch branch 2 times, most recently from c1a9b8f to f0c36c5 Compare March 7, 2023 07:19
Wunkolo added 4 commits March 6, 2023 23:22
CRC and qCheck are different compilation targets now. CRC32 is still
header-only at the moment but this sets it up to have a more private
implementation
Removes the template-based function generation.
Staticaly generates the CRC tables for each of the polynomials rather
than generating them at run-time.
Wunkolo added 3 commits March 7, 2023 10:52
Use a function rather than a lambda. Use specific memory-ordering for
atomic variables.
```
...
In Armv8-A, this is an OPTIONAL instruction, and in Armv8.1 it is mandatory for all implementations to implement it.
...
```
https://developer.arm.com/documentation/ddi0597/2020-12/Base-Instructions/CRC32--CRC32-

Uses the `crc32{b,h,w,d}` and `crc32c{b,h,w,d}`instructions.  Dispatch
is determined at compile-time using the `__ARM_FEATURE_CRC32`
preprocessor.

Tested on an M2 Mac Mini, it's not all that faster, might be something
I'm doing wrong?

Before:
```
./qCheck-generic -c   26.95s user 3.82s system 104% cpu 29.345 total
```

After:
```
./qCheck-crc32 -c   26.85s user 3.69s system 104% cpu 29.204 total
```
Wunkolo added 3 commits July 18, 2024 16:00
Re-implements the x64 version of the carryless-multiply acceleration to
fold 64 bytes of data at a time. Passes unit tests.
When multiplying the two high arguments together, `vmull_high_p64` can
be used instead of extracting the lanes manually.
Let this be a user-provided variable since we can't always assume everyone has x64 and arm64 library files at the same time.
@Wunkolo Wunkolo marked this pull request as ready for review July 18, 2024 23:56
@Wunkolo Wunkolo changed the base branch from main to dev September 11, 2024 18:01
@Wunkolo Wunkolo merged commit a548751 into dev Sep 11, 2024
2 checks passed
@Wunkolo Wunkolo deleted the arch-dispatch branch September 11, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant