forked from wangliu-iscas/gcc-patch
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i386: Guard 128 bit VAES builtins with AVX512VL
Hi all, Currently on trunk, both usage of intrin and builtin for 128 bit VAES ISA will result in ICE since we did not check AVX512VL until pattern, which is not user expected. This patch aims to fix that ICE and throw an error under this scenario. Regtested on x86-64-linux-gnu{-m32,}. Ok for trunk? BRs, Haochen Since commit 24a8acc, 128 bit intrin is enabled for VAES. However, AVX512VL is not checked until we reached into pattern, which reports an ICE. Added an AVX512VL guard at builtin to report error when checking ISA flags. gcc/ChangeLog: * config/i386/i386-builtins.cc (ix86_init_mmx_sse_builtins): Add OPTION_MASK_ISA_AVX512VL. * config/i386/i386-expand.cc (ix86_check_builtin_isa_match): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/avx512vl-vaes-1.c: New test.
- Loading branch information
1 parent
c2d62cd
commit c03b0b8
Showing
3 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-mvaes -mno-avx512vl -mno-aes" } */ | ||
|
||
#include <immintrin.h> | ||
|
||
typedef long long v2di __attribute__((vector_size (16))); | ||
|
||
v2di | ||
f1 (v2di x, v2di y) | ||
{ | ||
return __builtin_ia32_aesenc128 (x, y); /* { dg-error "needs isa option" } */ | ||
} |