r214098 - [AVX512] Add FP add/sub/mul intrinsics

Adam Nemet anemet at apple.com
Mon Jul 28 10:14:43 PDT 2014


Author: anemet
Date: Mon Jul 28 12:14:42 2014
New Revision: 214098

URL: http://llvm.org/viewvc/llvm-project?rev=214098&view=rev
Log:
[AVX512] Add FP add/sub/mul intrinsics

Part of <rdar://problem/17688758>

Modified:
    cfe/trunk/lib/Headers/avx512fintrin.h
    cfe/trunk/test/CodeGen/avx512f-builtins.c

Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=214098&r1=214097&r2=214098&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Mon Jul 28 12:14:42 2014
@@ -93,6 +93,42 @@ _mm512_setzero_pd(void)
 
 /* Arithmetic */
 
+static __inline __m512d __attribute__((__always_inline__, __nodebug__))
+_mm512_add_pd(__m512d __a, __m512d __b)
+{
+  return __a + __b;
+}
+
+static __inline __m512 __attribute__((__always_inline__, __nodebug__))
+_mm512_add_ps(__m512 __a, __m512 __b)
+{
+  return __a + __b;
+}
+
+static __inline __m512d __attribute__((__always_inline__, __nodebug__))
+_mm512_mul_pd(__m512d __a, __m512d __b)
+{
+  return __a * __b;
+}
+
+static __inline __m512 __attribute__((__always_inline__, __nodebug__))
+_mm512_mul_ps(__m512 __a, __m512 __b)
+{
+  return __a * __b;
+}
+
+static __inline __m512d __attribute__((__always_inline__, __nodebug__))
+_mm512_sub_pd(__m512d __a, __m512d __b)
+{
+  return __a - __b;
+}
+
+static __inline __m512 __attribute__((__always_inline__, __nodebug__))
+_mm512_sub_ps(__m512 __a, __m512 __b)
+{
+  return __a - __b;
+}
+
 static  __inline__ __m512d __attribute__((__always_inline__, __nodebug__))
 _mm512_max_pd(__m512d __A, __m512d __B)
 {

Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=214098&r1=214097&r2=214098&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Mon Jul 28 12:14:42 2014
@@ -32,3 +32,31 @@ __m512 test_mm512_rsqrt14_ps(__m512 a)
   // CHECK: @llvm.x86.avx512.rsqrt14.ps.512
   return _mm512_rsqrt14_ps(a);
 }
+
+__m512 test_mm512_add_ps(__m512 a, __m512 b)
+{
+  // CHECK-LABEL: @test_mm512_add_ps
+  // CHECK: fadd <16 x float>
+  return _mm512_add_ps(a, b);
+}
+
+__m512d test_mm512_add_pd(__m512d a, __m512d b)
+{
+  // CHECK-LABEL: @test_mm512_add_pd
+  // CHECK: fadd <8 x double>
+  return _mm512_add_pd(a, b);
+}
+
+__m512 test_mm512_mul_ps(__m512 a, __m512 b)
+{
+  // CHECK-LABEL: @test_mm512_mul_ps
+  // CHECK: fmul <16 x float>
+  return _mm512_mul_ps(a, b);
+}
+
+__m512d test_mm512_mul_pd(__m512d a, __m512d b)
+{
+  // CHECK-LABEL: @test_mm512_mul_pd
+  // CHECK: fmul <8 x double>
+  return _mm512_mul_pd(a, b);
+}





More information about the cfe-commits mailing list