[cfe-commits] r158492 - in /cfe/trunk: include/clang/Basic/BuiltinsX86.def lib/Headers/xopintrin.h test/CodeGen/xop-builtins.c

Craig Topper craig.topper at gmail.com
Thu Jun 14 23:33:42 PDT 2012


Author: ctopper
Date: Fri Jun 15 01:33:42 2012
New Revision: 158492

URL: http://llvm.org/viewvc/llvm-project?rev=158492&view=rev
Log:
Add XOP frcz instrinsics.

Modified:
    cfe/trunk/include/clang/Basic/BuiltinsX86.def
    cfe/trunk/lib/Headers/xopintrin.h
    cfe/trunk/test/CodeGen/xop-builtins.c

Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=158492&r1=158491&r2=158492&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Fri Jun 15 01:33:42 2012
@@ -701,5 +701,11 @@
 BUILTIN(__builtin_ia32_vpermil2pd256, "V4dV4dV4dV4LLiIc", "")
 BUILTIN(__builtin_ia32_vpermil2ps, "V4fV4fV4fV4iIc", "")
 BUILTIN(__builtin_ia32_vpermil2ps256, "V8fV8fV8fV8iIc", "")
+BUILTIN(__builtin_ia32_vfrczss, "V4fV4f", "")
+BUILTIN(__builtin_ia32_vfrczsd, "V2dV2d", "")
+BUILTIN(__builtin_ia32_vfrczps, "V4fV4f", "")
+BUILTIN(__builtin_ia32_vfrczpd, "V2dV2d", "")
+BUILTIN(__builtin_ia32_vfrczps256, "V8fV8f", "")
+BUILTIN(__builtin_ia32_vfrczpd256, "V4dV4d", "")
 
 #undef BUILTIN

Modified: cfe/trunk/lib/Headers/xopintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/xopintrin.h?rev=158492&r1=158491&r2=158492&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/xopintrin.h (original)
+++ cfe/trunk/lib/Headers/xopintrin.h Fri Jun 15 01:33:42 2012
@@ -370,6 +370,42 @@
   (__m256)__builtin_ia32_vpermil2ps256((__v8sf)__X, (__v8sf)__Y, \
                                        (__v8si)__C, (I)); })
 
+static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
+_mm_frcz_ss(__m128 __A)
+{
+  return (__m128)__builtin_ia32_vfrczss((__v4sf)__A);
+}
+
+static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
+_mm_frcz_sd(__m128d __A)
+{
+  return (__m128d)__builtin_ia32_vfrczsd((__v2df)__A);
+}
+
+static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
+_mm_frcz_ps(__m128 __A)
+{
+  return (__m128)__builtin_ia32_vfrczps((__v4sf)__A);
+}
+
+static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
+_mm_frcz_pd(__m128d __A)
+{
+  return (__m128d)__builtin_ia32_vfrczpd((__v2df)__A);
+}
+
+static __inline__ __m256 __attribute__((__always_inline__, __nodebug__))
+_mm_frcz_ps(__m256 __A)
+{
+  return (__m256)__builtin_ia32_vfrczps((__v4sf)__A);
+}
+
+static __inline__ __m256d __attribute__((__always_inline__, __nodebug__))
+_mm_frcz_pd(__m256d __A)
+{
+  return (__m256d)__builtin_ia32_vfrczpd((__v2df)__A);
+}
+
 #endif /* __XOP__ */
 
 #endif /* __XOPINTRIN_H */

Modified: cfe/trunk/test/CodeGen/xop-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/xop-builtins.c?rev=158492&r1=158491&r2=158492&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/xop-builtins.c (original)
+++ cfe/trunk/test/CodeGen/xop-builtins.c Fri Jun 15 01:33:42 2012
@@ -294,3 +294,33 @@
   // CHECK: @llvm.x86.xop.vpermil2ps.256
   return _mm256_permute2_ps(a, b, c, 0);
 }
+
+__m128 test_mm_frcz_ss(__m128 a) {
+  // CHECK: @llvm.x86.xop.vfrcz.ss
+  return _mm_frcz_ss(a);
+}
+
+__m128d test_mm_frcz_sd(__m128d a) {
+  // CHECK: @llvm.x86.xop.vfrcz.sd
+  return _mm_frcz_sd(a);
+}
+
+__m128 test_mm_frcz_ps(__m128 a) {
+  // CHECK: @llvm.x86.xop.vfrcz.ps
+  return _mm_frcz_ps(a);
+}
+
+__m128d test_mm_frcz_pd(__m128d a) {
+  // CHECK: @llvm.x86.xop.vfrcz.pd
+  return _mm_frcz_pd(a);
+}
+
+__m256 test_mm256_frcz_ps(__m256 a) {
+  // CHECK: @llvm.x86.xop.vfrcz.ps.256
+  return _mm256_frcz_ps(a);
+}
+
+__m256d test_mm256_frcz_pd(__m256d a) {
+  // CHECK: @llvm.x86.xop.vfrcz.pd.256
+  return _mm256_frcz_pd(a);
+}





More information about the cfe-commits mailing list