Skip to content

AVX10 feature mismatch between GCC and LLVM #135394

Closed
@sayantn

Description

@sayantn

The Intel Software Developers Manual (March 2025) specifies that AVX10.1 supports the following AVX512 instruction families (Volume 1, Table 16-2)

  • AVX512F
  • AVX512CD
  • AVX512BW
  • AVX512DQ
  • AVX512VBMI
  • AVX512IFMA
  • AVX512VNNI
  • AVX512BF16
  • AVX512VPOPCNTDQ
  • AVX512VBMI2
  • VAES
  • GFNI
  • VPCLMULQDQ
  • AVX512-BITALG
  • AVX512-FP16

With the following additional note

VAES, VPCLMULQDQ, and GFNI EVEX instructions will be supported on Intel AVX10.1 machines but will continue to be enumerated by their existing discrete CPUID feature flags. This requires the developer to check for both the feature and Intel AVX10, e.g., {AVX10.1 AND VAES}.

GCC and LLVM agree to enable all avx512* features, but they do not seem to agree about vaes, vpclmulqdq and gfni

  • Running gcc -mavx10.1-512 -Q --help=target shows that avx10.1-512 implies none of GFNI, VAES and VPCLMULQDQ
  • Examining X86.td shows that avx10.1-512 implies only VAES and VPCLMULQDQ, not GFNI

Both seems to be following the Intel spec, but in different ways, which is not good for the ecosystem in general, and creates more confusion between end users. This would probably require some collaboration with GCC (and possible Intel too).

GCC version

gcc (GCC) 14.2.1 20250207
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Activity

llvmbot

llvmbot commented on Apr 11, 2025

@llvmbot
Member

@llvm/issue-subscribers-backend-x86

Author: Sayantan Chakraborty (sayantn)

The Intel Software Developers Manual (March 2025) specifies that AVX10.1 supports the following AVX512 instruction families (Volume 1, Table 16-2) - AVX512F - AVX512CD - AVX512BW - AVX512DQ - AVX512VBMI - AVX512IFMA - AVX512VNNI - AVX512BF16 - AVX512VPOPCNTDQ - AVX512VBMI2 - VAES - GFNI - VPCLMULQDQ - AVX512-BITALG - AVX512-FP16

With the following additional note
> VAES, VPCLMULQDQ, and GFNI EVEX instructions will be supported on Intel AVX10.1 machines but will continue to be enumerated by their existing discrete CPUID feature flags. This requires the developer to check for both the feature and Intel AVX10, e.g., {AVX10.1 AND VAES}.

GCC and LLVM agree to enable all avx512* features, but they do not seem to agree about vaes, vpclmulqdq and gfni

  • Running gcc -mavx10.1-512 -Q --help=target shows that avx10.1-512 implies none of GFNI, VAES and VPCLMULQDQ
  • Examining X86.td shows that avx10.1-512 implies only VAES and VPCLMULQDQ, not GFNI

Both seems to be following the Intel spec, but in different ways, which is not good for the ecosystem in general, and creates more confusion between end users. This would probably require some collaboration with GCC (and possible Intel too).

GCC version

gcc (GCC) 14.2.1 20250207
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
pinskia

pinskia commented on Apr 11, 2025

@pinskia

Note gcc (GCC) 14.2.1 20250207 is pre the change to AVX10 to GCC. It was backported on Feb 18th to GCC 14 branch.
So you might want to recompare again. And there was the avx10.1 change to include 512 on March 24th.

sayantn

sayantn commented on Apr 11, 2025

@sayantn
Author

Even in the current git version (see here) avx10.1-512 only implies the avx512* target features, none of vaes, vpclmulqdq and gfni

self-assigned this
on Apr 12, 2025
phoebewang

phoebewang commented on Apr 12, 2025

@phoebewang
Contributor

Thanks for the report! According to latest SDM, both vaes and vpclmulqdq require a second flag. I'll change it in LLVM side.

added a commit that references this issue on Apr 14, 2025
ebba554
added a commit that references this issue on Apr 14, 2025
0c30835
added a commit that references this issue on Apr 17, 2025
4296b5e
added a commit that references this issue on May 4, 2025

Rollup merge of rust-lang#139675 - sayantn:avx10, r=Amanieu

ed7590f
added a commit that references this issue on May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @phoebewang@pinskia@EugeneZelenko@llvmbot@sayantn

    Issue actions

      AVX10 feature mismatch between GCC and LLVM · Issue #135394 · llvm/llvm-project