]> granicus.if.org Git - clang/commitdiff
Move _mm256_cvtps_ph and _mm256_cvtph_ps to immintrin.h.
authorPaul Robinson <paul_robinson@playstation.sony.com>
Wed, 2 Dec 2015 18:41:52 +0000 (18:41 +0000)
committerPaul Robinson <paul_robinson@playstation.sony.com>
Wed, 2 Dec 2015 18:41:52 +0000 (18:41 +0000)
This more closely matches their locations as described by Intel
documentation, and lets us remove a pair of redundant typedefs.

Differential Revision: http://reviews.llvm.org/D15127

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254528 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/f16cintrin.h
lib/Headers/immintrin.h

index a0ee09d06e39b35a48110f6ff1ab024e1cdde32c..c655d98ee9ab77c22dc877475096816c91abea5a 100644 (file)
 #ifndef __F16CINTRIN_H
 #define __F16CINTRIN_H
 
-typedef float __v8sf __attribute__ ((__vector_size__ (32)));
-typedef float __m256 __attribute__ ((__vector_size__ (32)));
-
 /* Define the default attributes for the functions in this file. */
 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("f16c")))
 
 #define _mm_cvtps_ph(a, imm) __extension__ ({ \
  (__m128i)__builtin_ia32_vcvtps2ph((__v4sf)(__m128)(a), (imm)); })
 
-#define _mm256_cvtps_ph(a, imm) __extension__ ({ \
- (__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)(__m256)(a), (imm)); })
-
 static __inline __m128 __DEFAULT_FN_ATTRS
 _mm_cvtph_ps(__m128i __a)
 {
   return (__m128)__builtin_ia32_vcvtph2ps((__v8hi)__a);
 }
 
-static __inline __m256 __DEFAULT_FN_ATTRS
-_mm256_cvtph_ps(__m128i __a)
-{
-  return (__m256)__builtin_ia32_vcvtph2ps256((__v8hi)__a);
-}
-
 #undef __DEFAULT_FN_ATTRS
 
 #endif /* __F16CINTRIN_H */
index a28222b79eb1e8a3b4c5014d6cb79e4bd2bd2baa..f3c6d1914d61b1aa75a3fe127e8577f562a46579 100644 (file)
 
 #include <avx2intrin.h>
 
+/* The 256-bit versions of functions in f16cintrin.h.
+   Intel documents these as being in immintrin.h, and
+   they depend on typedefs from avxintrin.h. */
+
+#define _mm256_cvtps_ph(a, imm) __extension__ ({ \
+ (__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)(__m256)(a), (imm)); })
+
+static __inline __m256 __attribute__((__always_inline__, __nodebug__, __target__("f16c")))
+_mm256_cvtph_ps(__m128i __a)
+{
+  return (__m256)__builtin_ia32_vcvtph2ps256((__v8hi)__a);
+}
+
 #include <bmiintrin.h>
 
 #include <bmi2intrin.h>