aboutsummaryrefslogtreecommitdiff
path: root/clang/lib
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2025-01-20 19:23:18 +0100
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2025-01-20 19:30:21 +0100
commit8424bf207efd89eacf2fe893b67be98d535e1db6 (patch)
tree30c9e4debd2c24aa128899f45c96fec78f2a7eff /clang/lib
parent64edde6648cc772c299dc4b39bb2ae7e4e294127 (diff)
downloadllvm-8424bf207efd89eacf2fe893b67be98d535e1db6.zip
llvm-8424bf207efd89eacf2fe893b67be98d535e1db6.tar.gz
llvm-8424bf207efd89eacf2fe893b67be98d535e1db6.tar.bz2
[SystemZ] Add support for new cpu architecture - arch15
This patch adds support for the next-generation arch15 CPU architecture to the SystemZ backend. This includes: - Basic support for the new processor and its features. - Detection of arch15 as host processor. - Assembler/disassembler support for new instructions. - Exploitation of new instructions for code generation. - New vector (signed|unsigned|bool) __int128 data types. - New LLVM intrinsics for certain new instructions. - Support for low-level builtins mapped to new LLVM intrinsics. - New high-level intrinsics in vecintrin.h. - Indicate support by defining __VEC__ == 10305. Note: No currently available Z system supports the arch15 architecture. Once new systems become available, the official system name will be added as supported -march name.
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/Targets/SystemZ.cpp4
-rw-r--r--clang/lib/Basic/Targets/SystemZ.h4
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp12
-rw-r--r--clang/lib/Headers/vecintrin.h1754
-rw-r--r--clang/lib/Sema/DeclSpec.cpp10
-rw-r--r--clang/lib/Sema/SemaSystemZ.cpp1
6 files changed, 1750 insertions, 35 deletions
diff --git a/clang/lib/Basic/Targets/SystemZ.cpp b/clang/lib/Basic/Targets/SystemZ.cpp
index 06f08db..c836d11 100644
--- a/clang/lib/Basic/Targets/SystemZ.cpp
+++ b/clang/lib/Basic/Targets/SystemZ.cpp
@@ -105,6 +105,7 @@ static constexpr ISANameRevision ISARevisions[] = {
{{"arch12"}, 12}, {{"z14"}, 12},
{{"arch13"}, 13}, {{"z15"}, 13},
{{"arch14"}, 14}, {{"z16"}, 14},
+ {{"arch15"}, 15},
};
int SystemZTargetInfo::getISARevision(StringRef Name) const {
@@ -133,6 +134,7 @@ bool SystemZTargetInfo::hasFeature(StringRef Feature) const {
.Case("arch12", ISARevision >= 12)
.Case("arch13", ISARevision >= 13)
.Case("arch14", ISARevision >= 14)
+ .Case("arch15", ISARevision >= 15)
.Case("htm", HasTransactionalExecution)
.Case("vx", HasVector)
.Default(false);
@@ -167,7 +169,7 @@ void SystemZTargetInfo::getTargetDefines(const LangOptions &Opts,
if (HasVector)
Builder.defineMacro("__VX__");
if (Opts.ZVector)
- Builder.defineMacro("__VEC__", "10304");
+ Builder.defineMacro("__VEC__", "10305");
}
ArrayRef<Builtin::Info> SystemZTargetInfo::getTargetBuiltins() const {
diff --git a/clang/lib/Basic/Targets/SystemZ.h b/clang/lib/Basic/Targets/SystemZ.h
index e6405f1..d059485 100644
--- a/clang/lib/Basic/Targets/SystemZ.h
+++ b/clang/lib/Basic/Targets/SystemZ.h
@@ -186,6 +186,10 @@ public:
Features["vector-enhancements-2"] = true;
if (ISARevision >= 14)
Features["nnp-assist"] = true;
+ if (ISARevision >= 15) {
+ Features["miscellaneous-extensions-4"] = true;
+ Features["vector-enhancements-3"] = true;
+ }
return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
}
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index b80833f..aeabed8 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -20601,7 +20601,8 @@ Value *CodeGenFunction::EmitSystemZBuiltinExpr(unsigned BuiltinID,
case SystemZ::BI__builtin_s390_vclzb:
case SystemZ::BI__builtin_s390_vclzh:
case SystemZ::BI__builtin_s390_vclzf:
- case SystemZ::BI__builtin_s390_vclzg: {
+ case SystemZ::BI__builtin_s390_vclzg:
+ case SystemZ::BI__builtin_s390_vclzq: {
llvm::Type *ResultType = ConvertType(E->getType());
Value *X = EmitScalarExpr(E->getArg(0));
Value *Undef = ConstantInt::get(Builder.getInt1Ty(), false);
@@ -20612,7 +20613,8 @@ Value *CodeGenFunction::EmitSystemZBuiltinExpr(unsigned BuiltinID,
case SystemZ::BI__builtin_s390_vctzb:
case SystemZ::BI__builtin_s390_vctzh:
case SystemZ::BI__builtin_s390_vctzf:
- case SystemZ::BI__builtin_s390_vctzg: {
+ case SystemZ::BI__builtin_s390_vctzg:
+ case SystemZ::BI__builtin_s390_vctzq: {
llvm::Type *ResultType = ConvertType(E->getType());
Value *X = EmitScalarExpr(E->getArg(0));
Value *Undef = ConstantInt::get(Builder.getInt1Ty(), false);
@@ -20856,7 +20858,8 @@ Value *CodeGenFunction::EmitSystemZBuiltinExpr(unsigned BuiltinID,
case SystemZ::BI__builtin_s390_vlbrh:
case SystemZ::BI__builtin_s390_vlbrf:
- case SystemZ::BI__builtin_s390_vlbrg: {
+ case SystemZ::BI__builtin_s390_vlbrg:
+ case SystemZ::BI__builtin_s390_vlbrq: {
llvm::Type *ResultType = ConvertType(E->getType());
Value *X = EmitScalarExpr(E->getArg(0));
Function *F = CGM.getIntrinsic(Intrinsic::bswap, ResultType);
@@ -20881,16 +20884,19 @@ Value *CodeGenFunction::EmitSystemZBuiltinExpr(unsigned BuiltinID,
INTRINSIC_WITH_CC(s390_vceqhs);
INTRINSIC_WITH_CC(s390_vceqfs);
INTRINSIC_WITH_CC(s390_vceqgs);
+ INTRINSIC_WITH_CC(s390_vceqqs);
INTRINSIC_WITH_CC(s390_vchbs);
INTRINSIC_WITH_CC(s390_vchhs);
INTRINSIC_WITH_CC(s390_vchfs);
INTRINSIC_WITH_CC(s390_vchgs);
+ INTRINSIC_WITH_CC(s390_vchqs);
INTRINSIC_WITH_CC(s390_vchlbs);
INTRINSIC_WITH_CC(s390_vchlhs);
INTRINSIC_WITH_CC(s390_vchlfs);
INTRINSIC_WITH_CC(s390_vchlgs);
+ INTRINSIC_WITH_CC(s390_vchlqs);
INTRINSIC_WITH_CC(s390_vfaebs);
INTRINSIC_WITH_CC(s390_vfaehs);
diff --git a/clang/lib/Headers/vecintrin.h b/clang/lib/Headers/vecintrin.h
index c842edd..a14c39f 100644
--- a/clang/lib/Headers/vecintrin.h
+++ b/clang/lib/Headers/vecintrin.h
@@ -468,6 +468,27 @@ vec_perm(__vector __bool long long __a, __vector __bool long long __b,
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_perm(__vector signed __int128 __a, __vector signed __int128 __b,
+ __vector unsigned char __c) {
+ return (__vector signed __int128)__builtin_s390_vperm(
+ (__vector unsigned char)__a, (__vector unsigned char)__b, __c);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_perm(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned char __c) {
+ return (__vector unsigned __int128)__builtin_s390_vperm(
+ (__vector unsigned char)__a, (__vector unsigned char)__b, __c);
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_perm(__vector __bool __int128 __a, __vector __bool __int128 __b,
+ __vector unsigned char __c) {
+ return (__vector __bool __int128)__builtin_s390_vperm(
+ (__vector unsigned char)__a, (__vector unsigned char)__b, __c);
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_perm(__vector float __a, __vector float __b,
@@ -514,9 +535,19 @@ vec_permi(__vector double __a, __vector double __b, int __c)
(__vector unsigned long long)(Y), \
(((Z) & 2) << 1) | ((Z) & 1)))
+/*-- vec_bperm --------------------------------------------------------------*/
+
+#if __ARCH__ >= 12
+static inline __ATTRS_ai __vector unsigned long long
+vec_bperm(__vector unsigned __int128 __a, __vector unsigned char __b) {
+ return __builtin_s390_vbperm((__vector unsigned char)__a, __b);
+}
+#endif
+
/*-- vec_bperm_u128 ---------------------------------------------------------*/
#if __ARCH__ >= 12
+// This prototype is deprecated.
static inline __ATTRS_ai __vector unsigned long long
vec_bperm_u128(__vector unsigned char __a, __vector unsigned char __b) {
return __builtin_s390_vbperm(__a, __b);
@@ -558,6 +589,18 @@ vec_revb(__vector unsigned long long __vec) {
return __builtin_s390_vlbrg(__vec);
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_revb(__vector signed __int128 __vec) {
+ return (__vector signed __int128)
+ __builtin_s390_vlbrq((unsigned __int128)__vec);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_revb(__vector unsigned __int128 __vec) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vlbrq((unsigned __int128)__vec);
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_revb(__vector float __vec) {
@@ -820,6 +863,46 @@ vec_sel(__vector unsigned long long __a, __vector unsigned long long __b,
(~(__vector unsigned long long)__c & __a));
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_sel(__vector signed __int128 __a, __vector signed __int128 __b,
+ __vector unsigned __int128 __c) {
+ return (((__vector signed __int128)__c & __b) |
+ (~(__vector signed __int128)__c & __a));
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_sel(__vector signed __int128 __a, __vector signed __int128 __b,
+ __vector __bool __int128 __c) {
+ return (((__vector signed __int128)__c & __b) |
+ (~(__vector signed __int128)__c & __a));
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_sel(__vector __bool __int128 __a, __vector __bool __int128 __b,
+ __vector unsigned __int128 __c) {
+ return (((__vector __bool __int128)__c & __b) |
+ (~(__vector __bool __int128)__c & __a));
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_sel(__vector __bool __int128 __a, __vector __bool __int128 __b,
+ __vector __bool __int128 __c) {
+ return (__c & __b) | (~__c & __a);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_sel(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned __int128 __c) {
+ return (__c & __b) | (~__c & __a);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_sel(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector __bool __int128 __c) {
+ return (((__vector unsigned __int128)__c & __b) |
+ (~(__vector unsigned __int128)__c & __a));
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_sel(__vector float __a, __vector float __b, __vector unsigned int __c) {
@@ -1078,6 +1161,22 @@ vec_xl(long __offset, const unsigned long long *__ptr) {
return V;
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_xl(long __offset, const signed __int128 *__ptr) {
+ __vector signed __int128 V;
+ __builtin_memcpy(&V, ((const char *)__ptr + __offset),
+ sizeof(__vector signed __int128));
+ return V;
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_xl(long __offset, const unsigned __int128 *__ptr) {
+ __vector unsigned __int128 V;
+ __builtin_memcpy(&V, ((const char *)__ptr + __offset),
+ sizeof(__vector unsigned __int128));
+ return V;
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_xl(long __offset, const float *__ptr) {
@@ -1294,6 +1393,22 @@ vec_xst(__vector unsigned long long __vec, long __offset,
sizeof(__vector unsigned long long));
}
+static inline __ATTRS_o_ai void
+vec_xst(__vector signed __int128 __vec, long __offset,
+ signed __int128 *__ptr) {
+ __vector signed __int128 V = __vec;
+ __builtin_memcpy(((char *)__ptr + __offset), &V,
+ sizeof(__vector signed __int128));
+}
+
+static inline __ATTRS_o_ai void
+vec_xst(__vector unsigned __int128 __vec, long __offset,
+ unsigned __int128 *__ptr) {
+ __vector unsigned __int128 V = __vec;
+ __builtin_memcpy(((char *)__ptr + __offset), &V,
+ sizeof(__vector unsigned __int128));
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai void
vec_xst(__vector float __vec, long __offset, float *__ptr) {
@@ -1465,6 +1580,14 @@ extern __ATTRS_o __vector unsigned long long
vec_load_bndry(const unsigned long long *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
+extern __ATTRS_o __vector signed __int128
+vec_load_bndry(const signed __int128 *__ptr, unsigned short __len)
+ __constant_pow2_range(__len, 64, 4096);
+
+extern __ATTRS_o __vector unsigned __int128
+vec_load_bndry(const unsigned __int128 *__ptr, unsigned short __len)
+ __constant_pow2_range(__len, 64, 4096);
+
#if __ARCH__ >= 12
extern __ATTRS_o __vector float
vec_load_bndry(const float *__ptr, unsigned short __len)
@@ -1496,43 +1619,51 @@ vec_load_len(const unsigned char *__ptr, unsigned int __len) {
return (__vector unsigned char)__builtin_s390_vll(__len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed short
vec_load_len(const signed short *__ptr, unsigned int __len) {
return (__vector signed short)__builtin_s390_vll(__len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_load_len(const unsigned short *__ptr, unsigned int __len) {
return (__vector unsigned short)__builtin_s390_vll(__len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed int
vec_load_len(const signed int *__ptr, unsigned int __len) {
return (__vector signed int)__builtin_s390_vll(__len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_load_len(const unsigned int *__ptr, unsigned int __len) {
return (__vector unsigned int)__builtin_s390_vll(__len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed long long
vec_load_len(const signed long long *__ptr, unsigned int __len) {
return (__vector signed long long)__builtin_s390_vll(__len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned long long
vec_load_len(const unsigned long long *__ptr, unsigned int __len) {
return (__vector unsigned long long)__builtin_s390_vll(__len, __ptr);
}
#if __ARCH__ >= 12
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector float
vec_load_len(const float *__ptr, unsigned int __len) {
return (__vector float)__builtin_s390_vll(__len, __ptr);
}
#endif
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector double
vec_load_len(const double *__ptr, unsigned int __len) {
return (__vector double)__builtin_s390_vll(__len, __ptr);
@@ -1541,7 +1672,12 @@ vec_load_len(const double *__ptr, unsigned int __len) {
/*-- vec_load_len_r ---------------------------------------------------------*/
#if __ARCH__ >= 12
-static inline __ATTRS_ai __vector unsigned char
+static inline __ATTRS_o_ai __vector signed char
+vec_load_len_r(const signed char *__ptr, unsigned int __len) {
+ return (__vector signed char)__builtin_s390_vlrlr(__len, __ptr);
+}
+
+static inline __ATTRS_o_ai __vector unsigned char
vec_load_len_r(const unsigned char *__ptr, unsigned int __len) {
return (__vector unsigned char)__builtin_s390_vlrlr(__len, __ptr);
}
@@ -1561,36 +1697,42 @@ vec_store_len(__vector unsigned char __vec, unsigned char *__ptr,
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_store_len(__vector signed short __vec, signed short *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_store_len(__vector unsigned short __vec, unsigned short *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_store_len(__vector signed int __vec, signed int *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_store_len(__vector unsigned int __vec, unsigned int *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_store_len(__vector signed long long __vec, signed long long *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_store_len(__vector unsigned long long __vec, unsigned long long *__ptr,
unsigned int __len) {
@@ -1598,6 +1740,7 @@ vec_store_len(__vector unsigned long long __vec, unsigned long long *__ptr,
}
#if __ARCH__ >= 12
+// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_store_len(__vector float __vec, float *__ptr,
unsigned int __len) {
@@ -1605,6 +1748,7 @@ vec_store_len(__vector float __vec, float *__ptr,
}
#endif
+// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_store_len(__vector double __vec, double *__ptr,
unsigned int __len) {
@@ -1614,7 +1758,13 @@ vec_store_len(__vector double __vec, double *__ptr,
/*-- vec_store_len_r --------------------------------------------------------*/
#if __ARCH__ >= 12
-static inline __ATTRS_ai void
+static inline __ATTRS_o_ai void
+vec_store_len_r(__vector signed char __vec, signed char *__ptr,
+ unsigned int __len) {
+ __builtin_s390_vstrlr(__vec, __len, __ptr);
+}
+
+static inline __ATTRS_o_ai void
vec_store_len_r(__vector unsigned char __vec, unsigned char *__ptr,
unsigned int __len) {
__builtin_s390_vstrlr((__vector signed char)__vec, __len, __ptr);
@@ -1711,6 +1861,35 @@ vec_genmasks_64(unsigned char __first, unsigned char __last)
return (__vector unsigned long long)__value;
}
+/*-- vec_gen_element_masks_* ------------------------------------------------*/
+
+#if __ARCH__ >= 15
+static inline __ATTRS_ai __vector unsigned char
+vec_gen_element_masks_8(__vector unsigned short __mask) {
+ return __builtin_s390_vgemb(__mask);
+}
+
+static inline __ATTRS_ai __vector unsigned short
+vec_gen_element_masks_16(__vector unsigned char __mask) {
+ return __builtin_s390_vgemh(__mask);
+}
+
+static inline __ATTRS_ai __vector unsigned int
+vec_gen_element_masks_32(__vector unsigned char __mask) {
+ return __builtin_s390_vgemf(__mask);
+}
+
+static inline __ATTRS_ai __vector unsigned long long
+vec_gen_element_masks_64(__vector unsigned char __mask) {
+ return __builtin_s390_vgemg(__mask);
+}
+
+static inline __ATTRS_ai __vector unsigned __int128
+vec_gen_element_masks_128(__vector unsigned char __mask) {
+ return (__vector unsigned __int128)__builtin_s390_vgemq(__mask);
+}
+#endif
+
/*-- vec_splat --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
@@ -1894,6 +2073,16 @@ vec_splats(unsigned long long __scalar) {
return (__vector unsigned long long)__scalar;
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_splats(signed __int128 __scalar) {
+ return (__vector signed __int128)__scalar;
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_splats(unsigned __int128 __scalar) {
+ return (__vector unsigned __int128)__scalar;
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_splats(float __scalar) {
@@ -2166,6 +2355,27 @@ vec_pack(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector unsigned int)(__ac[1], __ac[3], __bc[1], __bc[3]);
}
+static inline __ATTRS_o_ai __vector signed long long
+vec_pack(__vector signed __int128 __a, __vector signed __int128 __b) {
+ __vector signed long long __ac = (__vector signed long long)__a;
+ __vector signed long long __bc = (__vector signed long long)__b;
+ return (__vector signed long long)(__ac[1], __bc[1]);
+}
+
+static inline __ATTRS_o_ai __vector __bool long long
+vec_pack(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ __vector __bool long long __ac = (__vector __bool long long)__a;
+ __vector __bool long long __bc = (__vector __bool long long)__b;
+ return (__vector __bool long long)(__ac[1], __bc[1]);
+}
+
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_pack(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ __vector unsigned long long __ac = (__vector unsigned long long)__a;
+ __vector unsigned long long __bc = (__vector unsigned long long)__b;
+ return (__vector unsigned long long)(__ac[1], __bc[1]);
+}
+
/*-- vec_packs --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
@@ -2344,6 +2554,24 @@ vec_unpackh(__vector unsigned int __a) {
return __builtin_s390_vuplhf(__a);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed __int128
+vec_unpackh(__vector signed long long __a) {
+ return (__vector signed __int128)__builtin_s390_vuphg(__a);
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_unpackh(__vector __bool long long __a) {
+ return ((__vector __bool __int128)
+ __builtin_s390_vuphg((__vector signed long long)__a));
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_unpackh(__vector unsigned long long __a) {
+ return (__vector unsigned __int128)__builtin_s390_vuplhg(__a);
+}
+#endif
+
/*-- vec_unpackl ------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed short
@@ -2394,6 +2622,24 @@ vec_unpackl(__vector unsigned int __a) {
return __builtin_s390_vupllf(__a);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed __int128
+vec_unpackl(__vector signed long long __a) {
+ return (__vector signed __int128)__builtin_s390_vuplg(__a);
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_unpackl(__vector __bool long long __a) {
+ return ((__vector __bool __int128)
+ __builtin_s390_vuplg((__vector signed long long)__a));
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_unpackl(__vector unsigned long long __a) {
+ return (__vector unsigned __int128)__builtin_s390_vupllg(__a);
+}
+#endif
+
/*-- vec_cmpeq --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector __bool char
@@ -2456,6 +2702,21 @@ vec_cmpeq(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector __bool long long)(__a == __b);
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmpeq(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ return (__vector __bool __int128)(__a == __b);
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmpeq(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return (__vector __bool __int128)(__a == __b);
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmpeq(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return (__vector __bool __int128)(__a == __b);
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector __bool int
vec_cmpeq(__vector float __a, __vector float __b) {
@@ -2510,6 +2771,16 @@ vec_cmpge(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector __bool long long)(__a >= __b);
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmpge(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return (__vector __bool __int128)(__a >= __b);
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmpge(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return (__vector __bool __int128)(__a >= __b);
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector __bool int
vec_cmpge(__vector float __a, __vector float __b) {
@@ -2564,6 +2835,16 @@ vec_cmpgt(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector __bool long long)(__a > __b);
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmpgt(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return (__vector __bool __int128)(__a > __b);
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmpgt(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return (__vector __bool __int128)(__a > __b);
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector __bool int
vec_cmpgt(__vector float __a, __vector float __b) {
@@ -2618,6 +2899,16 @@ vec_cmple(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector __bool long long)(__a <= __b);
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmple(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return (__vector __bool __int128)(__a <= __b);
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmple(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return (__vector __bool __int128)(__a <= __b);
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector __bool int
vec_cmple(__vector float __a, __vector float __b) {
@@ -2672,6 +2963,16 @@ vec_cmplt(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector __bool long long)(__a < __b);
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmplt(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return (__vector __bool __int128)(__a < __b);
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_cmplt(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return (__vector __bool __int128)(__a < __b);
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector __bool int
vec_cmplt(__vector float __a, __vector float __b) {
@@ -2914,6 +3215,29 @@ vec_all_eq(__vector __bool long long __a, __vector __bool long long __b) {
return __cc == 0;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_all_eq(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc == 0;
+}
+
+static inline __ATTRS_o_ai int
+vec_all_eq(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc == 0;
+}
+
+static inline __ATTRS_o_ai int
+vec_all_eq(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc == 0;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_all_eq(__vector float __a, __vector float __b) {
@@ -3161,6 +3485,29 @@ vec_all_ne(__vector __bool long long __a, __vector __bool long long __b) {
return __cc == 3;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_all_ne(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc == 3;
+}
+
+static inline __ATTRS_o_ai int
+vec_all_ne(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc == 3;
+}
+
+static inline __ATTRS_o_ai int
+vec_all_ne(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc == 3;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_all_ne(__vector float __a, __vector float __b) {
@@ -3399,6 +3746,22 @@ vec_all_ge(__vector __bool long long __a, __vector __bool long long __b) {
return __cc == 3;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_all_ge(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vchqs((signed __int128)__b, (signed __int128)__a, &__cc);
+ return __cc == 3;
+}
+
+static inline __ATTRS_o_ai int
+vec_all_ge(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vchlqs((unsigned __int128)__b, (unsigned __int128)__a, &__cc);
+ return __cc == 3;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_all_ge(__vector float __a, __vector float __b) {
@@ -3637,6 +4000,22 @@ vec_all_gt(__vector __bool long long __a, __vector __bool long long __b) {
return __cc == 0;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_all_gt(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vchqs((signed __int128)__a, (signed __int128)__b, &__cc);
+ return __cc == 0;
+}
+
+static inline __ATTRS_o_ai int
+vec_all_gt(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vchlqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc == 0;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_all_gt(__vector float __a, __vector float __b) {
@@ -3875,6 +4254,22 @@ vec_all_le(__vector __bool long long __a, __vector __bool long long __b) {
return __cc == 3;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_all_le(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vchqs((signed __int128)__a, (signed __int128)__b, &__cc);
+ return __cc == 3;
+}
+
+static inline __ATTRS_o_ai int
+vec_all_le(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vchlqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc == 3;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_all_le(__vector float __a, __vector float __b) {
@@ -4113,6 +4508,22 @@ vec_all_lt(__vector __bool long long __a, __vector __bool long long __b) {
return __cc == 0;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_all_lt(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vchqs((signed __int128)__b, (signed __int128)__a, &__cc);
+ return __cc == 0;
+}
+
+static inline __ATTRS_o_ai int
+vec_all_lt(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vchlqs((unsigned __int128)__b, (unsigned __int128)__a, &__cc);
+ return __cc == 0;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_all_lt(__vector float __a, __vector float __b) {
@@ -4467,6 +4878,29 @@ vec_any_eq(__vector __bool long long __a, __vector __bool long long __b) {
return __cc <= 1;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_any_eq(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc <= 1;
+}
+
+static inline __ATTRS_o_ai int
+vec_any_eq(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc <= 1;
+}
+
+static inline __ATTRS_o_ai int
+vec_any_eq(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc <= 1;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_any_eq(__vector float __a, __vector float __b) {
@@ -4713,6 +5147,29 @@ vec_any_ne(__vector __bool long long __a, __vector __bool long long __b) {
return __cc != 0;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_any_ne(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc != 0;
+}
+
+static inline __ATTRS_o_ai int
+vec_any_ne(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc != 0;
+}
+
+static inline __ATTRS_o_ai int
+vec_any_ne(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ int __cc;
+ __builtin_s390_vceqqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc != 0;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_any_ne(__vector float __a, __vector float __b) {
@@ -4951,6 +5408,22 @@ vec_any_ge(__vector __bool long long __a, __vector __bool long long __b) {
return __cc != 0;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_any_ge(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vchqs((signed __int128)__b, (signed __int128)__a, &__cc);
+ return __cc != 0;
+}
+
+static inline __ATTRS_o_ai int
+vec_any_ge(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vchlqs((unsigned __int128)__b, (unsigned __int128)__a, &__cc);
+ return __cc != 0;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_any_ge(__vector float __a, __vector float __b) {
@@ -5189,6 +5662,22 @@ vec_any_gt(__vector __bool long long __a, __vector __bool long long __b) {
return __cc <= 1;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_any_gt(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vchqs((signed __int128)__a, (signed __int128)__b, &__cc);
+ return __cc <= 1;
+}
+
+static inline __ATTRS_o_ai int
+vec_any_gt(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vchlqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc <= 1;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_any_gt(__vector float __a, __vector float __b) {
@@ -5427,6 +5916,22 @@ vec_any_le(__vector __bool long long __a, __vector __bool long long __b) {
return __cc != 0;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_any_le(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vchqs((signed __int128)__a, (signed __int128)__b, &__cc);
+ return __cc != 0;
+}
+
+static inline __ATTRS_o_ai int
+vec_any_le(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vchlqs((unsigned __int128)__a, (unsigned __int128)__b, &__cc);
+ return __cc != 0;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_any_le(__vector float __a, __vector float __b) {
@@ -5665,6 +6170,22 @@ vec_any_lt(__vector __bool long long __a, __vector __bool long long __b) {
return __cc <= 1;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai int
+vec_any_lt(__vector signed __int128 __a, __vector signed __int128 __b) {
+ int __cc;
+ __builtin_s390_vchqs((signed __int128)__b, (signed __int128)__a, &__cc);
+ return __cc <= 1;
+}
+
+static inline __ATTRS_o_ai int
+vec_any_lt(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ int __cc;
+ __builtin_s390_vchlqs((unsigned __int128)__b, (unsigned __int128)__a, &__cc);
+ return __cc <= 1;
+}
+#endif
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_any_lt(__vector float __a, __vector float __b) {
@@ -5789,6 +6310,385 @@ vec_any_numeric(__vector double __a) {
return __cc != 0;
}
+/*-- vec_blend --------------------------------------------------------------*/
+
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed char
+vec_blend(__vector signed char __a, __vector signed char __b,
+ __vector signed char __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed char)0));
+}
+
+static inline __ATTRS_o_ai __vector __bool char
+vec_blend(__vector __bool char __a, __vector __bool char __b,
+ __vector signed char __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed char)0));
+}
+
+static inline __ATTRS_o_ai __vector unsigned char
+vec_blend(__vector unsigned char __a, __vector unsigned char __b,
+ __vector signed char __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed char)0));
+}
+
+static inline __ATTRS_o_ai __vector signed short
+vec_blend(__vector signed short __a, __vector signed short __b,
+ __vector signed short __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed short)0));
+}
+
+static inline __ATTRS_o_ai __vector __bool short
+vec_blend(__vector __bool short __a, __vector __bool short __b,
+ __vector signed short __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed short)0));
+}
+
+static inline __ATTRS_o_ai __vector unsigned short
+vec_blend(__vector unsigned short __a, __vector unsigned short __b,
+ __vector signed short __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed short)0));
+}
+
+static inline __ATTRS_o_ai __vector signed int
+vec_blend(__vector signed int __a, __vector signed int __b,
+ __vector signed int __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed int)0));
+}
+
+static inline __ATTRS_o_ai __vector __bool int
+vec_blend(__vector __bool int __a, __vector __bool int __b,
+ __vector signed int __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed int)0));
+}
+
+static inline __ATTRS_o_ai __vector unsigned int
+vec_blend(__vector unsigned int __a, __vector unsigned int __b,
+ __vector signed int __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed int)0));
+}
+
+static inline __ATTRS_o_ai __vector signed long long
+vec_blend(__vector signed long long __a, __vector signed long long __b,
+ __vector signed long long __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed long long)0));
+}
+
+static inline __ATTRS_o_ai __vector __bool long long
+vec_blend(__vector __bool long long __a, __vector __bool long long __b,
+ __vector signed long long __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed long long)0));
+}
+
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_blend(__vector unsigned long long __a, __vector unsigned long long __b,
+ __vector signed long long __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed long long)0));
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_blend(__vector signed __int128 __a, __vector signed __int128 __b,
+ __vector signed __int128 __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed __int128)0));
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_blend(__vector __bool __int128 __a, __vector __bool __int128 __b,
+ __vector signed __int128 __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed __int128)0));
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_blend(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector signed __int128 __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed __int128)0));
+}
+
+static inline __ATTRS_o_ai __vector float
+vec_blend(__vector float __a, __vector float __b,
+ __vector signed int __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed int)0));
+}
+
+static inline __ATTRS_o_ai __vector double
+vec_blend(__vector double __a, __vector double __b,
+ __vector signed long long __c) {
+ return vec_sel(__a, __b, vec_cmplt(__c, (__vector signed long long)0));
+}
+#endif
+
+/*-- vec_and ---------------------------------------------------------------*/
+
+static inline __ATTRS_o_ai __vector __bool char
+vec_and(__vector __bool char __a, __vector __bool char __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector signed char
+vec_and(__vector signed char __a, __vector signed char __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned char
+vec_and(__vector unsigned char __a, __vector unsigned char __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool short
+vec_and(__vector __bool short __a, __vector __bool short __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector signed short
+vec_and(__vector signed short __a, __vector signed short __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned short
+vec_and(__vector unsigned short __a, __vector unsigned short __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool int
+vec_and(__vector __bool int __a, __vector __bool int __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector signed int
+vec_and(__vector signed int __a, __vector signed int __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned int
+vec_and(__vector unsigned int __a, __vector unsigned int __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool long long
+vec_and(__vector __bool long long __a, __vector __bool long long __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector signed long long
+vec_and(__vector signed long long __a, __vector signed long long __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_and(__vector unsigned long long __a, __vector unsigned long long __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_and(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_and(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return __a & __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_and(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return __a & __b;
+}
+
+#if __ARCH__ >= 12
+static inline __ATTRS_o_ai __vector float
+vec_and(__vector float __a, __vector float __b) {
+ return (__vector float)((__vector unsigned int)__a &
+ (__vector unsigned int)__b);
+}
+#endif
+
+static inline __ATTRS_o_ai __vector double
+vec_and(__vector double __a, __vector double __b) {
+ return (__vector double)((__vector unsigned long long)__a &
+ (__vector unsigned long long)__b);
+}
+
+/*-- vec_or ----------------------------------------------------------------*/
+
+static inline __ATTRS_o_ai __vector __bool char
+vec_or(__vector __bool char __a, __vector __bool char __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector signed char
+vec_or(__vector signed char __a, __vector signed char __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned char
+vec_or(__vector unsigned char __a, __vector unsigned char __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool short
+vec_or(__vector __bool short __a, __vector __bool short __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector signed short
+vec_or(__vector signed short __a, __vector signed short __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned short
+vec_or(__vector unsigned short __a, __vector unsigned short __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool int
+vec_or(__vector __bool int __a, __vector __bool int __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector signed int
+vec_or(__vector signed int __a, __vector signed int __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned int
+vec_or(__vector unsigned int __a, __vector unsigned int __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool long long
+vec_or(__vector __bool long long __a, __vector __bool long long __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector signed long long
+vec_or(__vector signed long long __a, __vector signed long long __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_or(__vector unsigned long long __a, __vector unsigned long long __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_or(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_or(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return __a | __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_or(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return __a | __b;
+}
+
+#if __ARCH__ >= 12
+static inline __ATTRS_o_ai __vector float
+vec_or(__vector float __a, __vector float __b) {
+ return (__vector float)((__vector unsigned int)__a |
+ (__vector unsigned int)__b);
+}
+#endif
+
+static inline __ATTRS_o_ai __vector double
+vec_or(__vector double __a, __vector double __b) {
+ return (__vector double)((__vector unsigned long long)__a |
+ (__vector unsigned long long)__b);
+}
+
+/*-- vec_xor ----------------------------------------------------------------*/
+
+static inline __ATTRS_o_ai __vector __bool char
+vec_xor(__vector __bool char __a, __vector __bool char __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector signed char
+vec_xor(__vector signed char __a, __vector signed char __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned char
+vec_xor(__vector unsigned char __a, __vector unsigned char __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool short
+vec_xor(__vector __bool short __a, __vector __bool short __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector signed short
+vec_xor(__vector signed short __a, __vector signed short __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned short
+vec_xor(__vector unsigned short __a, __vector unsigned short __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool int
+vec_xor(__vector __bool int __a, __vector __bool int __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector signed int
+vec_xor(__vector signed int __a, __vector signed int __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned int
+vec_xor(__vector unsigned int __a, __vector unsigned int __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool long long
+vec_xor(__vector __bool long long __a, __vector __bool long long __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector signed long long
+vec_xor(__vector signed long long __a, __vector signed long long __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_xor(__vector unsigned long long __a, __vector unsigned long long __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_xor(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_xor(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return __a ^ __b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_xor(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return __a ^ __b;
+}
+
+#if __ARCH__ >= 12
+static inline __ATTRS_o_ai __vector float
+vec_xor(__vector float __a, __vector float __b) {
+ return (__vector float)((__vector unsigned int)__a ^
+ (__vector unsigned int)__b);
+}
+#endif
+
+static inline __ATTRS_o_ai __vector double
+vec_xor(__vector double __a, __vector double __b) {
+ return (__vector double)((__vector unsigned long long)__a ^
+ (__vector unsigned long long)__b);
+}
+
/*-- vec_andc ---------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector __bool char
@@ -5947,6 +6847,21 @@ vec_andc(__vector unsigned long long __a, __vector __bool long long __b) {
return __a & ~__b;
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_andc(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ return __a & ~__b;
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_andc(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return __a & ~__b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_andc(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return __a & ~__b;
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_andc(__vector float __a, __vector float __b) {
@@ -6133,6 +7048,21 @@ vec_nor(__vector unsigned long long __a, __vector __bool long long __b) {
return ~(__a | __b);
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_nor(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ return ~(__a | __b);
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_nor(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return ~(__a | __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_nor(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return ~(__a | __b);
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_nor(__vector float __a, __vector float __b) {
@@ -6224,6 +7154,21 @@ vec_orc(__vector unsigned long long __a, __vector unsigned long long __b) {
return __a | ~__b;
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_orc(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ return __a | ~__b;
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_orc(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return __a | ~__b;
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_orc(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return __a | ~__b;
+}
+
static inline __ATTRS_o_ai __vector float
vec_orc(__vector float __a, __vector float __b) {
return (__vector float)((__vector unsigned int)__a |
@@ -6300,6 +7245,21 @@ vec_nand(__vector unsigned long long __a, __vector unsigned long long __b) {
return ~(__a & __b);
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_nand(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ return ~(__a & __b);
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_nand(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return ~(__a & __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_nand(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return ~(__a & __b);
+}
+
static inline __ATTRS_o_ai __vector float
vec_nand(__vector float __a, __vector float __b) {
return (__vector float)~((__vector unsigned int)__a &
@@ -6376,6 +7336,21 @@ vec_eqv(__vector unsigned long long __a, __vector unsigned long long __b) {
return ~(__a ^ __b);
}
+static inline __ATTRS_o_ai __vector __bool __int128
+vec_eqv(__vector __bool __int128 __a, __vector __bool __int128 __b) {
+ return ~(__a ^ __b);
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_eqv(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return ~(__a ^ __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_eqv(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return ~(__a ^ __b);
+}
+
static inline __ATTRS_o_ai __vector float
vec_eqv(__vector float __a, __vector float __b) {
return (__vector float)~((__vector unsigned int)__a ^
@@ -6389,6 +7364,91 @@ vec_eqv(__vector double __a, __vector double __b) {
}
#endif
+/*-- vec_evaluate -----------------------------------------------------------*/
+
+#if __ARCH__ >= 15
+extern __ATTRS_o __vector signed char
+vec_evaluate(__vector signed char __a, __vector signed char __b,
+ __vector signed char __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector unsigned char
+vec_evaluate(__vector unsigned char __a, __vector unsigned char __b,
+ __vector unsigned char __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector __bool char
+vec_evaluate(__vector __bool char __a, __vector __bool char __b,
+ __vector __bool char __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector signed short
+vec_evaluate(__vector signed short __a, __vector signed short __b,
+ __vector signed short __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector unsigned short
+vec_evaluate(__vector unsigned short __a, __vector unsigned short __b,
+ __vector unsigned short __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector __bool short
+vec_evaluate(__vector __bool short __a, __vector __bool short __b,
+ __vector __bool short __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector signed int
+vec_evaluate(__vector signed int __a, __vector signed int __b,
+ __vector signed int __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector unsigned int
+vec_evaluate(__vector unsigned int __a, __vector unsigned int __b,
+ __vector unsigned int __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector __bool int
+vec_evaluate(__vector __bool int __a, __vector __bool int __b,
+ __vector __bool int __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector signed long long
+vec_evaluate(__vector signed long long __a, __vector signed long long __b,
+ __vector signed long long __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector unsigned long long
+vec_evaluate(__vector unsigned long long __a, __vector unsigned long long __b,
+ __vector unsigned long long __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector __bool long long
+vec_evaluate(__vector __bool long long __a, __vector __bool long long __b,
+ __vector __bool long long __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector signed __int128
+vec_evaluate(__vector signed __int128 __a, __vector signed __int128 __b,
+ __vector signed __int128 __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector unsigned __int128
+vec_evaluate(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned __int128 __c, unsigned char __d)
+ __constant(__d);
+
+extern __ATTRS_o __vector __bool __int128
+vec_evaluate(__vector __bool __int128 __a, __vector __bool __int128 __b,
+ __vector __bool __int128 __c, unsigned char __d)
+ __constant(__d);
+
+#define vec_evaluate(A, B, C, D) \
+ ((__typeof__((vec_evaluate)((A), (B), (C), (D)))) \
+ __builtin_s390_veval((__vector unsigned char)(A), \
+ (__vector unsigned char)(B), \
+ (__vector unsigned char)(C), (D)))
+#endif
+
/*-- vec_cntlz --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector unsigned char
@@ -6431,6 +7491,20 @@ vec_cntlz(__vector unsigned long long __a) {
return __builtin_s390_vclzg(__a);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_cntlz(__vector signed __int128 __a) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vclzq((unsigned __int128)__a);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_cntlz(__vector unsigned __int128 __a) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vclzq((unsigned __int128)__a);
+}
+#endif
+
/*-- vec_cnttz --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector unsigned char
@@ -6473,6 +7547,20 @@ vec_cnttz(__vector unsigned long long __a) {
return __builtin_s390_vctzg(__a);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_cnttz(__vector signed __int128 __a) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vctzq((unsigned __int128)__a);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_cnttz(__vector unsigned __int128 __a) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vctzq((unsigned __int128)__a);
+}
+#endif
+
/*-- vec_popcnt -------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector unsigned char
@@ -6904,8 +7992,21 @@ vec_sll(__vector unsigned long long __a, __vector unsigned int __b) {
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_sll(__vector signed __int128 __a, __vector unsigned char __b) {
+ return (__vector signed __int128)__builtin_s390_vsl(
+ (__vector unsigned char)__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_sll(__vector unsigned __int128 __a, __vector unsigned char __b) {
+ return (__vector unsigned __int128)__builtin_s390_vsl(
+ (__vector unsigned char)__a, __b);
+}
+
/*-- vec_slb ----------------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed char
vec_slb(__vector signed char __a, __vector signed char __b) {
return (__vector signed char)__builtin_s390_vslb(
@@ -6918,6 +8019,7 @@ vec_slb(__vector signed char __a, __vector unsigned char __b) {
(__vector unsigned char)__a, __b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_slb(__vector unsigned char __a, __vector signed char __b) {
return __builtin_s390_vslb(__a, (__vector unsigned char)__b);
@@ -6928,110 +8030,187 @@ vec_slb(__vector unsigned char __a, __vector unsigned char __b) {
return __builtin_s390_vslb(__a, __b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed short
vec_slb(__vector signed short __a, __vector signed short __b) {
return (__vector signed short)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed short
vec_slb(__vector signed short __a, __vector unsigned short __b) {
return (__vector signed short)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed short
+vec_slb(__vector signed short __a, __vector unsigned char __b) {
+ return (__vector signed short)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_slb(__vector unsigned short __a, __vector signed short __b) {
return (__vector unsigned short)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_slb(__vector unsigned short __a, __vector unsigned short __b) {
return (__vector unsigned short)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector unsigned short
+vec_slb(__vector unsigned short __a, __vector unsigned char __b) {
+ return (__vector unsigned short)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed int
vec_slb(__vector signed int __a, __vector signed int __b) {
return (__vector signed int)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed int
vec_slb(__vector signed int __a, __vector unsigned int __b) {
return (__vector signed int)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed int
+vec_slb(__vector signed int __a, __vector unsigned char __b) {
+ return (__vector signed int)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_slb(__vector unsigned int __a, __vector signed int __b) {
return (__vector unsigned int)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_slb(__vector unsigned int __a, __vector unsigned int __b) {
return (__vector unsigned int)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector unsigned int
+vec_slb(__vector unsigned int __a, __vector unsigned char __b) {
+ return (__vector unsigned int)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed long long
vec_slb(__vector signed long long __a, __vector signed long long __b) {
return (__vector signed long long)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed long long
vec_slb(__vector signed long long __a, __vector unsigned long long __b) {
return (__vector signed long long)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed long long
+vec_slb(__vector signed long long __a, __vector unsigned char __b) {
+ return (__vector signed long long)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned long long
vec_slb(__vector unsigned long long __a, __vector signed long long __b) {
return (__vector unsigned long long)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned long long
vec_slb(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector unsigned long long)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_slb(__vector unsigned long long __a, __vector unsigned char __b) {
+ return (__vector unsigned long long)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_slb(__vector signed __int128 __a, __vector unsigned char __b) {
+ return (__vector signed __int128)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_slb(__vector unsigned __int128 __a, __vector unsigned char __b) {
+ return (__vector unsigned __int128)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
+
#if __ARCH__ >= 12
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector float
vec_slb(__vector float __a, __vector signed int __b) {
return (__vector float)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector float
vec_slb(__vector float __a, __vector unsigned int __b) {
return (__vector float)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+
+static inline __ATTRS_o_ai __vector float
+vec_slb(__vector float __a, __vector unsigned char __b) {
+ return (__vector float)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
#endif
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector double
vec_slb(__vector double __a, __vector signed long long __b) {
return (__vector double)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector double
vec_slb(__vector double __a, __vector unsigned long long __b) {
return (__vector double)__builtin_s390_vslb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector double
+vec_slb(__vector double __a, __vector unsigned char __b) {
+ return (__vector double)__builtin_s390_vslb(
+ (__vector unsigned char)__a, __b);
+}
+
/*-- vec_sld ----------------------------------------------------------------*/
extern __ATTRS_o __vector signed char
vec_sld(__vector signed char __a, __vector signed char __b, int __c)
__constant_range(__c, 0, 15);
+// This prototype is deprecated.
extern __ATTRS_o __vector __bool char
vec_sld(__vector __bool char __a, __vector __bool char __b, int __c)
__constant_range(__c, 0, 15);
@@ -7044,6 +8223,7 @@ extern __ATTRS_o __vector signed short
vec_sld(__vector signed short __a, __vector signed short __b, int __c)
__constant_range(__c, 0, 15);
+// This prototype is deprecated.
extern __ATTRS_o __vector __bool short
vec_sld(__vector __bool short __a, __vector __bool short __b, int __c)
__constant_range(__c, 0, 15);
@@ -7056,6 +8236,7 @@ extern __ATTRS_o __vector signed int
vec_sld(__vector signed int __a, __vector signed int __b, int __c)
__constant_range(__c, 0, 15);
+// This prototype is deprecated.
extern __ATTRS_o __vector __bool int
vec_sld(__vector __bool int __a, __vector __bool int __b, int __c)
__constant_range(__c, 0, 15);
@@ -7068,6 +8249,7 @@ extern __ATTRS_o __vector signed long long
vec_sld(__vector signed long long __a, __vector signed long long __b, int __c)
__constant_range(__c, 0, 15);
+// This prototype is deprecated.
extern __ATTRS_o __vector __bool long long
vec_sld(__vector __bool long long __a, __vector __bool long long __b, int __c)
__constant_range(__c, 0, 15);
@@ -7077,6 +8259,15 @@ vec_sld(__vector unsigned long long __a, __vector unsigned long long __b,
int __c)
__constant_range(__c, 0, 15);
+extern __ATTRS_o __vector signed __int128
+vec_sld(__vector signed __int128 __a, __vector signed __int128 __b, int __c)
+ __constant_range(__c, 0, 15);
+
+extern __ATTRS_o __vector unsigned __int128
+vec_sld(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ int __c)
+ __constant_range(__c, 0, 15);
+
#if __ARCH__ >= 12
extern __ATTRS_o __vector float
vec_sld(__vector float __a, __vector float __b, int __c)
@@ -7126,6 +8317,15 @@ vec_sldw(__vector unsigned long long __a, __vector unsigned long long __b,
int __c)
__constant_range(__c, 0, 3);
+extern __ATTRS_o __vector signed __int128
+vec_sldw(__vector signed __int128 __a, __vector signed __int128 __b, int __c)
+ __constant_range(__c, 0, 3);
+
+extern __ATTRS_o __vector unsigned __int128
+vec_sldw(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ int __c)
+ __constant_range(__c, 0, 3);
+
// This prototype is deprecated.
extern __ATTRS_o __vector double
vec_sldw(__vector double __a, __vector double __b, int __c)
@@ -7172,6 +8372,15 @@ vec_sldb(__vector unsigned long long __a, __vector unsigned long long __b,
int __c)
__constant_range(__c, 0, 7);
+extern __ATTRS_o __vector signed __int128
+vec_sldb(__vector signed __int128 __a, __vector signed __int128 __b, int __c)
+ __constant_range(__c, 0, 7);
+
+extern __ATTRS_o __vector unsigned __int128
+vec_sldb(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ int __c)
+ __constant_range(__c, 0, 7);
+
extern __ATTRS_o __vector float
vec_sldb(__vector float __a, __vector float __b, int __c)
__constant_range(__c, 0, 7);
@@ -7429,8 +8638,21 @@ vec_sral(__vector unsigned long long __a, __vector unsigned int __b) {
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_sral(__vector signed __int128 __a, __vector unsigned char __b) {
+ return (__vector signed __int128)__builtin_s390_vsra(
+ (__vector unsigned char)__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_sral(__vector unsigned __int128 __a, __vector unsigned char __b) {
+ return (__vector unsigned __int128)__builtin_s390_vsra(
+ (__vector unsigned char)__a, __b);
+}
+
/*-- vec_srab ---------------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed char
vec_srab(__vector signed char __a, __vector signed char __b) {
return (__vector signed char)__builtin_s390_vsrab(
@@ -7443,6 +8665,7 @@ vec_srab(__vector signed char __a, __vector unsigned char __b) {
(__vector unsigned char)__a, __b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_srab(__vector unsigned char __a, __vector signed char __b) {
return __builtin_s390_vsrab(__a, (__vector unsigned char)__b);
@@ -7453,104 +8676,180 @@ vec_srab(__vector unsigned char __a, __vector unsigned char __b) {
return __builtin_s390_vsrab(__a, __b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed short
vec_srab(__vector signed short __a, __vector signed short __b) {
return (__vector signed short)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed short
vec_srab(__vector signed short __a, __vector unsigned short __b) {
return (__vector signed short)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed short
+vec_srab(__vector signed short __a, __vector unsigned char __b) {
+ return (__vector signed short)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_srab(__vector unsigned short __a, __vector signed short __b) {
return (__vector unsigned short)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_srab(__vector unsigned short __a, __vector unsigned short __b) {
return (__vector unsigned short)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector unsigned short
+vec_srab(__vector unsigned short __a, __vector unsigned char __b) {
+ return (__vector unsigned short)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed int
vec_srab(__vector signed int __a, __vector signed int __b) {
return (__vector signed int)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed int
vec_srab(__vector signed int __a, __vector unsigned int __b) {
return (__vector signed int)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed int
+vec_srab(__vector signed int __a, __vector unsigned char __b) {
+ return (__vector signed int)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_srab(__vector unsigned int __a, __vector signed int __b) {
return (__vector unsigned int)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_srab(__vector unsigned int __a, __vector unsigned int __b) {
return (__vector unsigned int)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector unsigned int
+vec_srab(__vector unsigned int __a, __vector unsigned char __b) {
+ return (__vector unsigned int)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed long long
vec_srab(__vector signed long long __a, __vector signed long long __b) {
return (__vector signed long long)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed long long
vec_srab(__vector signed long long __a, __vector unsigned long long __b) {
return (__vector signed long long)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed long long
+vec_srab(__vector signed long long __a, __vector unsigned char __b) {
+ return (__vector signed long long)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned long long
vec_srab(__vector unsigned long long __a, __vector signed long long __b) {
return (__vector unsigned long long)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned long long
vec_srab(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector unsigned long long)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_srab(__vector unsigned long long __a, __vector unsigned char __b) {
+ return (__vector unsigned long long)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_srab(__vector signed __int128 __a, __vector unsigned char __b) {
+ return (__vector signed __int128)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_srab(__vector unsigned __int128 __a, __vector unsigned char __b) {
+ return (__vector unsigned __int128)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
+
#if __ARCH__ >= 12
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector float
vec_srab(__vector float __a, __vector signed int __b) {
return (__vector float)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector float
vec_srab(__vector float __a, __vector unsigned int __b) {
return (__vector float)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+
+static inline __ATTRS_o_ai __vector float
+vec_srab(__vector float __a, __vector unsigned char __b) {
+ return (__vector float)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
#endif
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector double
vec_srab(__vector double __a, __vector signed long long __b) {
return (__vector double)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector double
vec_srab(__vector double __a, __vector unsigned long long __b) {
return (__vector double)__builtin_s390_vsrab(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector double
+vec_srab(__vector double __a, __vector unsigned char __b) {
+ return (__vector double)__builtin_s390_vsrab(
+ (__vector unsigned char)__a, __b);
+}
+
/*-- vec_srl ----------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
@@ -7794,8 +9093,21 @@ vec_srl(__vector unsigned long long __a, __vector unsigned int __b) {
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_srl(__vector signed __int128 __a, __vector unsigned char __b) {
+ return (__vector signed __int128)__builtin_s390_vsrl(
+ (__vector unsigned char)__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_srl(__vector unsigned __int128 __a, __vector unsigned char __b) {
+ return (__vector unsigned __int128)__builtin_s390_vsrl(
+ (__vector unsigned char)__a, __b);
+}
+
/*-- vec_srb ----------------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed char
vec_srb(__vector signed char __a, __vector signed char __b) {
return (__vector signed char)__builtin_s390_vsrlb(
@@ -7808,6 +9120,7 @@ vec_srb(__vector signed char __a, __vector unsigned char __b) {
(__vector unsigned char)__a, __b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_srb(__vector unsigned char __a, __vector signed char __b) {
return __builtin_s390_vsrlb(__a, (__vector unsigned char)__b);
@@ -7818,104 +9131,180 @@ vec_srb(__vector unsigned char __a, __vector unsigned char __b) {
return __builtin_s390_vsrlb(__a, __b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed short
vec_srb(__vector signed short __a, __vector signed short __b) {
return (__vector signed short)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed short
vec_srb(__vector signed short __a, __vector unsigned short __b) {
return (__vector signed short)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed short
+vec_srb(__vector signed short __a, __vector unsigned char __b) {
+ return (__vector signed short)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_srb(__vector unsigned short __a, __vector signed short __b) {
return (__vector unsigned short)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_srb(__vector unsigned short __a, __vector unsigned short __b) {
return (__vector unsigned short)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector unsigned short
+vec_srb(__vector unsigned short __a, __vector unsigned char __b) {
+ return (__vector unsigned short)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed int
vec_srb(__vector signed int __a, __vector signed int __b) {
return (__vector signed int)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed int
vec_srb(__vector signed int __a, __vector unsigned int __b) {
return (__vector signed int)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed int
+vec_srb(__vector signed int __a, __vector unsigned char __b) {
+ return (__vector signed int)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_srb(__vector unsigned int __a, __vector signed int __b) {
return (__vector unsigned int)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_srb(__vector unsigned int __a, __vector unsigned int __b) {
return (__vector unsigned int)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector unsigned int
+vec_srb(__vector unsigned int __a, __vector unsigned char __b) {
+ return (__vector unsigned int)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed long long
vec_srb(__vector signed long long __a, __vector signed long long __b) {
return (__vector signed long long)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed long long
vec_srb(__vector signed long long __a, __vector unsigned long long __b) {
return (__vector signed long long)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector signed long long
+vec_srb(__vector signed long long __a, __vector unsigned char __b) {
+ return (__vector signed long long)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
+
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned long long
vec_srb(__vector unsigned long long __a, __vector signed long long __b) {
return (__vector unsigned long long)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned long long
vec_srb(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector unsigned long long)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_srb(__vector unsigned long long __a, __vector unsigned char __b) {
+ return (__vector unsigned long long)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_srb(__vector signed __int128 __a, __vector unsigned char __b) {
+ return (__vector signed __int128)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_srb(__vector unsigned __int128 __a, __vector unsigned char __b) {
+ return (__vector unsigned __int128)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
+
#if __ARCH__ >= 12
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector float
vec_srb(__vector float __a, __vector signed int __b) {
return (__vector float)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector float
vec_srb(__vector float __a, __vector unsigned int __b) {
return (__vector float)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+
+static inline __ATTRS_o_ai __vector float
+vec_srb(__vector float __a, __vector unsigned char __b) {
+ return (__vector float)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
#endif
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector double
vec_srb(__vector double __a, __vector signed long long __b) {
return (__vector double)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector double
vec_srb(__vector double __a, __vector unsigned long long __b) {
return (__vector double)__builtin_s390_vsrlb(
(__vector unsigned char)__a, (__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai __vector double
+vec_srb(__vector double __a, __vector unsigned char __b) {
+ return (__vector double)__builtin_s390_vsrlb(
+ (__vector unsigned char)__a, __b);
+}
+
/*-- vec_srdb ---------------------------------------------------------------*/
#if __ARCH__ >= 13
@@ -7953,6 +9342,15 @@ vec_srdb(__vector unsigned long long __a, __vector unsigned long long __b,
int __c)
__constant_range(__c, 0, 7);
+extern __ATTRS_o __vector signed __int128
+vec_srdb(__vector signed __int128 __a, __vector signed __int128 __b, int __c)
+ __constant_range(__c, 0, 7);
+
+extern __ATTRS_o __vector unsigned __int128
+vec_srdb(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ int __c)
+ __constant_range(__c, 0, 7);
+
extern __ATTRS_o __vector float
vec_srdb(__vector float __a, __vector float __b, int __c)
__constant_range(__c, 0, 7);
@@ -7989,6 +9387,11 @@ vec_abs(__vector signed long long __a) {
return vec_sel(__a, -__a, vec_cmplt(__a, (__vector signed long long)0));
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_abs(__vector signed __int128 __a) {
+ return vec_sel(__a, -__a, vec_cmplt(__a, (__vector signed __int128)0));
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_abs(__vector float __a) {
@@ -8169,6 +9572,16 @@ vec_max(__vector __bool long long __a, __vector unsigned long long __b) {
return vec_sel(__b, __ac, vec_cmpgt(__ac, __b));
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_max(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return vec_sel(__b, __a, vec_cmpgt(__a, __b));
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_max(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return vec_sel(__b, __a, vec_cmpgt(__a, __b));
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_max(__vector float __a, __vector float __b) {
@@ -8339,6 +9752,16 @@ vec_min(__vector __bool long long __a, __vector unsigned long long __b) {
return vec_sel(__ac, __b, vec_cmpgt(__ac, __b));
}
+static inline __ATTRS_o_ai __vector signed __int128
+vec_min(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return vec_sel(__a, __b, vec_cmpgt(__a, __b));
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_min(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return vec_sel(__a, __b, vec_cmpgt(__a, __b));
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_min(__vector float __a, __vector float __b) {
@@ -8357,10 +9780,10 @@ vec_min(__vector double __a, __vector double __b) {
/*-- vec_add_u128 -----------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_ai __vector unsigned char
vec_add_u128(__vector unsigned char __a, __vector unsigned char __b) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
((__int128)__a + (__int128)__b);
}
@@ -8386,33 +9809,59 @@ vec_addc(__vector unsigned long long __a, __vector unsigned long long __b) {
return __builtin_s390_vaccg(__a, __b);
}
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_addc(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vaccq((unsigned __int128)__a, (unsigned __int128)__b);
+}
+
/*-- vec_addc_u128 ----------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_ai __vector unsigned char
vec_addc_u128(__vector unsigned char __a, __vector unsigned char __b) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vaccq((unsigned __int128)__a, (unsigned __int128)__b);
}
+/*-- vec_adde ---------------------------------------------------------------*/
+
+static inline __ATTRS_ai __vector unsigned __int128
+vec_adde(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned __int128 __c) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vacq((unsigned __int128)__a, (unsigned __int128)__b,
+ (unsigned __int128)__c);
+}
+
/*-- vec_adde_u128 ----------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_ai __vector unsigned char
vec_adde_u128(__vector unsigned char __a, __vector unsigned char __b,
__vector unsigned char __c) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vacq((unsigned __int128)__a, (unsigned __int128)__b,
(unsigned __int128)__c);
}
+/*-- vec_addec --------------------------------------------------------------*/
+
+static inline __ATTRS_ai __vector unsigned __int128
+vec_addec(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned __int128 __c) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vacccq((unsigned __int128)__a, (unsigned __int128)__b,
+ (unsigned __int128)__c);
+}
+
/*-- vec_addec_u128 ---------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_ai __vector unsigned char
vec_addec_u128(__vector unsigned char __a, __vector unsigned char __b,
__vector unsigned char __c) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vacccq((unsigned __int128)__a, (unsigned __int128)__b,
(unsigned __int128)__c);
}
@@ -8439,6 +9888,14 @@ vec_avg(__vector signed long long __a, __vector signed long long __b) {
return __builtin_s390_vavgg(__a, __b);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed __int128
+vec_avg(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return (__vector signed __int128)
+ __builtin_s390_vavgq((signed __int128)__a, (signed __int128)__b);
+}
+#endif
+
static inline __ATTRS_o_ai __vector unsigned char
vec_avg(__vector unsigned char __a, __vector unsigned char __b) {
return __builtin_s390_vavglb(__a, __b);
@@ -8459,6 +9916,14 @@ vec_avg(__vector unsigned long long __a, __vector unsigned long long __b) {
return __builtin_s390_vavglg(__a, __b);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_avg(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vavglq((unsigned __int128)__a, (unsigned __int128)__b);
+}
+#endif
+
/*-- vec_checksum -----------------------------------------------------------*/
static inline __ATTRS_ai __vector unsigned int
@@ -8483,13 +9948,18 @@ vec_gfmsum(__vector unsigned int __a, __vector unsigned int __b) {
return __builtin_s390_vgfmf(__a, __b);
}
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_gfmsum(__vector unsigned long long __a, __vector unsigned long long __b) {
+ return (__vector unsigned __int128)__builtin_s390_vgfmg(__a, __b);
+}
+
/*-- vec_gfmsum_128 ---------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_gfmsum_128(__vector unsigned long long __a,
__vector unsigned long long __b) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vgfmg(__a, __b);
}
@@ -8513,14 +9983,21 @@ vec_gfmsum_accum(__vector unsigned int __a, __vector unsigned int __b,
return __builtin_s390_vgfmaf(__a, __b, __c);
}
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_gfmsum_accum(__vector unsigned long long __a, __vector unsigned long long __b,
+ __vector unsigned __int128 __c) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vgfmag(__a, __b, (unsigned __int128)__c);
+}
+
/*-- vec_gfmsum_accum_128 ---------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_gfmsum_accum_128(__vector unsigned long long __a,
__vector unsigned long long __b,
__vector unsigned char __c) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vgfmag(__a, __b, (unsigned __int128)__c);
}
@@ -8598,6 +10075,56 @@ vec_mladd(__vector unsigned int __a, __vector unsigned int __b,
return __a * __b + __c;
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed long long
+vec_mladd(__vector signed long long __a, __vector signed long long __b,
+ __vector signed long long __c) {
+ return __a * __b + __c;
+}
+
+static inline __ATTRS_o_ai __vector signed long long
+vec_mladd(__vector unsigned long long __a, __vector signed long long __b,
+ __vector signed long long __c) {
+ return (__vector signed long long)__a * __b + __c;
+}
+
+static inline __ATTRS_o_ai __vector signed long long
+vec_mladd(__vector signed long long __a, __vector unsigned long long __b,
+ __vector unsigned long long __c) {
+ return __a * (__vector signed long long)__b + (__vector signed long long)__c;
+}
+
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_mladd(__vector unsigned long long __a, __vector unsigned long long __b,
+ __vector unsigned long long __c) {
+ return __a * __b + __c;
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_mladd(__vector signed __int128 __a, __vector signed __int128 __b,
+ __vector signed __int128 __c) {
+ return __a * __b + __c;
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_mladd(__vector unsigned __int128 __a, __vector signed __int128 __b,
+ __vector signed __int128 __c) {
+ return (__vector signed __int128)__a * __b + __c;
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_mladd(__vector signed __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned __int128 __c) {
+ return __a * (__vector signed __int128)__b + (__vector signed __int128)__c;
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_mladd(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned __int128 __c) {
+ return __a * __b + __c;
+}
+#endif
+
/*-- vec_mhadd --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
@@ -8636,6 +10163,34 @@ vec_mhadd(__vector unsigned int __a, __vector unsigned int __b,
return __builtin_s390_vmalhf(__a, __b, __c);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed long long
+vec_mhadd(__vector signed long long __a, __vector signed long long __b,
+ __vector signed long long __c) {
+ return __builtin_s390_vmahg(__a, __b, __c);
+}
+
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_mhadd(__vector unsigned long long __a, __vector unsigned long long __b,
+ __vector unsigned long long __c) {
+ return __builtin_s390_vmalhg(__a, __b, __c);
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_mhadd(__vector signed __int128 __a, __vector signed __int128 __b,
+ __vector signed __int128 __c) {
+ return (__vector signed __int128)
+ __builtin_s390_vmahq((signed __int128)__a, (signed __int128)__b, (signed __int128)__c);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_mhadd(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned __int128 __c) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vmalhq((unsigned __int128)__a, (unsigned __int128)__b, (unsigned __int128)__c);
+}
+#endif
+
/*-- vec_meadd --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed short
@@ -8674,6 +10229,22 @@ vec_meadd(__vector unsigned int __a, __vector unsigned int __b,
return __builtin_s390_vmalef(__a, __b, __c);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed __int128
+vec_meadd(__vector signed long long __a, __vector signed long long __b,
+ __vector signed __int128 __c) {
+ return (__vector signed __int128)
+ __builtin_s390_vmaeg(__a, __b, (signed __int128)__c);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_meadd(__vector unsigned long long __a, __vector unsigned long long __b,
+ __vector unsigned __int128 __c) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vmaleg(__a, __b, (unsigned __int128)__c);
+}
+#endif
+
/*-- vec_moadd --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed short
@@ -8712,6 +10283,22 @@ vec_moadd(__vector unsigned int __a, __vector unsigned int __b,
return __builtin_s390_vmalof(__a, __b, __c);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed __int128
+vec_moadd(__vector signed long long __a, __vector signed long long __b,
+ __vector signed __int128 __c) {
+ return (__vector signed __int128)
+ __builtin_s390_vmaog(__a, __b, (signed __int128)__c);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_moadd(__vector unsigned long long __a, __vector unsigned long long __b,
+ __vector unsigned __int128 __c) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vmalog(__a, __b, (unsigned __int128)__c);
+}
+#endif
+
/*-- vec_mulh ---------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
@@ -8744,6 +10331,30 @@ vec_mulh(__vector unsigned int __a, __vector unsigned int __b) {
return __builtin_s390_vmlhf(__a, __b);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed long long
+vec_mulh(__vector signed long long __a, __vector signed long long __b) {
+ return __builtin_s390_vmhg(__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned long long
+vec_mulh(__vector unsigned long long __a, __vector unsigned long long __b) {
+ return __builtin_s390_vmlhg(__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector signed __int128
+vec_mulh(__vector signed __int128 __a, __vector signed __int128 __b) {
+ return (__vector signed __int128)
+ __builtin_s390_vmhq((signed __int128)__a, (signed __int128)__b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_mulh(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vmlhq((unsigned __int128)__a, (unsigned __int128)__b);
+}
+#endif
+
/*-- vec_mule ---------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed short
@@ -8776,6 +10387,18 @@ vec_mule(__vector unsigned int __a, __vector unsigned int __b) {
return __builtin_s390_vmlef(__a, __b);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed __int128
+vec_mule(__vector signed long long __a, __vector signed long long __b) {
+ return (__vector signed __int128)__builtin_s390_vmeg(__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_mule(__vector unsigned long long __a, __vector unsigned long long __b) {
+ return (__vector unsigned __int128)__builtin_s390_vmleg(__a, __b);
+}
+#endif
+
/*-- vec_mulo ---------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed short
@@ -8808,9 +10431,35 @@ vec_mulo(__vector unsigned int __a, __vector unsigned int __b) {
return __builtin_s390_vmlof(__a, __b);
}
+#if __ARCH__ >= 15
+static inline __ATTRS_o_ai __vector signed __int128
+vec_mulo(__vector signed long long __a, __vector signed long long __b) {
+ return (__vector signed __int128)__builtin_s390_vmog(__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_mulo(__vector unsigned long long __a, __vector unsigned long long __b) {
+ return (__vector unsigned __int128)__builtin_s390_vmlog(__a, __b);
+}
+#endif
+
+/*-- vec_msum ---------------------------------------------------------------*/
+
+#if __ARCH__ >= 12
+extern __ATTRS_o __vector unsigned __int128
+vec_msum(__vector unsigned long long __a, __vector unsigned long long __b,
+ __vector unsigned __int128 __c, int __d)
+ __constant_range(__d, 0, 15);
+
+#define vec_msum(X, Y, Z, W) \
+ ((__typeof__((vec_msum)((X), (Y), (Z), (W)))) \
+ __builtin_s390_vmslg((X), (Y), (unsigned __int128)(Z), (W)))
+#endif
+
/*-- vec_msum_u128 ----------------------------------------------------------*/
#if __ARCH__ >= 12
+// This prototype is deprecated.
extern __ATTRS_o __vector unsigned char
vec_msum_u128(__vector unsigned long long __a, __vector unsigned long long __b,
__vector unsigned char __c, int __d)
@@ -8818,16 +10467,16 @@ vec_msum_u128(__vector unsigned long long __a, __vector unsigned long long __b,
#define vec_msum_u128(X, Y, Z, W) \
((__typeof__((vec_msum_u128)((X), (Y), (Z), (W)))) \
- (unsigned __int128 __attribute__((__vector_size__(16)))) \
+ (__vector unsigned __int128) \
__builtin_s390_vmslg((X), (Y), (unsigned __int128)(Z), (W)))
#endif
/*-- vec_sub_u128 -----------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_ai __vector unsigned char
vec_sub_u128(__vector unsigned char __a, __vector unsigned char __b) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
((__int128)__a - (__int128)__b);
}
@@ -8853,33 +10502,59 @@ vec_subc(__vector unsigned long long __a, __vector unsigned long long __b) {
return __builtin_s390_vscbig(__a, __b);
}
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_subc(__vector unsigned __int128 __a, __vector unsigned __int128 __b) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vscbiq((unsigned __int128)__a, (unsigned __int128)__b);
+}
+
/*-- vec_subc_u128 ----------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_ai __vector unsigned char
vec_subc_u128(__vector unsigned char __a, __vector unsigned char __b) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vscbiq((unsigned __int128)__a, (unsigned __int128)__b);
}
+/*-- vec_sube ---------------------------------------------------------------*/
+
+static inline __ATTRS_ai __vector unsigned __int128
+vec_sube(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned __int128 __c) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vsbiq((unsigned __int128)__a, (unsigned __int128)__b,
+ (unsigned __int128)__c);
+}
+
/*-- vec_sube_u128 ----------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_ai __vector unsigned char
vec_sube_u128(__vector unsigned char __a, __vector unsigned char __b,
__vector unsigned char __c) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vsbiq((unsigned __int128)__a, (unsigned __int128)__b,
(unsigned __int128)__c);
}
+/*-- vec_subec --------------------------------------------------------------*/
+
+static inline __ATTRS_ai __vector unsigned __int128
+vec_subec(__vector unsigned __int128 __a, __vector unsigned __int128 __b,
+ __vector unsigned __int128 __c) {
+ return (__vector unsigned __int128)
+ __builtin_s390_vsbcbiq((unsigned __int128)__a, (unsigned __int128)__b,
+ (unsigned __int128)__c);
+}
+
/*-- vec_subec_u128 ---------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_ai __vector unsigned char
vec_subec_u128(__vector unsigned char __a, __vector unsigned char __b,
__vector unsigned char __c) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vsbcbiq((unsigned __int128)__a, (unsigned __int128)__b,
(unsigned __int128)__c);
}
@@ -8896,19 +10571,31 @@ vec_sum2(__vector unsigned int __a, __vector unsigned int __b) {
return __builtin_s390_vsumgf(__a, __b);
}
+/*-- vec_sum ----------------------------------------------------------------*/
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_sum(__vector unsigned int __a, __vector unsigned int __b) {
+ return (__vector unsigned __int128)__builtin_s390_vsumqf(__a, __b);
+}
+
+static inline __ATTRS_o_ai __vector unsigned __int128
+vec_sum(__vector unsigned long long __a, __vector unsigned long long __b) {
+ return (__vector unsigned __int128)__builtin_s390_vsumqg(__a, __b);
+}
+
/*-- vec_sum_u128 -----------------------------------------------------------*/
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_sum_u128(__vector unsigned int __a, __vector unsigned int __b) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vsumqf(__a, __b);
}
+// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_sum_u128(__vector unsigned long long __a, __vector unsigned long long __b) {
- return (__vector unsigned char)
- (unsigned __int128 __attribute__((__vector_size__(16))))
+ return (__vector unsigned char)(__vector unsigned __int128)
__builtin_s390_vsumqg(__a, __b);
}
@@ -8974,6 +10661,19 @@ vec_test_mask(__vector unsigned long long __a,
(__vector unsigned char)__b);
}
+static inline __ATTRS_o_ai int
+vec_test_mask(__vector signed __int128 __a, __vector unsigned __int128 __b) {
+ return __builtin_s390_vtm((__vector unsigned char)__a,
+ (__vector unsigned char)__b);
+}
+
+static inline __ATTRS_o_ai int
+vec_test_mask(__vector unsigned __int128 __a,
+ __vector unsigned __int128 __b) {
+ return __builtin_s390_vtm((__vector unsigned char)__a,
+ (__vector unsigned char)__b);
+}
+
#if __ARCH__ >= 12
static inline __ATTRS_o_ai int
vec_test_mask(__vector float __a, __vector unsigned int __b) {
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 4764468..95e14ca 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -1201,9 +1201,10 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) {
!S.getLangOpts().ZVector)
S.Diag(TSWRange.getBegin(), diag::err_invalid_vector_long_long_decl_spec);
- // No vector __int128 prior to Power8.
+ // No vector __int128 prior to Power8 (or ZVector).
if ((TypeSpecType == TST_int128) &&
- !S.Context.getTargetInfo().hasFeature("power8-vector"))
+ !S.Context.getTargetInfo().hasFeature("power8-vector") &&
+ !S.getLangOpts().ZVector)
S.Diag(TSTLoc, diag::err_invalid_vector_int128_decl_spec);
// Complex vector types are not supported.
@@ -1225,9 +1226,10 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) {
<< (TypeAltiVecPixel ? "__pixel" :
getSpecifierName((TST)TypeSpecType, Policy));
}
- // vector bool __int128 requires Power10.
+ // vector bool __int128 requires Power10 (or ZVector).
if ((TypeSpecType == TST_int128) &&
- (!S.Context.getTargetInfo().hasFeature("power10-vector")))
+ (!S.Context.getTargetInfo().hasFeature("power10-vector") &&
+ !S.getLangOpts().ZVector))
S.Diag(TSTLoc, diag::err_invalid_vector_bool_int128_decl_spec);
// Only 'short' and 'long long' are valid with vector bool. (PIM 2.1)
diff --git a/clang/lib/Sema/SemaSystemZ.cpp b/clang/lib/Sema/SemaSystemZ.cpp
index 7e836ad..535cb82 100644
--- a/clang/lib/Sema/SemaSystemZ.cpp
+++ b/clang/lib/Sema/SemaSystemZ.cpp
@@ -38,6 +38,7 @@ bool SemaSystemZ::CheckSystemZBuiltinFunctionCall(unsigned BuiltinID,
switch (BuiltinID) {
default: return false;
case SystemZ::BI__builtin_s390_lcbb: i = 1; l = 0; u = 15; break;
+ case SystemZ::BI__builtin_s390_veval:
case SystemZ::BI__builtin_s390_verimb:
case SystemZ::BI__builtin_s390_verimh:
case SystemZ::BI__builtin_s390_verimf: