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

AVX: enc: add inline asm codepath #108

Closed
aklomp opened this issue Oct 19, 2022 · 0 comments
Closed

AVX: enc: add inline asm codepath #108

aklomp opened this issue Oct 19, 2022 · 0 comments

Comments

@aklomp
Copy link
Owner

aklomp commented Oct 19, 2022

Issue #104 introduced an inline assembly version of the AVX2 base64 encoder. It turns out that we can reuse this implementation almost verbatim for AVX if we replace the 256-bit AVX2 registers with 128-bit AVX registers. Some small changes are needed, such as changing the stride widths and removing the special handling of the first round, but overall the code remains the same.

@aklomp aklomp self-assigned this Oct 19, 2022
aklomp added a commit that referenced this issue Oct 19, 2022
Issue #104 introduced an inline assembly version of the AVX2 base64
encoder. It turns out that we can reuse this implementation almost
verbatim for AVX if we replace the 256-bit AVX2 registers with 128-bit
AVX registers. Some small changes are needed, such as changing the
stride widths and removing the special handling of the first round, but
overall the code remains the same.

Tested with the Intel SDE instruction set emulator running in Sandy
Bridge mode (with AVX, but no AVX2).

Resolves #108.
aklomp added a commit that referenced this issue Oct 19, 2022
encoder. It turns out that we can reuse this implementation almost
verbatim for AVX if we replace the 256-bit AVX2 registers with 128-bit
AVX registers. Some small changes are needed, such as changing the
stride widths and removing the special handling of the first round, but
overall the code remains the same.

Tested with the Intel SDE instruction set emulator running in Sandy
Bridge mode (with AVX, but no AVX2).

Resolves #108.
aklomp added a commit that referenced this issue Oct 19, 2022
Issue #104 introduced an inline assembly version of the AVX2 base64
encoder. It turns out that we can reuse this implementation almost
verbatim for AVX if we replace the 256-bit AVX2 registers with 128-bit
AVX registers. Some small changes are needed, such as changing the
stride widths and removing the special handling of the first round, but
overall the code remains the same.

Tested with the Intel SDE instruction set emulator running in Sandy
Bridge mode (with AVX, but no AVX2).

Resolves #108.
aklomp added a commit that referenced this issue Oct 19, 2022
Issue #104 introduced an inline assembly version of the AVX2 base64
encoder. It turns out that we can reuse this implementation almost
verbatim for AVX if we replace the 256-bit AVX2 registers with 128-bit
AVX registers. Some small changes are needed, such as changing the
stride widths and removing the special handling of the first round, but
overall the code remains the same.

Tested with the Intel SDE instruction set emulator running in Sandy
Bridge mode (with AVX, but no AVX2).

Resolves #108.
@aklomp aklomp closed this as completed in 2e8ad2a Oct 19, 2022
@aklomp aklomp changed the title AVX: enc: add inline asm codepath enhancement AVX: enc: add inline asm codepath Oct 19, 2022
aklomp added a commit that referenced this issue Oct 22, 2022
Disable the inline assembly codepath on 32-bit x86 (known as x86-32 or
i686), because the 32-bit x86 architecture only has eight XMM registers,
which is not enough to run the code.

Since this was not caught in CI before merging #104 and #108, add a test
to compile the library on i686.

Resolves #110.
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

1 participant