[cfe-commits] r146791 - in /cfe/trunk: include/clang/Basic/BuiltinsX86.def lib/Headers/avxintrin.h test/CodeGen/builtins-x86.c
Chad Rosier
mcrosier at apple.com
Fri Dec 16 16:15:26 PST 2011
Author: mcrosier
Date: Fri Dec 16 18:15:26 2011
New Revision: 146791
URL: http://llvm.org/viewvc/llvm-project?rev=146791&view=rev
Log:
Fix _mm256_round_pd, _mm256_round_ps, _mm_permute_pd and _mm256_permute_pd AVX
intrinsics to use "I" (ICE) markings. Fix avxintrin.h to take them into
account.
Part of rdar://10595450
Modified:
cfe/trunk/include/clang/Basic/BuiltinsX86.def
cfe/trunk/lib/Headers/avxintrin.h
cfe/trunk/test/CodeGen/builtins-x86.c
Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=146791&r1=146790&r2=146791&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Fri Dec 16 18:15:26 2011
@@ -425,9 +425,9 @@
BUILTIN(__builtin_ia32_vperm2f128_pd256, "V4dV4dV4dIc", "")
BUILTIN(__builtin_ia32_vperm2f128_ps256, "V8fV8fV8fIc", "")
BUILTIN(__builtin_ia32_vperm2f128_si256, "V8iV8iV8iIc", "")
-BUILTIN(__builtin_ia32_vpermilpd, "V2dV2dc", "")
+BUILTIN(__builtin_ia32_vpermilpd, "V2dV2dIc", "")
BUILTIN(__builtin_ia32_vpermilps, "V4fV4fc", "")
-BUILTIN(__builtin_ia32_vpermilpd256, "V4dV4dc", "")
+BUILTIN(__builtin_ia32_vpermilpd256, "V4dV4dIc", "")
BUILTIN(__builtin_ia32_vpermilps256, "V8fV8fc", "")
BUILTIN(__builtin_ia32_vinsertf128_pd256, "V4dV4dV2dIc", "")
BUILTIN(__builtin_ia32_vinsertf128_ps256, "V8fV8fV4fIc", "")
@@ -436,8 +436,8 @@
BUILTIN(__builtin_ia32_sqrtps256, "V8fV8f", "")
BUILTIN(__builtin_ia32_rsqrtps256, "V8fV8f", "")
BUILTIN(__builtin_ia32_rcpps256, "V8fV8f", "")
-BUILTIN(__builtin_ia32_roundpd256, "V4dV4di", "")
-BUILTIN(__builtin_ia32_roundps256, "V8fV8fi", "")
+BUILTIN(__builtin_ia32_roundpd256, "V4dV4dIi", "")
+BUILTIN(__builtin_ia32_roundps256, "V8fV8fIi", "")
BUILTIN(__builtin_ia32_vtestzpd, "iV2dV2d", "")
BUILTIN(__builtin_ia32_vtestcpd, "iV2dV2d", "")
BUILTIN(__builtin_ia32_vtestnzcpd, "iV2dV2d", "")
Modified: cfe/trunk/lib/Headers/avxintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avxintrin.h?rev=146791&r1=146790&r2=146791&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avxintrin.h (original)
+++ cfe/trunk/lib/Headers/avxintrin.h Fri Dec 16 18:15:26 2011
@@ -145,17 +145,13 @@
return (__m256)__builtin_ia32_rcpps256((__v8sf)a);
}
-static __inline __m256d __attribute__((__always_inline__, __nodebug__))
-_mm256_round_pd(__m256d v, const int m)
-{
- return (__m256d)__builtin_ia32_roundpd256((__v4df)v, m);
-}
-
-static __inline __m256 __attribute__((__always_inline__, __nodebug__))
-_mm256_round_ps(__m256 v, const int m)
-{
- return (__m256)__builtin_ia32_roundps256((__v8sf)v, m);
-}
+#define _mm256_round_pd(V, M) __extension__ ({ \
+ __m256d __V = (V); \
+ (__m256d)__builtin_ia32_roundpd256((__v4df)__V, M); })
+
+#define _mm256_round_ps(V, M) __extension__ ({ \
+ __m256 __V = (V); \
+ (__m256)__builtin_ia32_roundps256((__v8sf)__V, M); })
#define _mm256_ceil_pd(V) _mm256_round_pd((V), _MM_FROUND_CEIL)
#define _mm256_floor_pd(V) _mm256_round_pd((V), _MM_FROUND_FLOOR)
@@ -262,17 +258,13 @@
(__v8si)c);
}
-static __inline __m128d __attribute__((__always_inline__, __nodebug__))
-_mm_permute_pd(__m128d a, const int c)
-{
- return (__m128d)__builtin_ia32_vpermilpd((__v2df)a, c);
-}
-
-static __inline __m256d __attribute__((__always_inline__, __nodebug__))
-_mm256_permute_pd(__m256d a, const int c)
-{
- return (__m256d)__builtin_ia32_vpermilpd256((__v4df)a, c);
-}
+#define _mm_permute_pd(A, C) __extension__ ({ \
+ __m128d __A = (A); \
+ (__m128d)__builtin_ia32_vpermilpd((__v2df)__A, C); })
+
+#define _mm256_permute_pd(A, C) __extension__ ({ \
+ __m256d __A = (A); \
+ (__m256d)__builtin_ia32_vpermilpd256((__v4df)__A, C); })
static __inline __m128 __attribute__((__always_inline__, __nodebug__))
_mm_permute_ps(__m128 a, const int c)
Modified: cfe/trunk/test/CodeGen/builtins-x86.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-x86.c?rev=146791&r1=146790&r2=146791&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/builtins-x86.c (original)
+++ cfe/trunk/test/CodeGen/builtins-x86.c Fri Dec 16 18:15:26 2011
@@ -434,8 +434,8 @@
tmp_V8f = __builtin_ia32_sqrtps256(tmp_V8f);
tmp_V8f = __builtin_ia32_rsqrtps256(tmp_V8f);
tmp_V8f = __builtin_ia32_rcpps256(tmp_V8f);
- tmp_V4d = __builtin_ia32_roundpd256(tmp_V4d, tmp_i);
- tmp_V8f = __builtin_ia32_roundps256(tmp_V8f, tmp_i);
+ tmp_V4d = __builtin_ia32_roundpd256(tmp_V4d, 0x1);
+ tmp_V8f = __builtin_ia32_roundps256(tmp_V8f, 0x1);
tmp_i = __builtin_ia32_vtestzpd(tmp_V2d, tmp_V2d);
tmp_i = __builtin_ia32_vtestcpd(tmp_V2d, tmp_V2d);
tmp_i = __builtin_ia32_vtestnzcpd(tmp_V2d, tmp_V2d);
More information about the cfe-commits
mailing list