r266122 - Add a couple of missing vsx load and store intrinsics.

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 12 14:08:55 PDT 2016


Author: echristo
Date: Tue Apr 12 16:08:54 2016
New Revision: 266122

URL: http://llvm.org/viewvc/llvm-project?rev=266122&view=rev
Log:
Add a couple of missing vsx load and store intrinsics.

Patch by Jing Yu!

Modified:
    cfe/trunk/lib/Headers/altivec.h
    cfe/trunk/test/CodeGen/builtins-ppc-vsx.c

Modified: cfe/trunk/lib/Headers/altivec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/altivec.h?rev=266122&r1=266121&r2=266122&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/altivec.h (original)
+++ cfe/trunk/lib/Headers/altivec.h Tue Apr 12 16:08:54 2016
@@ -10283,6 +10283,11 @@ vec_vsx_ld(int __a, const vector float *
   return (vector float)__builtin_vsx_lxvw4x(__a, __b);
 }
 
+static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,
+                                                       const float *__b) {
+  return (vector float)__builtin_vsx_lxvw4x(__a, __b);
+}
+
 static __inline__ vector signed long long __ATTRS_o_ai
 vec_vsx_ld(int __a, const vector signed long long *__b) {
   return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);
@@ -10374,6 +10379,11 @@ static __inline__ void __ATTRS_o_ai vec_
   __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
 }
 
+static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,
+                                               float *__c) {
+  __builtin_vsx_stxvw4x((vector int)__a, __b, __c);
+}
+
 static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,
                                                int __b,
                                                vector signed long long *__c) {

Modified: cfe/trunk/test/CodeGen/builtins-ppc-vsx.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-ppc-vsx.c?rev=266122&r1=266121&r2=266122&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-ppc-vsx.c (original)
+++ cfe/trunk/test/CodeGen/builtins-ppc-vsx.c Tue Apr 12 16:08:54 2016
@@ -18,6 +18,7 @@ vector signed long long vsll = { 255LL,
 vector unsigned long long vull = { 1447LL, 2894LL };
 vector signed short vss = { -1, 2, -3, 4, -5, 6, -7, 8 };
 vector unsigned short vus = { 0, 1, 2, 3, 4, 5, 6, 7 };
+float f = 12.34;
 double d = 23.4;
 signed char sc = -128;
 unsigned char uc = 1;
@@ -38,6 +39,7 @@ vector bool char res_vbc;
 vector signed char res_vsc;
 vector unsigned char res_vuc;
 
+float res_f;
 double res_d;
 signed int res_si;
 unsigned int res_ui;
@@ -335,6 +337,10 @@ void test1() {
 // CHECK: @llvm.ppc.vsx.lxvw4x
 // CHECK-LE: @llvm.ppc.vsx.lxvw4x
 
+  res_vf = vec_vsx_ld (0, &f);
+// CHECK: @llvm.ppc.vsx.lxvw4x
+// CHECK-LE: @llvm.ppc.vsx.lxvw4x
+
   res_vsll = vec_vsx_ld(0, &vsll);
 // CHECK: @llvm.ppc.vsx.lxvd2x
 // CHECK-LE: @llvm.ppc.vsx.lxvd2x
@@ -413,6 +419,10 @@ void test1() {
 // CHECK: @llvm.ppc.vsx.stxvw4x
 // CHECK-LE: @llvm.ppc.vsx.stxvw4x
 
+  vec_vsx_st(vf, 0, &res_f);
+// CHECK: @llvm.ppc.vsx.stxvw4x
+// CHECK-LE: @llvm.ppc.vsx.stxvw4x
+
   vec_vsx_st(vsll, 0, &res_vsll);
 // CHECK: @llvm.ppc.vsx.stxvd2x
 // CHECK-LE: @llvm.ppc.vsx.stxvd2x




More information about the cfe-commits mailing list