diff options
author | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2015-07-10 13:11:34 +0000 |
---|---|---|
committer | Nemanja Ivanovic <nemanja.i.ibm@gmail.com> | 2015-07-10 13:11:34 +0000 |
commit | 26c3534b84f2635bf2b68bbc3bf42f8cc68e64d0 (patch) | |
tree | 65837affbe4937bfa02b2c4f2b6db57bc7e28e33 /clang/test/Driver/ppc-dependent-options.cpp | |
parent | ddb44b85f0536b1e6b0fdc8e74b7f43fda370a4c (diff) | |
download | bcm5719-llvm-26c3534b84f2635bf2b68bbc3bf42f8cc68e64d0.tar.gz bcm5719-llvm-26c3534b84f2635bf2b68bbc3bf42f8cc68e64d0.zip |
Add missing builtins to altivec.h for ABI compliance (vol. 3)
This patch corresponds to review:
http://reviews.llvm.org/D10972
Fix for the handling of dependent features that are enabled by default
on some CPU's (such as -mvsx, -mpower8-vector).
Also provides a number of new interfaces or fixes existing ones in
altivec.h.
Changed signatures to conform to ABI:
vector short vec_perm(vector signed short, vector signed short, vector unsigned char)
vector int vec_perm(vector signed int, vector signed int, vector unsigned char)
vector long long vec_perm(vector signed long long, vector signed long long, vector unsigned char)
vector signed char vec_sld(vector signed char, vector signed char, const int)
vector unsigned char vec_sld(vector unsigned char, vector unsigned char, const int)
vector bool char vec_sld(vector bool char, vector bool char, const int)
vector unsigned short vec_sld(vector unsigned short, vector unsigned short, const int)
vector signed short vec_sld(vector signed short, vector signed short, const int)
vector signed int vec_sld(vector signed int, vector signed int, const int)
vector unsigned int vec_sld(vector unsigned int, vector unsigned int, const int)
vector float vec_sld(vector float, vector float, const int)
vector signed char vec_splat(vector signed char, const int)
vector unsigned char vec_splat(vector unsigned char, const int)
vector bool char vec_splat(vector bool char, const int)
vector signed short vec_splat(vector signed short, const int)
vector unsigned short vec_splat(vector unsigned short, const int)
vector bool short vec_splat(vector bool short, const int)
vector pixel vec_splat(vector pixel, const int)
vector signed int vec_splat(vector signed int, const int)
vector unsigned int vec_splat(vector unsigned int, const int)
vector bool int vec_splat(vector bool int, const int)
vector float vec_splat(vector float, const int)
Added a VSX path to:
vector float vec_round(vector float)
Added interfaces:
vector signed char vec_eqv(vector signed char, vector signed char)
vector signed char vec_eqv(vector bool char, vector signed char)
vector signed char vec_eqv(vector signed char, vector bool char)
vector unsigned char vec_eqv(vector unsigned char, vector unsigned char)
vector unsigned char vec_eqv(vector bool char, vector unsigned char)
vector unsigned char vec_eqv(vector unsigned char, vector bool char)
vector signed short vec_eqv(vector signed short, vector signed short)
vector signed short vec_eqv(vector bool short, vector signed short)
vector signed short vec_eqv(vector signed short, vector bool short)
vector unsigned short vec_eqv(vector unsigned short, vector unsigned short)
vector unsigned short vec_eqv(vector bool short, vector unsigned short)
vector unsigned short vec_eqv(vector unsigned short, vector bool short)
vector signed int vec_eqv(vector signed int, vector signed int)
vector signed int vec_eqv(vector bool int, vector signed int)
vector signed int vec_eqv(vector signed int, vector bool int)
vector unsigned int vec_eqv(vector unsigned int, vector unsigned int)
vector unsigned int vec_eqv(vector bool int, vector unsigned int)
vector unsigned int vec_eqv(vector unsigned int, vector bool int)
vector signed long long vec_eqv(vector signed long long, vector signed long long)
vector signed long long vec_eqv(vector bool long long, vector signed long long)
vector signed long long vec_eqv(vector signed long long, vector bool long long)
vector unsigned long long vec_eqv(vector unsigned long long, vector unsigned long long)
vector unsigned long long vec_eqv(vector bool long long, vector unsigned long long)
vector unsigned long long vec_eqv(vector unsigned long long, vector bool long long)
vector float vec_eqv(vector float, vector float)
vector float vec_eqv(vector bool int, vector float)
vector float vec_eqv(vector float, vector bool int)
vector double vec_eqv(vector double, vector double)
vector double vec_eqv(vector bool long long, vector double)
vector double vec_eqv(vector double, vector bool long long)
vector bool long long vec_perm(vector bool long long, vector bool long long, vector unsigned char)
vector double vec_round(vector double)
vector double vec_splat(vector double, const int)
vector bool long long vec_splat(vector bool long long, const int)
vector signed long long vec_splat(vector signed long long, const int)
vector unsigned long long vec_splat(vector unsigned long long,
vector bool int vec_sld(vector bool int, vector bool int, const int)
vector bool short vec_sld(vector bool short, vector bool short, const int)
llvm-svn: 241904
Diffstat (limited to 'clang/test/Driver/ppc-dependent-options.cpp')
-rw-r--r-- | clang/test/Driver/ppc-dependent-options.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/clang/test/Driver/ppc-dependent-options.cpp b/clang/test/Driver/ppc-dependent-options.cpp new file mode 100644 index 00000000000..f1ae92af1a4 --- /dev/null +++ b/clang/test/Driver/ppc-dependent-options.cpp @@ -0,0 +1,61 @@ +// REQUIRES: powerpc-registered-target +// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 %s 2>&1 | \ +// RUN: FileCheck %s -check-prefix=CHECK-DEFAULT + +// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \ +// RUN: -mno-vsx -mpower8-vector %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-NVSX-P8V + +// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \ +// RUN: -mno-vsx -mdirect-move %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-NVSX-DMV + +// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \ +// RUN: -mno-vsx -mpower8-vector -mvsx %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-DEFAULT + +// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \ +// RUN: -mno-vsx -mdirect-move -mvsx %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-DEFAULT + +// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \ +// RUN: -mpower8-vector -mno-vsx %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-NVSX-P8V + +// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \ +// RUN: -mdirect-move -mno-vsx %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-NVSX-DMV + +// RUN: not %clang -fsyntax-only -mcpu=power8 -std=c++11 \ +// RUN: -mno-vsx %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-NVSX + +// RUN: not %clang -fsyntax-only -mcpu=power6 -std=c++11 %s 2>&1 | \ +// RUN: FileCheck %s -check-prefix=CHECK-NVSX + +// RUN: not %clang -fsyntax-only -mcpu=power6 -std=c++11 \ +// RUN: -mpower8-vector %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-DEFAULT + +// RUN: not %clang -fsyntax-only -mcpu=power6 -std=c++11 \ +// RUN: -mdirect-move %s 2>&1 | FileCheck %s \ +// RUN: -check-prefix=CHECK-VSX + +#ifdef __VSX__ +static_assert(false, "VSX enabled"); +#endif + +#ifdef __POWER8_VECTOR__ +static_assert(false, "P8V enabled"); +#endif + +#if !defined(__VSX__) && !defined(__POWER8_VECTOR__) +static_assert(false, "Neither enabled"); +#endif + +// CHECK-DEFAULT: VSX enabled +// CHECK-DEFAULT: P8V enabled +// CHECK-NVSX-P8V: error: option '-mpower8-vector' cannot be specified with '-mno-vsx' +// CHECK-NVSX-DMV: error: option '-mdirect-move' cannot be specified with '-mno-vsx' +// CHECK-NVSX: Neither enabled +// CHECK-VSX: VSX enabled |