Skip to content

Commit d3563bb

Browse files
committed
rustc: Add some more compatibility with AVX-512
* Increase the maximum vector size in the ABI calculations to ensure that AVX-512 operands are immediates. * Add a few more `target_feature` matchings for AVX-512 features
1 parent d5ff0e6 commit d3563bb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/librustc_trans/cabi_x86_64.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ enum Class {
2727
#[derive(Clone, Copy, Debug)]
2828
struct Memory;
2929

30-
// Currently supported vector size (AVX).
31-
const LARGEST_VECTOR_SIZE: usize = 256;
30+
// Currently supported vector size (AVX-512).
31+
const LARGEST_VECTOR_SIZE: usize = 512;
3232
const MAX_EIGHTBYTES: usize = LARGEST_VECTOR_SIZE / 64;
3333

3434
fn classify_arg<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, arg: &ArgType<'tcx>)

src/librustc_trans/llvm_util.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ const X86_WHITELIST: &'static [&'static str] = &["avx\0", "avx2\0", "bmi\0", "bm
8080
"ssse3\0", "tbm\0", "lzcnt\0", "popcnt\0",
8181
"sse4a\0", "rdrnd\0", "rdseed\0", "fma\0",
8282
"xsave\0", "xsaveopt\0", "xsavec\0",
83-
"xsaves\0"];
83+
"xsaves\0",
84+
"avx512bw\0", "avx512cd\0",
85+
"avx512dq\0", "avx512er\0",
86+
"avx512f\0", "avx512ifma\0",
87+
"avx512pf\0", "avx512vbmi\0",
88+
"avx512vl\0", "avx512vpopcntdq\0"];
8489

8590
const HEXAGON_WHITELIST: &'static [&'static str] = &["hvx\0", "hvx-double\0"];
8691

0 commit comments

Comments
 (0)