From 59eb767e11d4ffefb5f55409524e5c8416b2b0db Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Fri, 10 Oct 2014 15:09:43 +0000 Subject: [PowerPC] Add feature for Power8 vector extensions The current VSX feature for PowerPC specifies availability of the VSX instructions added with the 2.06 architecture version. With 2.07, the architecture adds new instructions to both the Category:Vector and Category:VSX instruction sets. Additionally, unaligned vector storage operations have improved performance. This patch adds a feature to provide access to the new instructions and performance capabilities of Power8. For compatibility with GCC, the feature is controlled via a new -mpower8-vector switch, and the feature causes the __POWER8_VECTOR__ builtin define to be generated by the preprocessor. There is a companion patch for llvm being committed at the same time. llvm-svn: 219502 --- clang/test/Driver/ppc-features.cpp | 6 ++++++ clang/test/Preprocessor/predefined-arch-macros.c | 7 +++++++ 2 files changed, 13 insertions(+) (limited to 'clang/test') diff --git a/clang/test/Driver/ppc-features.cpp b/clang/test/Driver/ppc-features.cpp index c7b59cc7aaa..c62f5b96973 100644 --- a/clang/test/Driver/ppc-features.cpp +++ b/clang/test/Driver/ppc-features.cpp @@ -95,6 +95,12 @@ // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -mvsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-VSX %s // CHECK-VSX: "-target-feature" "+vsx" +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOP8VECTOR %s +// CHECK-NOP8VECTOR: "-target-feature" "-power8-vector" + +// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-power8-vector -mpower8-vector -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-P8VECTOR %s +// CHECK-P8VECTOR: "-target-feature" "+power8-vector" + // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s // CHECK-NOCRBITS: "-target-feature" "-crbits" diff --git a/clang/test/Preprocessor/predefined-arch-macros.c b/clang/test/Preprocessor/predefined-arch-macros.c index 5f5380926dc..8b58c9ce01f 100644 --- a/clang/test/Preprocessor/predefined-arch-macros.c +++ b/clang/test/Preprocessor/predefined-arch-macros.c @@ -1652,3 +1652,10 @@ // RUN: | FileCheck %s -check-prefix=CHECK_PPC_VSX_M64 // // CHECK_PPC_VSX_M64: #define __VSX__ +// +// RUN: %clang -mpower8-vector -E -dM %s -o - 2>&1 \ +// RUN: -target powerpc64-unknown-linux \ +// RUN: | FileCheck %s -check-prefix=CHECK_PPC_POWER8_VECTOR_M64 +// +// CHECK_PPC_POWER8_VECTOR_M64: #define __POWER8_VECTOR__ +// -- cgit v1.2.3