[llvm] dca432c - [SystemZ] Fix naming of vlrlr/vstrlr builtins
Ulrich Weigand via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 4 07:56:19 PST 2023
Author: Ulrich Weigand
Date: 2023-12-04T16:53:18+01:00
New Revision: dca432cb7b1c282f5dc861095813c4f40f109619
URL: https://github.com/llvm/llvm-project/commit/dca432cb7b1c282f5dc861095813c4f40f109619
DIFF: https://github.com/llvm/llvm-project/commit/dca432cb7b1c282f5dc861095813c4f40f109619.diff
LOG: [SystemZ] Fix naming of vlrlr/vstrlr builtins
The builtins that expand to the vlrl/vlrlr and vstrl/vstrlr
instructions are currently named inconsistently between GCC
and clang. Rename the clang versions to match GCC.
Added:
Modified:
clang/include/clang/Basic/BuiltinsSystemZ.def
clang/lib/Headers/vecintrin.h
clang/test/CodeGen/SystemZ/builtins-systemz-vector2.c
llvm/include/llvm/IR/IntrinsicsSystemZ.td
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/BuiltinsSystemZ.def b/clang/include/clang/Basic/BuiltinsSystemZ.def
index b84cf5b9cec9f..02171d29ffd91 100644
--- a/clang/include/clang/Basic/BuiltinsSystemZ.def
+++ b/clang/include/clang/Basic/BuiltinsSystemZ.def
@@ -253,8 +253,8 @@ TARGET_BUILTIN(__builtin_s390_vfsqdb, "V2dV2d", "nc", "vector")
TARGET_BUILTIN(__builtin_s390_vftcidb, "V2SLLiV2dIii*", "nc", "vector")
// Vector-enhancements facility 1 intrinsics.
-TARGET_BUILTIN(__builtin_s390_vlrl, "V16ScUivC*", "", "vector-enhancements-1")
-TARGET_BUILTIN(__builtin_s390_vstrl, "vV16ScUiv*", "", "vector-enhancements-1")
+TARGET_BUILTIN(__builtin_s390_vlrlr, "V16ScUivC*", "", "vector-enhancements-1")
+TARGET_BUILTIN(__builtin_s390_vstrlr, "vV16ScUiv*", "", "vector-enhancements-1")
TARGET_BUILTIN(__builtin_s390_vbperm, "V2ULLiV16UcV16Uc", "nc", "vector-enhancements-1")
TARGET_BUILTIN(__builtin_s390_vmslg, "V16UcV2ULLiV2ULLiV16UcIi", "nc", "vector-enhancements-1")
TARGET_BUILTIN(__builtin_s390_vfmaxdb, "V2dV2dV2dIi", "nc", "vector-enhancements-1")
diff --git a/clang/lib/Headers/vecintrin.h b/clang/lib/Headers/vecintrin.h
index 0c535225c78e5..0ea411f40218e 100644
--- a/clang/lib/Headers/vecintrin.h
+++ b/clang/lib/Headers/vecintrin.h
@@ -1543,7 +1543,7 @@ vec_load_len(const double *__ptr, unsigned int __len) {
#if __ARCH__ >= 12
static inline __ATTRS_ai __vector unsigned char
vec_load_len_r(const unsigned char *__ptr, unsigned int __len) {
- return (__vector unsigned char)__builtin_s390_vlrl(__len, __ptr);
+ return (__vector unsigned char)__builtin_s390_vlrlr(__len, __ptr);
}
#endif
@@ -1617,7 +1617,7 @@ vec_store_len(__vector double __vec, double *__ptr,
static inline __ATTRS_ai void
vec_store_len_r(__vector unsigned char __vec, unsigned char *__ptr,
unsigned int __len) {
- __builtin_s390_vstrl((__vector signed char)__vec, __len, __ptr);
+ __builtin_s390_vstrlr((__vector signed char)__vec, __len, __ptr);
}
#endif
diff --git a/clang/test/CodeGen/SystemZ/builtins-systemz-vector2.c b/clang/test/CodeGen/SystemZ/builtins-systemz-vector2.c
index 0fcfeeafbfaa6..5e287e28ed201 100644
--- a/clang/test/CodeGen/SystemZ/builtins-systemz-vector2.c
+++ b/clang/test/CodeGen/SystemZ/builtins-systemz-vector2.c
@@ -33,10 +33,10 @@ void test_core(void) {
vul = __builtin_s390_vbperm(vuc, vuc);
// CHECK: call <2 x i64> @llvm.s390.vbperm(<16 x i8> %{{.*}}, <16 x i8> %{{.*}})
- vsc = __builtin_s390_vlrl(len, cptr);
+ vsc = __builtin_s390_vlrlr(len, cptr);
// CHECK: call <16 x i8> @llvm.s390.vlrl(i32 %{{.*}}, ptr %{{.*}})
- __builtin_s390_vstrl(vsc, len, ptr);
+ __builtin_s390_vstrlr(vsc, len, ptr);
// CHECK: call void @llvm.s390.vstrl(<16 x i8> %{{.*}}, i32 %{{.*}}, ptr %{{.*}})
}
diff --git a/llvm/include/llvm/IR/IntrinsicsSystemZ.td b/llvm/include/llvm/IR/IntrinsicsSystemZ.td
index 9f79bdfa9d2d2..a9d80ee5a5c7a 100644
--- a/llvm/include/llvm/IR/IntrinsicsSystemZ.td
+++ b/llvm/include/llvm/IR/IntrinsicsSystemZ.td
@@ -398,11 +398,11 @@ let TargetPrefix = "s390" in {
[IntrNoMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>;
// Instructions from the Vector Packed Decimal Facility
- def int_s390_vlrl : ClangBuiltin<"__builtin_s390_vlrl">,
+ def int_s390_vlrl : ClangBuiltin<"__builtin_s390_vlrlr">,
Intrinsic<[llvm_v16i8_ty], [llvm_i32_ty, llvm_ptr_ty],
[IntrReadMem, IntrArgMemOnly]>;
- def int_s390_vstrl : ClangBuiltin<"__builtin_s390_vstrl">,
+ def int_s390_vstrl : ClangBuiltin<"__builtin_s390_vstrlr">,
Intrinsic<[], [llvm_v16i8_ty, llvm_i32_ty, llvm_ptr_ty],
[IntrArgMemOnly, IntrWriteMem]>;
More information about the llvm-commits
mailing list