aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>2021-03-01 21:38:41 -0600
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2021-03-01 21:40:30 -0600
commit1ff93618e58df210def48d26878c20a1b414d900 (patch)
treefcc658959e5290a3b12af09087d1c23565621f0a /clang/lib
parent93c5e6bb49ca502d266700dd292e3873dfa51bb6 (diff)
downloadllvm-1ff93618e58df210def48d26878c20a1b414d900.zip
llvm-1ff93618e58df210def48d26878c20a1b414d900.tar.gz
llvm-1ff93618e58df210def48d26878c20a1b414d900.tar.bz2
[PowerPC] Add missing overloads of vec_promote to altivec.h
The VSX-only overloads (for 8-byte element vectors) are missing. Add the missing overloads and convert element numbering to modulo arithmetic to match GCC and XLC.
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Headers/altivec.h36
1 files changed, 29 insertions, 7 deletions
diff --git a/clang/lib/Headers/altivec.h b/clang/lib/Headers/altivec.h
index 402f3b3..935eac3 100644
--- a/clang/lib/Headers/altivec.h
+++ b/clang/lib/Headers/altivec.h
@@ -14024,49 +14024,71 @@ static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,
static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,
int __b) {
vector signed char __res = (vector signed char)(0);
- __res[__b] = __a;
+ __res[__b & 0x7] = __a;
return __res;
}
static __inline__ vector unsigned char __ATTRS_o_ai
vec_promote(unsigned char __a, int __b) {
vector unsigned char __res = (vector unsigned char)(0);
- __res[__b] = __a;
+ __res[__b & 0x7] = __a;
return __res;
}
static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {
vector short __res = (vector short)(0);
- __res[__b] = __a;
+ __res[__b & 0x7] = __a;
return __res;
}
static __inline__ vector unsigned short __ATTRS_o_ai
vec_promote(unsigned short __a, int __b) {
vector unsigned short __res = (vector unsigned short)(0);
- __res[__b] = __a;
+ __res[__b & 0x7] = __a;
return __res;
}
static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {
vector int __res = (vector int)(0);
- __res[__b] = __a;
+ __res[__b & 0x3] = __a;
return __res;
}
static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,
int __b) {
vector unsigned int __res = (vector unsigned int)(0);
- __res[__b] = __a;
+ __res[__b & 0x3] = __a;
return __res;
}
static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {
vector float __res = (vector float)(0);
- __res[__b] = __a;
+ __res[__b & 0x3] = __a;
return __res;
}
+#ifdef __VSX__
+static __inline__ vector double __ATTRS_o_ai vec_promote(double __a, int __b) {
+ vector double __res = (vector double)(0);
+ __res[__b & 0x1] = __a;
+ return __res;
+}
+
+static __inline__ vector signed long long __ATTRS_o_ai
+vec_promote(signed long long __a, int __b) {
+ vector signed long long __res = (vector signed long long)(0);
+ __res[__b & 0x1] = __a;
+ return __res;
+}
+
+static __inline__ vector unsigned long long __ATTRS_o_ai
+vec_promote(unsigned long long __a, int __b) {
+ vector unsigned long long __res = (vector unsigned long long)(0);
+ __res[__b & 0x1] = __a;
+ return __res;
+}
+#endif
+
/* vec_splats */
static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {