(vector char)__b);
}
+static __inline__ vector bool char __ATTRS_o_ai
+vec_cmpeq(vector bool char __a, vector bool char __b) {
+ return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,
+ (vector char)__b);
+}
+
static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,
vector short __b) {
return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);
(vector short)__b);
}
+static __inline__ vector bool short __ATTRS_o_ai
+vec_cmpeq(vector bool short __a, vector bool short __b) {
+ return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,
+ (vector short)__b);
+}
+
static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,
vector int __b) {
return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);
(vector int)__b);
}
+static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector bool int __a,
+ vector bool int __b) {
+ return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,
+ (vector int)__b);
+}
+
#ifdef __POWER8_VECTOR__
static __inline__ vector bool long long __ATTRS_o_ai
vec_cmpeq(vector signed long long __a, vector signed long long __b) {
return (vector bool long long)__builtin_altivec_vcmpequd(
(vector long long)__a, (vector long long)__b);
}
+
+static __inline__ vector bool long long __ATTRS_o_ai
+vec_cmpeq(vector bool long long __a, vector bool long long __b) {
+ return (vector bool long long)__builtin_altivec_vcmpequd(
+ (vector long long)__a, (vector long long)__b);
+}
+
#endif
static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,
result if either is zero.
*/
vector bool char __tmp1 = vec_cmpeq(__a, __b);
- vector bool char __tmp2 = __tmp1 | vec_cmpeq(__tmp1, __a) |
- vec_cmpeq(__tmp1, __b);
+ vector bool char __tmp2 = __tmp1 |
+ vec_cmpeq((vector signed char)__tmp1, __a) |
+ vec_cmpeq((vector signed char)__tmp1, __b);
vector unsigned long long __res =
#ifdef __LITTLE_ENDIAN__
- vec_cnttz((vector unsigned long long)__tmp2);
+ vec_cnttz((vector unsigned long long)__tmp2);
#else
- vec_cntlz((vector unsigned long long)__tmp2);
+ vec_cntlz((vector unsigned long long)__tmp2);
#endif
if (__res[0] == 64) {
return (__res[1] + 64) >> 3;
vec_first_match_or_eos_index(vector unsigned char __a,
vector unsigned char __b) {
vector bool char __tmp1 = vec_cmpeq(__a, __b);
- vector bool char __tmp2 = __tmp1 | vec_cmpeq(__tmp1, __a) |
- vec_cmpeq(__tmp1, __b);
+ vector bool char __tmp2 = __tmp1 |
+ vec_cmpeq((vector unsigned char)__tmp1, __a) |
+ vec_cmpeq((vector unsigned char)__tmp1, __b);
vector unsigned long long __res =
#ifdef __LITTLE_ENDIAN__
- vec_cnttz((vector unsigned long long)__tmp2);
+ vec_cnttz((vector unsigned long long)__tmp2);
#else
- vec_cntlz((vector unsigned long long)__tmp2);
+ vec_cntlz((vector unsigned long long)__tmp2);
#endif
if (__res[0] == 64) {
return (__res[1] + 64) >> 3;
static __inline__ unsigned __ATTRS_o_ai
vec_first_match_or_eos_index(vector signed short __a, vector signed short __b) {
vector bool short __tmp1 = vec_cmpeq(__a, __b);
- vector bool short __tmp2 = __tmp1 | vec_cmpeq(__tmp1, __a) |
- vec_cmpeq(__tmp1, __b);
+ vector bool short __tmp2 = __tmp1 |
+ vec_cmpeq((vector signed short)__tmp1, __a) |
+ vec_cmpeq((vector signed short)__tmp1, __b);
vector unsigned long long __res =
#ifdef __LITTLE_ENDIAN__
- vec_cnttz((vector unsigned long long)__tmp2);
+ vec_cnttz((vector unsigned long long)__tmp2);
#else
- vec_cntlz((vector unsigned long long)__tmp2);
+ vec_cntlz((vector unsigned long long)__tmp2);
#endif
if (__res[0] == 64) {
return (__res[1] + 64) >> 4;
vec_first_match_or_eos_index(vector unsigned short __a,
vector unsigned short __b) {
vector bool short __tmp1 = vec_cmpeq(__a, __b);
- vector bool short __tmp2 = __tmp1 | vec_cmpeq(__tmp1, __a) |
- vec_cmpeq(__tmp1, __b);
+ vector bool short __tmp2 = __tmp1 |
+ vec_cmpeq((vector unsigned short)__tmp1, __a) |
+ vec_cmpeq((vector unsigned short)__tmp1, __b);
vector unsigned long long __res =
#ifdef __LITTLE_ENDIAN__
- vec_cnttz((vector unsigned long long)__tmp2);
+ vec_cnttz((vector unsigned long long)__tmp2);
#else
- vec_cntlz((vector unsigned long long)__tmp2);
+ vec_cntlz((vector unsigned long long)__tmp2);
#endif
if (__res[0] == 64) {
return (__res[1] + 64) >> 4;
static __inline__ unsigned __ATTRS_o_ai
vec_first_match_or_eos_index(vector signed int __a, vector signed int __b) {
vector bool int __tmp1 = vec_cmpeq(__a, __b);
- vector bool int __tmp2 = __tmp1 | vec_cmpeq(__tmp1, __a) |
- vec_cmpeq(__tmp1, __b);
+ vector bool int __tmp2 = __tmp1 | vec_cmpeq((vector signed int)__tmp1, __a) |
+ vec_cmpeq((vector signed int)__tmp1, __b);
vector unsigned long long __res =
#ifdef __LITTLE_ENDIAN__
- vec_cnttz((vector unsigned long long)__tmp2);
+ vec_cnttz((vector unsigned long long)__tmp2);
#else
- vec_cntlz((vector unsigned long long)__tmp2);
+ vec_cntlz((vector unsigned long long)__tmp2);
#endif
if (__res[0] == 64) {
return (__res[1] + 64) >> 5;
}
static __inline__ unsigned __ATTRS_o_ai
-vec_first_match_or_eos_index(vector unsigned int __a,
- vector unsigned int __b) {
+vec_first_match_or_eos_index(vector unsigned int __a, vector unsigned int __b) {
vector bool int __tmp1 = vec_cmpeq(__a, __b);
- vector bool int __tmp2 = __tmp1 | vec_cmpeq(__tmp1, __a) |
- vec_cmpeq(__tmp1, __b);
+ vector bool int __tmp2 = __tmp1 |
+ vec_cmpeq((vector unsigned int)__tmp1, __a) |
+ vec_cmpeq((vector unsigned int)__tmp1, __b);
vector unsigned long long __res =
#ifdef __LITTLE_ENDIAN__
res_vbc = vec_cmpeq(vuc, vuc);
// CHECK: @llvm.ppc.altivec.vcmpequb
+// CHECK-LE: @llvm.ppc.altivec.vcmpequb
+
+ res_vbc = vec_cmpeq(vbc, vbc);
+// CHECK: @llvm.ppc.altivec.vcmpequb
+// CHECK-LE: @llvm.ppc.altivec.vcmpequb
+
+ res_vbc = vec_cmpeq(vbc, vbc);
+// CHECK: @llvm.ppc.altivec.vcmpequb
// CHECK-LE: @llvm.ppc.altivec.vcmpequb
res_vbs = vec_cmpeq(vs, vs);
res_vbs = vec_cmpeq(vus, vus);
// CHECK: @llvm.ppc.altivec.vcmpequh
+// CHECK-LE: @llvm.ppc.altivec.vcmpequh
+
+ res_vbs = vec_cmpeq(vbs, vbs);
+// CHECK: @llvm.ppc.altivec.vcmpequh
+// CHECK-LE: @llvm.ppc.altivec.vcmpequh
+
+ res_vbs = vec_cmpeq(vbs, vbs);
+// CHECK: @llvm.ppc.altivec.vcmpequh
// CHECK-LE: @llvm.ppc.altivec.vcmpequh
res_vbi = vec_cmpeq(vi, vi);
res_vbi = vec_cmpeq(vui, vui);
// CHECK: @llvm.ppc.altivec.vcmpequw
+// CHECK-LE: @llvm.ppc.altivec.vcmpequw
+
+ res_vbi = vec_cmpeq(vbi, vbi);
+// CHECK: @llvm.ppc.altivec.vcmpequw
+// CHECK-LE: @llvm.ppc.altivec.vcmpequw
+
+ res_vbi = vec_cmpeq(vbi, vbi);
+// CHECK: @llvm.ppc.altivec.vcmpequw
// CHECK-LE: @llvm.ppc.altivec.vcmpequw
res_vbi = vec_cmpeq(vf, vf);