Implicitly enable evex512 if avx512 is enabled by nikic · Pull Request #121088 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation2 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@nikic

LLVM 18 requires the evex512 feature to allow use of zmm registers. LLVM automatically sets it when using a generic CPU, but not when -C target-cpu is specified. This will result either in backend legalization crashes, or code unexpectedly using ymm instead of zmm registers.

For now, make sure that avx512* features imply evex512. Long term we'll probably have to deal with the AVX10 mess somehow.

Fixes #121081.

r? @Amanieu

@nikic

LLVM 18 requires the evex512 feature to allow use of zmm registers. LLVM automatically sets it when using a generic CPU, but not when -C target-cpu is specified. This will result either in backend legalization crashes, or code unexpectedly using ymm instead of zmm registers.

For now, make sure that avx512* features imply evex512. Long term we'll probably have to deal with the AVX10 mess somehow.

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Feb 14, 2024

@nikic nikic mentioned this pull request

Feb 14, 2024

@Amanieu

@bors

📌 Commit 369fff6 has been approved by Amanieu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Feb 14, 2024

This was referenced

Feb 14, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Feb 15, 2024

@bors

…llaumeGomez

Rollup of 8 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Feb 15, 2024

@rust-timer

Rollup merge of rust-lang#121088 - nikic:evex512, r=Amanieu

Implicitly enable evex512 if avx512 is enabled

LLVM 18 requires the evex512 feature to allow use of zmm registers. LLVM automatically sets it when using a generic CPU, but not when -C target-cpu is specified. This will result either in backend legalization crashes, or code unexpectedly using ymm instead of zmm registers.

For now, make sure that avx512* features imply evex512. Long term we'll probably have to deal with the AVX10 mess somehow.

Fixes rust-lang#121081.

r? @Amanieu

@nikic nikic mentioned this pull request

Feb 17, 2024

2 tasks

freebsd-git pushed a commit to freebsd/freebsd-src that referenced this pull request

May 16, 2024

@DimitryAndric

[X86][Driver] Do not add -evex512 for -march=native when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like:

/wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^

Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust.

(For rust itself there is also a similar issue reported at rust-lang/rust#121088).

PR: 276104 Reported by: netchild MFC after: 3 days

freebsd-git pushed a commit to freebsd/freebsd-src that referenced this pull request

May 20, 2024

@DimitryAndric

[X86][Driver] Do not add -evex512 for -march=native when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like:

/wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^

Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust.

(For rust itself there is also a similar issue reported at rust-lang/rust#121088).

PR: 276104 Reported by: netchild MFC after: 3 days

(cherry picked from commit fcfb2d6)

freebsd-git pushed a commit to freebsd/freebsd-src that referenced this pull request

May 20, 2024

@DimitryAndric

[X86][Driver] Do not add -evex512 for -march=native when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like:

/wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^

Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust.

(For rust itself there is also a similar issue reported at rust-lang/rust#121088).

PR: 276104 Reported by: netchild MFC after: 3 days

(cherry picked from commit fcfb2d6)

freebsd-git pushed a commit to freebsd/freebsd-src that referenced this pull request

May 20, 2024

@DimitryAndric

[X86][Driver] Do not add -evex512 for -march=native when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like:

/wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^

Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust.

(For rust itself there is also a similar issue reported at rust-lang/rust#121088).

PR: 276104 Reported by: netchild Approved by: re (cperciva) MFC after: 3 days

(cherry picked from commit fcfb2d6) (cherry picked from commit 14efb9b)

bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request

Aug 28, 2024

@DimitryAndric @bsdjhb

[X86][Driver] Do not add -evex512 for -march=native when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like:

/wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^

Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust.

(For rust itself there is also a similar issue reported at rust-lang/rust#121088).

PR: 276104 Reported by: netchild MFC after: 3 days

bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request

Aug 29, 2024

@DimitryAndric @bsdjhb

[X86][Driver] Do not add -evex512 for -march=native when the target doesn't support AVX512 (#91694)

This prevents problems with ports that fail to build with CPUTYPE=native, if the native CPU supports AVX512F, resulting in errors like:

/wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: always_inline function '_mm512_set1_epi8' requires target feature 'evex512', but would be inlined into function 'adler32_x86_avx512_vl512_vnni' that is compiled without support for 'evex512' 197 | const vec_t ones = VSET1_8(1); | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^ /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:197:21: error: AVX vector return of type '__m512i' (vector of 8 'long long' values) without 'evex512' enabled changes the ABI /wrkdirs/usr/ports/archivers/libdeflate/work/libdeflate-1.20/lib/x86/adler32_template.h:116:23: note: expanded from macro 'VSET1_8' 116 | # define VSET1_8(a) _mm512_set1_epi8(a) | ^

Ports known to be affected are: archivers/libdeflate, devel/highway, www/node20, and lang/rust.

(For rust itself there is also a similar issue reported at rust-lang/rust#121088).

PR: 276104 Reported by: netchild MFC after: 3 days

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.