mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-08 20:04:02 +00:00
[Headers][X86] Ensure all AVX broadcast scalar load intrinsics are unaligned
Similar to the existing _mm_load1_pd/_mm_loaddup_pd and broadcast vector loads, these intrinsic should ensure the loads are unaligned and not assume type alignment Fixes #62325
This commit is contained in:
parent
f292ca1362
commit
d9634205d9
@ -3017,8 +3017,11 @@ _mm256_zeroupper(void)
|
||||
static __inline __m128 __DEFAULT_FN_ATTRS128
|
||||
_mm_broadcast_ss(float const *__a)
|
||||
{
|
||||
float __f = *__a;
|
||||
return __extension__ (__m128)(__v4sf){ __f, __f, __f, __f };
|
||||
struct __mm_broadcast_ss_struct {
|
||||
float __f;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
float __f = ((const struct __mm_broadcast_ss_struct*)__a)->__f;
|
||||
return __extension__ (__m128){ __f, __f, __f, __f };
|
||||
}
|
||||
|
||||
/// Loads a scalar double-precision floating point value from the
|
||||
@ -3036,7 +3039,10 @@ _mm_broadcast_ss(float const *__a)
|
||||
static __inline __m256d __DEFAULT_FN_ATTRS
|
||||
_mm256_broadcast_sd(double const *__a)
|
||||
{
|
||||
double __d = *__a;
|
||||
struct __mm256_broadcast_sd_struct {
|
||||
double __d;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
double __d = ((const struct __mm256_broadcast_sd_struct*)__a)->__d;
|
||||
return __extension__ (__m256d)(__v4df){ __d, __d, __d, __d };
|
||||
}
|
||||
|
||||
@ -3055,7 +3061,10 @@ _mm256_broadcast_sd(double const *__a)
|
||||
static __inline __m256 __DEFAULT_FN_ATTRS
|
||||
_mm256_broadcast_ss(float const *__a)
|
||||
{
|
||||
float __f = *__a;
|
||||
struct __mm256_broadcast_ss_struct {
|
||||
float __f;
|
||||
} __attribute__((__packed__, __may_alias__));
|
||||
float __f = ((const struct __mm256_broadcast_ss_struct*)__a)->__f;
|
||||
return __extension__ (__m256)(__v8sf){ __f, __f, __f, __f, __f, __f, __f, __f };
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ __m256 test_mm256_broadcast_ps(__m128* A) {
|
||||
|
||||
__m256d test_mm256_broadcast_sd(double* A) {
|
||||
// CHECK-LABEL: test_mm256_broadcast_sd
|
||||
// CHECK: load double, ptr %{{.*}}
|
||||
// CHECK: load double, ptr %{{.*}}, align 1{{$}}
|
||||
// CHECK: insertelement <4 x double> undef, double %{{.*}}, i32 0
|
||||
// CHECK: insertelement <4 x double> %{{.*}}, double %{{.*}}, i32 1
|
||||
// CHECK: insertelement <4 x double> %{{.*}}, double %{{.*}}, i32 2
|
||||
@ -109,7 +109,7 @@ __m256d test_mm256_broadcast_sd(double* A) {
|
||||
|
||||
__m128 test_mm_broadcast_ss(float* A) {
|
||||
// CHECK-LABEL: test_mm_broadcast_ss
|
||||
// CHECK: load float, ptr %{{.*}}
|
||||
// CHECK: load float, ptr %{{.*}}, align 1{{$}}
|
||||
// CHECK: insertelement <4 x float> undef, float %{{.*}}, i32 0
|
||||
// CHECK: insertelement <4 x float> %{{.*}}, float %{{.*}}, i32 1
|
||||
// CHECK: insertelement <4 x float> %{{.*}}, float %{{.*}}, i32 2
|
||||
@ -119,7 +119,7 @@ __m128 test_mm_broadcast_ss(float* A) {
|
||||
|
||||
__m256 test_mm256_broadcast_ss(float* A) {
|
||||
// CHECK-LABEL: test_mm256_broadcast_ss
|
||||
// CHECK: load float, ptr %{{.*}}
|
||||
// CHECK: load float, ptr %{{.*}}, align 1{{$}}
|
||||
// CHECK: insertelement <8 x float> undef, float %{{.*}}, i32 0
|
||||
// CHECK: insertelement <8 x float> %{{.*}}, float %{{.*}}, i32 1
|
||||
// CHECK: insertelement <8 x float> %{{.*}}, float %{{.*}}, i32 2
|
||||
|
Loading…
Reference in New Issue
Block a user