[clang] 7a5641d - [PowerPC] Add missing casts for vec_xlds and vec_load_splats

Nemanja Ivanovic via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 22 08:31:36 PDT 2021


Author: Nemanja Ivanovic
Date: 2021-04-22T10:31:00-05:00
New Revision: 7a5641d651963e91b05f25667df6cc694503248f

URL: https://github.com/llvm/llvm-project/commit/7a5641d651963e91b05f25667df6cc694503248f
DIFF: https://github.com/llvm/llvm-project/commit/7a5641d651963e91b05f25667df6cc694503248f.diff

LOG: [PowerPC] Add missing casts for vec_xlds and vec_load_splats

The previous commits just missed some pointer casts and ended up
producing warnings.

Added: 
    

Modified: 
    clang/lib/Headers/altivec.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Headers/altivec.h b/clang/lib/Headers/altivec.h
index 4eac243ef2d5..57d7828f5285 100644
--- a/clang/lib/Headers/altivec.h
+++ b/clang/lib/Headers/altivec.h
@@ -17410,56 +17410,56 @@ vec_xl_zext(ptr
diff _t __offset, const unsigned long long *__pointer) {
 #ifdef __VSX__
 static __inline__ vector signed long long __ATTRS_o_ai
 vec_xlds(ptr
diff _t __offset, const signed long long *__ptr) {
-  signed long long *__addr = (signed char *)__ptr + __offset;
+  signed long long *__addr = (signed long long*)((signed char *)__ptr + __offset);
   return (vector signed long long) *__addr;
 }
 
 static __inline__ vector unsigned long long __ATTRS_o_ai
 vec_xlds(ptr
diff _t __offset, const unsigned long long *__ptr) {
-  unsigned long long *__addr = (signed char *)__ptr + __offset;
+  unsigned long long *__addr = (unsigned long long *)((signed char *)__ptr + __offset);
   return (unaligned_vec_ull) *__addr;
 }
 
 static __inline__ vector double __ATTRS_o_ai vec_xlds(ptr
diff _t __offset,
                                                       const double *__ptr) {
-  double *__addr = (signed char *)__ptr + __offset;
+  double *__addr = (double*)((signed char *)__ptr + __offset);
   return (unaligned_vec_double) *__addr;
 }
 
 /* vec_load_splats */
 static __inline__ vector signed int __ATTRS_o_ai
 vec_load_splats(signed long long __offset, const signed int *__ptr) {
-  signed int *__addr = (signed char *)__ptr + __offset;
+  signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
   return (vector signed int)*__addr;
 }
 
 static __inline__ vector signed int __ATTRS_o_ai
 vec_load_splats(unsigned long long __offset, const signed int *__ptr) {
-  signed int *__addr = (signed char *)__ptr + __offset;
+  signed int *__addr = (signed int*)((signed char *)__ptr + __offset);
   return (vector signed int)*__addr;
 }
 
 static __inline__ vector unsigned int __ATTRS_o_ai
 vec_load_splats(signed long long __offset, const unsigned int *__ptr) {
-  unsigned int *__addr = (signed char *)__ptr + __offset;
+  unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
   return (vector unsigned int)*__addr;
 }
 
 static __inline__ vector unsigned int __ATTRS_o_ai
 vec_load_splats(unsigned long long __offset, const unsigned int *__ptr) {
-  unsigned int *__addr = (signed char *)__ptr + __offset;
+  unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);
   return (vector unsigned int)*__addr;
 }
 
 static __inline__ vector float __ATTRS_o_ai
 vec_load_splats(signed long long __offset, const float *__ptr) {
-  float *__addr = (signed char *)__ptr + __offset;
+  float *__addr = (float*)((signed char *)__ptr + __offset);
   return (vector float)*__addr;
 }
 
 static __inline__ vector float __ATTRS_o_ai
 vec_load_splats(unsigned long long __offset, const float *__ptr) {
-  float *__addr = (signed char *)__ptr + __offset;
+  float *__addr = (float*)((signed char *)__ptr + __offset);
   return (vector float)*__addr;
 }
 #endif


        


More information about the cfe-commits mailing list