Skip to content

polyval: detect avx+pclmulqdq CPU features on x86#347

Merged
tarcieri merged 1 commit into
masterfrom
polyval/detect-avx+pclmulqdq-on-x86
Jul 11, 2026
Merged

polyval: detect avx+pclmulqdq CPU features on x86#347
tarcieri merged 1 commit into
masterfrom
polyval/detect-avx+pclmulqdq-on-x86

Conversation

@tarcieri

Copy link
Copy Markdown
Member

What we actually need support for is using PCLMULQDQ with 128-bit VEX operands. #317 switched to using:

target_feature(enable = "avx", enable = "pclmulqdq")

...however cpufeatures were being used to detect vpclmulqdq which specifically refers to the AVX2 instruction with 256-bit VEX operands, which are only available on CPUs that are many years newer, and which we don't actually use.

This switches the cpufeatures to detect avx+pclmulqdq which matches our target_feature attributes.

Closes #346

What we actually need support for is using PCLMULQDQ with 128-bit VEX
operands. #317 switched to using:

    target_feature(enable = "avx", enable = "pclmulqdq")

...however `cpufeatures` were being used to detect `vpclmulqdq` which
specifically refers to the AVX2 instruction with 256-bit VEX operands,
which are only available on CPUs that are many years newer, and which we
don't actually use.

This switches the `cpufeatures` to detect `avx`+`pclmulqdq` which
matches our `target_feature` attributes.

Closes #346
@tarcieri tarcieri merged commit feb26f6 into master Jul 11, 2026
25 checks passed
@tarcieri tarcieri deleted the polyval/detect-avx+pclmulqdq-on-x86 branch July 11, 2026 12:58
tarcieri added a commit that referenced this pull request Jul 11, 2026
## Fixed
- Actually detect `avx`+`pclmulqdq` as [#317] actually was detecting
  256-bit PCLMULQDQ (#347)
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.

Request to revert: polyval: use avx+pclmulqdq features on x86/x86_64 #317

1 participant