[PATCH] use conversion of builtin vector types to enable constant propagation
Matthias Kretz
kretz at kde.org
Tue Oct 1 00:51:39 PDT 2013
This change enables constant propagation for conversions. But at this time it leads to worse instruction selection when the actual conversion needs to be executed.
http://llvm-reviews.chandlerc.com/D1793
Files:
lib/Headers/emmintrin.h
Index: lib/Headers/emmintrin.h
===================================================================
--- lib/Headers/emmintrin.h
+++ lib/Headers/emmintrin.h
@@ -375,19 +375,20 @@
static __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
_mm_cvtpd_ps(__m128d __a)
{
- return __builtin_ia32_cvtpd2ps(__a);
+ return (__m128)(__v4sf) { __a[0], __a[1], 0, 0 };
}
static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
_mm_cvtps_pd(__m128 __a)
{
- return __builtin_ia32_cvtps2pd(__a);
+ return (__m128d)(__v2df) { __a[0], __a[1] };
}
static __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
_mm_cvtepi32_pd(__m128i __a)
{
- return __builtin_ia32_cvtdq2pd((__v4si)__a);
+ __v4si __b = (__v4si)__a;
+ return (__m128d)(__v2df) { __b[0], __b[1] };
}
static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
@@ -426,7 +427,7 @@
static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
_mm_cvttpd_epi32(__m128d __a)
{
- return (__m128i)__builtin_ia32_cvttpd2dq(__a);
+ return (__m128i)(__v4si) { __a[0], __a[1], 0, 0 };
}
static __inline__ int __attribute__((__always_inline__, __nodebug__))
@@ -1023,7 +1024,7 @@
static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
_mm_cvttps_epi32(__m128 __a)
{
- return (__m128i)__builtin_ia32_cvttps2dq(__a);
+ return (__m128i)(__v4si) { __a[0], __a[1], __a[2], __a[3] };
}
static __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1793.1.patch
Type: text/x-patch
Size: 1522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131001/db7aad69/attachment.bin>
More information about the cfe-commits
mailing list