diff options
author | Nico Weber <nicolasweber@gmx.de> | 2018-01-25 15:24:43 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2018-01-25 15:24:43 +0000 |
commit | 64081fe81014a3957542b9d239244a34076c0d4b (patch) | |
tree | 0f3f7a85e71d90324b976b114c728f265a0f29ee /test/Driver/cl-x86-flags.c | |
parent | 96b4d114c73144574569f74e1e04e14f64513026 (diff) | |
download | clang-64081fe81014a3957542b9d239244a34076c0d4b.tar.gz |
[clang-cl] Add support for /arch:AVX512F and /arch:AVX512
For /arch:AVX512F:
clang-cl and cl.exe both defines __AVX512F__ __AVX512CD__.
clang-cl also defines __AVX512ER__ __AVX512PF__.
64-bit cl.exe also defines (according to /Bz) _NO_PREFETCHW.
For /arch:AVX512:
clang-cl and cl.exe both define
__AVX512F__ __AVX512CD__ __AVX512BW__ __AVX512DQ__ __AVX512VL__.
64-bit cl.exe also defines _NO_PREFETCHW.
So not 100% identical, but pretty close.
Also refactor the existing AVX / AVX2 code to not repeat itself in both the
32-bit and 64-bit cases.
https://reviews.llvm.org/D42538
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323433 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/cl-x86-flags.c')
-rw-r--r-- | test/Driver/cl-x86-flags.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/Driver/cl-x86-flags.c b/test/Driver/cl-x86-flags.c index cc5c62904f..4dc1b230f5 100644 --- a/test/Driver/cl-x86-flags.c +++ b/test/Driver/cl-x86-flags.c @@ -68,6 +68,26 @@ // RUN: %clang_cl -m32 -arch:avx2 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx2 %s // avx2: argument unused during compilation +// RUN: %clang_cl -m32 -arch:AVX512F --target=i386-pc-windows /c -Xclang -verify -DTEST_32_ARCH_AVX512F -- %s +#if defined(TEST_32_ARCH_AVX512F) +#if _M_IX86_FP != 2 || !__AVX__ || !__AVX2__ || !__AVX512F__ || __AVX512BW__ +#error fail +#endif +#endif + +// RUN: %clang_cl -m32 -arch:avx512f --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx512f %s +// avx512f: argument unused during compilation + +// RUN: %clang_cl -m32 -arch:AVX512 --target=i386-pc-windows /c -Xclang -verify -DTEST_32_ARCH_AVX512 -- %s +#if defined(TEST_32_ARCH_AVX512) +#if _M_IX86_FP != 2 || !__AVX__ || !__AVX2__ || !__AVX512F__ || !__AVX512BW__ +#error fail +#endif +#endif + +// RUN: %clang_cl -m32 -arch:avx512 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx512 %s +// avx512: argument unused during compilation + // RUN: %clang_cl -m64 -arch:AVX --target=x86_64-pc-windows /c -Xclang -verify -DTEST_64_ARCH_AVX -- %s #if defined(TEST_64_ARCH_AVX) #if _M_IX86_FP || !__AVX__ || __AVX2__ || __AVX512F__ || __AVX512BW__ @@ -88,5 +108,25 @@ // RUN: %clang_cl -m64 -arch:avx2 --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx264 %s // avx264: argument unused during compilation +// RUN: %clang_cl -m64 -arch:AVX512F --target=i386-pc-windows /c -Xclang -verify -DTEST_64_ARCH_AVX512F -- %s +#if defined(TEST_64_ARCH_AVX512F) +#if _M_IX86_FP || !__AVX__ || !__AVX2__ || !__AVX512F__ || __AVX512BW__ +#error fail +#endif +#endif + +// RUN: %clang_cl -m64 -arch:avx512f --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx512f64 %s +// avx512f64: argument unused during compilation + +// RUN: %clang_cl -m64 -arch:AVX512 --target=i386-pc-windows /c -Xclang -verify -DTEST_64_ARCH_AVX512 -- %s +#if defined(TEST_64_ARCH_AVX512) +#if _M_IX86_FP || !__AVX__ || !__AVX2__ || !__AVX512F__ || !__AVX512BW__ +#error fail +#endif +#endif + +// RUN: %clang_cl -m64 -arch:avx512 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx51264 %s +// avx51264: argument unused during compilation + void f() { } |