forked from OSchip/llvm-project
[PowerPC] Add missing double precision vec_all overloads to altivec.h
We somehow missed vec_all_nlt, vec_all_nle and vec_all_numeric overloads for double precision vectors when VSX is enabled.
This commit is contained in:
parent
c0503df15d
commit
f4ad7a1a15
|
@ -15347,25 +15347,57 @@ static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,
|
||||||
|
|
||||||
/* vec_all_nle */
|
/* vec_all_nle */
|
||||||
|
|
||||||
static __inline__ int __attribute__((__always_inline__))
|
static __inline__ int __ATTRS_o_ai
|
||||||
vec_all_nle(vector float __a, vector float __b) {
|
vec_all_nle(vector float __a, vector float __b) {
|
||||||
|
#ifdef __VSX__
|
||||||
|
return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __b, __a);
|
||||||
|
#else
|
||||||
return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
|
return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __VSX__
|
||||||
|
static __inline__ int __ATTRS_o_ai vec_all_nle(vector double __a,
|
||||||
|
vector double __b) {
|
||||||
|
return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __b, __a);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* vec_all_nlt */
|
/* vec_all_nlt */
|
||||||
|
|
||||||
static __inline__ int __attribute__((__always_inline__))
|
static __inline__ int __ATTRS_o_ai
|
||||||
vec_all_nlt(vector float __a, vector float __b) {
|
vec_all_nlt(vector float __a, vector float __b) {
|
||||||
|
#ifdef __VSX__
|
||||||
|
return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __b, __a);
|
||||||
|
#else
|
||||||
return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
|
return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __VSX__
|
||||||
|
static __inline__ int __ATTRS_o_ai vec_all_nlt(vector double __a,
|
||||||
|
vector double __b) {
|
||||||
|
return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __b, __a);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* vec_all_numeric */
|
/* vec_all_numeric */
|
||||||
|
|
||||||
static __inline__ int __attribute__((__always_inline__))
|
static __inline__ int __ATTRS_o_ai
|
||||||
vec_all_numeric(vector float __a) {
|
vec_all_numeric(vector float __a) {
|
||||||
|
#ifdef __VSX__
|
||||||
|
return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __a);
|
||||||
|
#else
|
||||||
return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
|
return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __VSX__
|
||||||
|
static __inline__ int __ATTRS_o_ai vec_all_numeric(vector double __a) {
|
||||||
|
return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __a);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* vec_any_eq */
|
/* vec_any_eq */
|
||||||
|
|
||||||
static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
|
static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,
|
||||||
|
|
|
@ -93,6 +93,34 @@ void test1() {
|
||||||
// CHECK: fadd <2 x double>
|
// CHECK: fadd <2 x double>
|
||||||
// CHECK-LE: fadd <2 x double>
|
// CHECK-LE: fadd <2 x double>
|
||||||
|
|
||||||
|
res_i = vec_all_nle(vf, vf);
|
||||||
|
// CHECK: @llvm.ppc.vsx.xvcmpgesp.p
|
||||||
|
// CHECK-LE: @llvm.ppc.vsx.xvcmpgesp.p
|
||||||
|
|
||||||
|
res_i = vec_all_nle(vd, vd);
|
||||||
|
// CHECK: @llvm.ppc.vsx.xvcmpgedp.p
|
||||||
|
// CHECK-LE: @llvm.ppc.vsx.xvcmpgedp.p
|
||||||
|
|
||||||
|
res_i = vec_all_nlt(vf, vf);
|
||||||
|
// CHECK: @llvm.ppc.vsx.xvcmpgtsp.p
|
||||||
|
// CHECK-LE: @llvm.ppc.vsx.xvcmpgtsp.p
|
||||||
|
|
||||||
|
res_i = vec_all_nlt(vd, vd);
|
||||||
|
// CHECK: @llvm.ppc.vsx.xvcmpgtdp.p
|
||||||
|
// CHECK-LE: @llvm.ppc.vsx.xvcmpgtdp.p
|
||||||
|
|
||||||
|
res_i = vec_all_numeric(vf);
|
||||||
|
// CHECK: @llvm.ppc.vsx.xvcmpeqsp.p
|
||||||
|
// CHECK-LE: @llvm.ppc.vsx.xvcmpeqsp.p
|
||||||
|
|
||||||
|
res_i = vec_all_numeric(vd);
|
||||||
|
// CHECK: @llvm.ppc.vsx.xvcmpeqdp.p
|
||||||
|
// CHECK-LE: @llvm.ppc.vsx.xvcmpeqdp.p
|
||||||
|
|
||||||
|
dummy();
|
||||||
|
// CHECK: call void @dummy()
|
||||||
|
// CHECK-LE: call void @dummy()
|
||||||
|
|
||||||
res_vd = vec_and(vbll, vd);
|
res_vd = vec_and(vbll, vd);
|
||||||
// CHECK: and <2 x i64>
|
// CHECK: and <2 x i64>
|
||||||
// CHECK: bitcast <2 x i64> %{{[0-9]*}} to <2 x double>
|
// CHECK: bitcast <2 x i64> %{{[0-9]*}} to <2 x double>
|
||||||
|
|
Loading…
Reference in New Issue