[X86] Use unaligned load intrinsics to implement other intrinsics instead of manually creating the unaligned load.
llvm-svn: 271250
This commit is contained in:
parent
7939ae5e08
commit
74b5948f39
|
@ -2813,35 +2813,22 @@ _mm256_castsi128_si256(__m128i __a)
|
|||
static __inline __m256 __DEFAULT_FN_ATTRS
|
||||
_mm256_loadu2_m128(float const *__addr_hi, float const *__addr_lo)
|
||||
{
|
||||
struct __loadu_ps {
|
||||
__m128 __v;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
|
||||
__m256 __v256 = _mm256_castps128_ps256(((struct __loadu_ps*)__addr_lo)->__v);
|
||||
return _mm256_insertf128_ps(__v256, ((struct __loadu_ps*)__addr_hi)->__v, 1);
|
||||
__m256 __v256 = _mm256_castps128_ps256(_mm_loadu_ps(__addr_lo));
|
||||
return _mm256_insertf128_ps(__v256, _mm_loadu_ps(__addr_hi), 1);
|
||||
}
|
||||
|
||||
static __inline __m256d __DEFAULT_FN_ATTRS
|
||||
_mm256_loadu2_m128d(double const *__addr_hi, double const *__addr_lo)
|
||||
{
|
||||
struct __loadu_pd {
|
||||
__m128d __v;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
|
||||
__m256d __v256 = _mm256_castpd128_pd256(((struct __loadu_pd*)__addr_lo)->__v);
|
||||
return _mm256_insertf128_pd(__v256, ((struct __loadu_pd*)__addr_hi)->__v, 1);
|
||||
__m256d __v256 = _mm256_castpd128_pd256(_mm_loadu_pd(__addr_lo));
|
||||
return _mm256_insertf128_pd(__v256, _mm_loadu_pd(__addr_hi), 1);
|
||||
}
|
||||
|
||||
static __inline __m256i __DEFAULT_FN_ATTRS
|
||||
_mm256_loadu2_m128i(__m128i const *__addr_hi, __m128i const *__addr_lo)
|
||||
{
|
||||
struct __loadu_si128 {
|
||||
__m128i __v;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
__m256i __v256 = _mm256_castsi128_si256(
|
||||
((struct __loadu_si128*)__addr_lo)->__v);
|
||||
return _mm256_insertf128_si256(__v256,
|
||||
((struct __loadu_si128*)__addr_hi)->__v, 1);
|
||||
__m256i __v256 = _mm256_castsi128_si256(_mm_loadu_si128(__addr_lo));
|
||||
return _mm256_insertf128_si256(__v256, _mm_loadu_si128(__addr_hi), 1);
|
||||
}
|
||||
|
||||
/* SIMD store ops (unaligned) */
|
||||
|
|
Loading…
Reference in New Issue