[PATCH] D34092: [PPC] Enhance altivec conversion function macros implementation.

Tony Jiang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 10:24:23 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL305401: [PPC] Enhance altivec conversion function macros implementation. (authored by jtony).

Changed prior to commit:
  https://reviews.llvm.org/D34092?vs=102136&id=102568#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D34092

Files:
  cfe/trunk/include/clang/Basic/BuiltinsPPC.def
  cfe/trunk/test/CodeGen/builtins-ppc-error.c


Index: cfe/trunk/include/clang/Basic/BuiltinsPPC.def
===================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsPPC.def
+++ cfe/trunk/include/clang/Basic/BuiltinsPPC.def
@@ -51,10 +51,10 @@
 
 BUILTIN(__builtin_altivec_vrfip, "V4fV4f", "")
 
-BUILTIN(__builtin_altivec_vcfsx, "V4fV4ii", "")
-BUILTIN(__builtin_altivec_vcfux, "V4fV4ii", "")
-BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fi", "")
-BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fi", "")
+BUILTIN(__builtin_altivec_vcfsx, "V4fV4iIi", "")
+BUILTIN(__builtin_altivec_vcfux, "V4fV4iIi", "")
+BUILTIN(__builtin_altivec_vctsxs, "V4SiV4fIi", "")
+BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "")
 
 BUILTIN(__builtin_altivec_dss, "vUi", "")
 BUILTIN(__builtin_altivec_dssall, "v", "")
Index: cfe/trunk/test/CodeGen/builtins-ppc-error.c
===================================================================
--- cfe/trunk/test/CodeGen/builtins-ppc-error.c
+++ cfe/trunk/test/CodeGen/builtins-ppc-error.c
@@ -11,6 +11,8 @@
 #include <altivec.h>
 
 extern vector signed int vsi;
+extern vector signed int vui;
+extern vector float vf;
 extern vector unsigned char vuc;
 
 void testInsertWord(void) {
@@ -34,3 +36,34 @@
   vec_xxsldwi(1, 2, 3); //expected-error {{first two arguments to '__builtin_vsx_xxsldwi' must be vectors}}
   vec_xxsldwi(vsi, vuc, 2); //expected-error {{first two arguments to '__builtin_vsx_xxsldwi' must have the same type}}
 }
+
+void testCTF(int index) {
+  vec_ctf(vsi, index); //expected-error {{argument to '__builtin_altivec_vcfsx' must be a constant integer}}
+  vec_ctf(vui, index); //expected-error {{argument to '__builtin_altivec_vcfsx' must be a constant integer}}
+}
+
+void testVCFSX(int index) {
+  vec_vcfsx(vsi, index); //expected-error {{argument to '__builtin_altivec_vcfsx' must be a constant integer}}
+}
+
+void testVCFUX(int index) {
+  vec_vcfux(vui, index); //expected-error {{argument to '__builtin_altivec_vcfux' must be a constant integer}}
+}
+
+void testCTS(int index) {
+  vec_cts(vf, index); //expected-error {{argument to '__builtin_altivec_vctsxs' must be a constant integer}}
+
+}
+
+void testVCTSXS(int index) {
+  vec_vctsxs(vf, index); //expected-error {{argument to '__builtin_altivec_vctsxs' must be a constant integer}}
+}
+
+void testCTU(int index) {
+  vec_ctu(vf, index); //expected-error {{argument to '__builtin_altivec_vctuxs' must be a constant integer}}
+
+}
+
+void testVCTUXS(int index) {
+  vec_vctuxs(vf, index); //expected-error {{argument to '__builtin_altivec_vctuxs' must be a constant integer}}
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34092.102568.patch
Type: text/x-patch
Size: 2575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170614/d5aaf64d/attachment.bin>


More information about the llvm-commits mailing list