[SystemZ] Fix wrong codegen caused by typos in vecintrin.h

The following two bugs in SystemZ high-level vector intrinsics are
fixes by this patch:

- The float case of vec_insert_and_zero should generate a VLLEZF
  pattern, but currently erroneously generates VLLEZLF.

- The float and double versions of vec_orc erroneously generate
  and-with-complement instead of or-with-complement.

The patch also fixes a couple of typos in the associated test.

llvm-svn: 349751
This commit is contained in:
Ulrich Weigand 2018-12-20 13:09:09 +00:00
parent b2d7e269d5
commit 22ca9c628a
2 changed files with 8 additions and 8 deletions

View File

@ -381,7 +381,7 @@ vec_insert_and_zero(const unsigned long long *__ptr) {
static inline __ATTRS_o_ai vector float
vec_insert_and_zero(const float *__ptr) {
vector float __vec = (vector float)0;
__vec[0] = *__ptr;
__vec[1] = *__ptr;
return __vec;
}
#endif
@ -5942,13 +5942,13 @@ vec_orc(vector unsigned long long __a, vector unsigned long long __b) {
static inline __ATTRS_o_ai vector float
vec_orc(vector float __a, vector float __b) {
return (vector float)((vector unsigned int)__a &
return (vector float)((vector unsigned int)__a |
~(vector unsigned int)__b);
}
static inline __ATTRS_o_ai vector double
vec_orc(vector double __a, vector double __b) {
return (vector double)((vector unsigned long long)__a &
return (vector double)((vector unsigned long long)__a |
~(vector unsigned long long)__b);
}
#endif

View File

@ -65,9 +65,9 @@ void test_core(void) {
d = vec_extract(vd, idx);
// CHECK: extractelement <2 x double> %{{.*}}, i32 %{{.*}}
vf = vec_insert(d, vf, idx);
vf = vec_insert(f, vf, idx);
// CHECK: insertelement <4 x float> %{{.*}}, float %{{.*}}, i32 %{{.*}}
vd = vec_insert(f, vd, idx);
vd = vec_insert(d, vd, idx);
// CHECK: insertelement <2 x double> %{{.*}}, double %{{.*}}, i32 %{{.*}}
vf = vec_promote(f, idx);
@ -76,7 +76,7 @@ void test_core(void) {
// CHECK: insertelement <2 x double> undef, double %{{.*}}, i32 %{{.*}}
vf = vec_insert_and_zero(cptrf);
// CHECK: insertelement <4 x float> <float undef, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, float %{{.*}}, i32 0
// CHECK: insertelement <4 x float> <float 0.000000e+00, float undef, float 0.000000e+00, float 0.000000e+00>, float %{{.*}}, i32 1
vd = vec_insert_and_zero(cptrd);
// CHECK: insertelement <2 x double> <double undef, double 0.000000e+00>, double %{{.*}}, i32 0
@ -227,8 +227,8 @@ void test_compare(void) {
idx = vec_all_lt(vd, vd);
// CHECK: call { <2 x i64>, i32 } @llvm.s390.vfchdbs(<2 x double> %{{.*}}, <2 x double> %{{.*}})
idx = vec_all_nge(vd, vd);
// CHECK: call { <2 x i64>, i32 } @llvm.s390.vfchedbs(<2 x double> %{{.*}}, <2 x double> %{{.*}})
idx = vec_all_nge(vf, vf);
// CHECK: call { <4 x i32>, i32 } @llvm.s390.vfchesbs(<4 x float> %{{.*}}, <4 x float> %{{.*}})
idx = vec_all_nge(vd, vd);
// CHECK: call { <2 x i64>, i32 } @llvm.s390.vfchedbs(<2 x double> %{{.*}}, <2 x double> %{{.*}})