r269742 - [AVX512] Add parentheses around macro arguments in AVX512PF intrinsics. Remove leading underscores from macro argument names. Add explicit typecasts to all macro arguments and return values. And finally reformat after all the adjustments.

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Mon May 16 21:41:40 PDT 2016


Author: ctopper
Date: Mon May 16 23:41:40 2016
New Revision: 269742

URL: http://llvm.org/viewvc/llvm-project?rev=269742&view=rev
Log:
[AVX512] Add parentheses around macro arguments in AVX512PF intrinsics. Remove leading underscores from macro argument names. Add explicit typecasts to all macro arguments and return values. And finally reformat after all the adjustments.

This is a mostly mechanical change accomplished with a script. I tried to split out any changes to the typecasts that already existed into separate commits.

Modified:
    cfe/trunk/lib/Headers/avx512pfintrin.h

Modified: cfe/trunk/lib/Headers/avx512pfintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512pfintrin.h?rev=269742&r1=269741&r2=269742&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512pfintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512pfintrin.h Mon May 16 23:41:40 2016
@@ -31,61 +31,61 @@
 /* Define the default attributes for the functions in this file. */
 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512pf")))
 
-#define _mm512_mask_prefetch_i32gather_pd( index,  mask, addr,  scale, hint) __extension__ ({\
-__builtin_ia32_gatherpfdpd (mask, (__v8si) index, (long long const *) addr, scale, hint);\
-})
-
-#define _mm512_mask_prefetch_i32gather_ps( index,  mask, addr, scale,  hint) ({\
-__builtin_ia32_gatherpfdps (mask, (__v16si) index, (int const *) addr, scale, hint);\
-})
-
-#define _mm512_mask_prefetch_i64gather_pd( index,  mask, addr,  scale, hint) __extension__ ({\
-__builtin_ia32_gatherpfqpd (mask, (__v8di) index, (long long const *) addr, scale, hint);\
-})
-
-#define _mm512_mask_prefetch_i64gather_ps( index,  mask, addr, scale,  hint) ({\
-__builtin_ia32_gatherpfqps (mask, (__v8di) index, (int const *) addr, scale, hint);\
-})
-
-#define _mm512_prefetch_i32scatter_pd(addr,  index,  scale,  hint) __extension__ ({\
-__builtin_ia32_scatterpfdpd ((__mmask8) -1, (__v8si) index, \
-                            (void  *)addr, scale, hint);\
-})
-
-#define _mm512_mask_prefetch_i32scatter_pd(addr,  mask,  index,  scale,  hint) __extension__ ({\
-__builtin_ia32_scatterpfdpd (mask, (__v8si) index, (void  *) addr,\
-                             scale, hint);\
-})
+#define _mm512_mask_prefetch_i32gather_pd(index, mask, addr, scale, hint) __extension__ ({\
+  __builtin_ia32_gatherpfdpd((__mmask8)(mask), (__v8si)(__m256i)(index), \
+                             (long long const *)(addr), (int)(scale), \
+                             (int)(hint)); })
+
+#define _mm512_mask_prefetch_i32gather_ps(index, mask, addr, scale, hint) ({\
+  __builtin_ia32_gatherpfdps((__mmask16)(mask), \
+                             (__v16si)(__m512i)(index), (int const *)(addr), \
+                             (int)(scale), (int)(hint)); })
+
+#define _mm512_mask_prefetch_i64gather_pd(index, mask, addr, scale, hint) __extension__ ({\
+  __builtin_ia32_gatherpfqpd((__mmask8)(mask), (__v8di)(__m512i)(index), \
+                             (long long const *)(addr), (int)(scale), \
+                             (int)(hint)); })
+
+#define _mm512_mask_prefetch_i64gather_ps(index, mask, addr, scale, hint) ({\
+  __builtin_ia32_gatherpfqps((__mmask8)(mask), (__v8di)(__m512i)(index), \
+                             (int const *)(addr), (int)(scale), (int)(hint)); })
+
+#define _mm512_prefetch_i32scatter_pd(addr, index, scale, hint) __extension__ ({\
+  __builtin_ia32_scatterpfdpd((__mmask8)-1, (__v8si)(__m256i)(index), \
+                              (long long *)(addr), (int)(scale), \
+                              (int)(hint)); })
+
+#define _mm512_mask_prefetch_i32scatter_pd(addr, mask, index, scale, hint) __extension__ ({\
+  __builtin_ia32_scatterpfdpd((__mmask8)(mask), (__v8si)(__m256i)(index), \
+                              (long long *)(addr), (int)(scale), \
+                              (int)(hint)); })
 
 #define _mm512_prefetch_i32scatter_ps(addr, index, scale, hint) __extension__ ({\
-__builtin_ia32_scatterpfdps ((__mmask16) -1, (__v16si) index, (void  *) addr,\
-                             scale, hint);\
-})
+  __builtin_ia32_scatterpfdps((__mmask16)-1, (__v16si)(__m512i)(index), \
+                              (int *)(addr), (int)(scale), (int)(hint)); })
 
 #define _mm512_mask_prefetch_i32scatter_ps(addr, mask, index, scale, hint) __extension__ ({\
-__builtin_ia32_scatterpfdps (mask, (__v16si) index, (void  *) addr,\
-                             scale, hint);\
-})
+  __builtin_ia32_scatterpfdps((__mmask16)(mask), \
+                              (__v16si)(__m512i)(index), (int *)(addr), \
+                              (int)(scale), (int)(hint)); })
 
 #define _mm512_prefetch_i64scatter_pd(addr, index, scale, hint) __extension__ ({\
-__builtin_ia32_scatterpfqpd ((__mmask8) -1, (__v8di) index, (void  *) addr,\
-                             scale, hint);\
-})
+  __builtin_ia32_scatterpfqpd((__mmask8)-1, (__v8di)(__m512i)(index), \
+                              (long long *)(addr), (int)(scale), \
+                              (int)(hint)); })
 
 #define _mm512_mask_prefetch_i64scatter_pd(addr, mask, index, scale, hint) __extension__ ({\
-__builtin_ia32_scatterpfqpd (mask, (__v8di) index, (void  *) addr,\
-                             scale, hint);\
-})
+  __builtin_ia32_scatterpfqpd((__mmask8)(mask), (__v8di)(__m512i)(index), \
+                              (long long *)(addr), (int)(scale), \
+                              (int)(hint)); })
 
 #define _mm512_prefetch_i64scatter_ps(addr, index, scale, hint) __extension__ ({\
-__builtin_ia32_scatterpfqps ((__mmask8) -1, (__v8di) index, (void  *) addr,\
-                             scale, hint);\
-})
+  __builtin_ia32_scatterpfqps((__mmask8)-1, (__v8di)(__m512i)(index), \
+                              (int *)(addr), (int)(scale), (int)(hint)); })
 
 #define _mm512_mask_prefetch_i64scatter_ps(addr, mask, index, scale, hint) __extension__ ({\
-__builtin_ia32_scatterpfqps (mask, (__v8di) index, (void  *) addr,\
-                             scale, hint);\
-})
+  __builtin_ia32_scatterpfqps((__mmask8)(mask), (__v8di)(__m512i)(index), \
+                              (int *)(addr), (int)(scale), (int)(hint)); })
 
 #undef __DEFAULT_FN_ATTRS
 




More information about the cfe-commits mailing list