return (vector bool __int128)__builtin_altivec_vcmpequq(
(vector bool __int128)__a, (vector bool __int128)__b);
}
+
+static __inline__ vector bool __int128 __ATTRS_o_ai
+vec_cmpeq(vector bool __int128 __a, vector bool __int128 __b) {
+ return (vector bool __int128)__builtin_altivec_vcmpequq(__a, __b);
+}
#endif
#ifdef __POWER9_VECTOR__
return (vector bool __int128) ~(__builtin_altivec_vcmpequq(
(vector bool __int128)__a, (vector bool __int128)__b));
}
+
+static __inline__ vector bool __int128 __ATTRS_o_ai
+vec_cmpne(vector bool __int128 __a, vector bool __int128 __b) {
+ return (vector bool __int128) ~(__builtin_altivec_vcmpequq(__a, __b));
+}
#endif
/* vec_cmpnez */
vector unsigned __int128 __b) {
return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
}
+
+static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool __int128 __a,
+ vector bool __int128 __b) {
+ return __builtin_altivec_vcmpequq_p(__CR6_LT, __a, __b);
+}
#endif
/* vec_all_ge */
vector unsigned __int128 __b) {
return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
}
+
+static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool __int128 __a,
+ vector bool __int128 __b) {
+ return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a, __b);
+}
#endif
/* vec_all_nge */
vector unsigned __int128 __b) {
return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
}
+
+static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool __int128 __a,
+ vector bool __int128 __b) {
+ return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a, __b);
+}
#endif
/* vec_any_ge */
vector unsigned __int128 __b) {
return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
}
+
+static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool __int128 __a,
+ vector bool __int128 __b) {
+ return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a, __b);
+}
#endif
/* vec_any_nge */
vector unsigned long long vulla, vullb, vullc;
vector signed __int128 vsi128a, vsi128b, vsi128c;
vector unsigned __int128 vui128a, vui128b, vui128c;
+vector bool __int128 vbi128a, vbi128b;
vector float vfa, vfb;
vector double vda, vdb;
float fa;
return vec_cmpeq(vui128a, vui128b);
}
+vector bool __int128 test_vec_cmpeq_bool_int128(void) {
+ // CHECK-LABEL: @test_vec_cmpeq_bool_int128(
+ // CHECK: call <1 x i128> @llvm.ppc.altivec.vcmpequq(<1 x i128>
+ // CHECK-NEXT: ret <1 x i128>
+ return vec_cmpeq(vbi128a, vbi128b);
+}
+
vector bool __int128 test_vec_cmpne_s128(void) {
// CHECK-LABEL: @test_vec_cmpne_s128(
// CHECK: call <1 x i128> @llvm.ppc.altivec.vcmpequq(<1 x i128>
return vec_cmpne(vui128a, vui128b);
}
+vector bool __int128 test_vec_cmpne_bool_int128(void) {
+ // CHECK-LABEL: @test_vec_cmpne_bool_int128(
+ // CHECK: call <1 x i128> @llvm.ppc.altivec.vcmpequq(<1 x i128>
+ // CHECK-NEXT: %neg.i = xor <1 x i128> %4, <i128 -1>
+ // CHECK-NEXT: ret <1 x i128>
+ return vec_cmpne(vbi128a, vbi128b);
+}
+
vector bool __int128 test_vec_cmpgt_s128(void) {
// CHECK-LABEL: @test_vec_cmpgt_s128(
// CHECK: call <1 x i128> @llvm.ppc.altivec.vcmpgtsq(<1 x i128>
return vec_any_eq(vsi128a, vsi128b);
}
+int test_vec_any_eq_bool_int128(void) {
+ // CHECK-LABEL: @test_vec_any_eq_bool_int128(
+ // CHECK: call i32 @llvm.ppc.altivec.vcmpequq.p(i32 1, <1 x i128> %2, <1 x i128> %3)
+ // CHECK-NEXT: ret i32
+ return vec_any_eq(vbi128a, vbi128b);
+}
+
int test_vec_any_ne_s128(void) {
// CHECK-LABEL: @test_vec_any_ne_s128(
// CHECK: call i32 @llvm.ppc.altivec.vcmpequq.p(i32 3, <1 x i128> %2, <1 x i128> %3)
return vec_any_ne(vui128a, vui128b);
}
+int test_vec_any_ne_bool_int128(void) {
+ // CHECK-LABEL: @test_vec_any_ne_bool_int128(
+ // CHECK: call i32 @llvm.ppc.altivec.vcmpequq.p(i32 3, <1 x i128> %2, <1 x i128> %3)
+ // CHECK-NEXT: ret i32
+ return vec_any_ne(vbi128a, vbi128b);
+}
+
int test_vec_any_lt_s128(void) {
// CHECK-LABEL: @test_vec_any_lt_s128(
// CHECK: call i32 @llvm.ppc.altivec.vcmpgtsq.p(i32 1, <1 x i128> %2, <1 x i128> %3)
return vec_all_eq(vui128a, vui128b);
}
+int test_vec_all_eq_bool_int128(void) {
+ // CHECK-LABEL: @test_vec_all_eq_bool_int128
+ // CHECK: call i32 @llvm.ppc.altivec.vcmpequq.p(i32 2, <1 x i128> %2, <1 x i128> %3)
+ // CHECK-NEXT: ret i32
+ return vec_all_eq(vbi128a, vbi128b);
+}
+
int test_vec_all_ne_s128(void) {
// CHECK-LABEL: @test_vec_all_ne_s128(
// CHECK: call i32 @llvm.ppc.altivec.vcmpequq.p(i32 0, <1 x i128> %2, <1 x i128> %3)
return vec_all_ne(vui128a, vui128b);
}
+int test_vec_all_ne_bool_int128(void) {
+ // CHECK-LABEL: test_vec_all_ne_bool_int128
+ // CHECK: call i32 @llvm.ppc.altivec.vcmpequq.p(i32 0, <1 x i128> %2, <1 x i128> %3)
+ // CHECK-NEXT: ret i32
+ return vec_all_ne(vbi128a, vbi128b);
+}
+
int test_vec_all_lt_s128(void) {
// CHECK-LABEL: @test_vec_all_lt_s128(
// CHECK: call i32 @llvm.ppc.altivec.vcmpgtsq.p(i32 2, <1 x i128> %2, <1 x i128> %3)