From 62bf5840a63fbe0856c47df3f9ed6b8f1202b385 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 20 Nov 2024 17:58:21 +0800 Subject: [PATCH] [LoongArch][Clang] Make the parameters and return value of {x,}vorn.v builti ns `unsigned char` vectors (#114514) All other bitwise vector builtins use `unsigned char` vector operands, so it does not make too much sense to use `signed char` for the orn operation alone. The same change has been also proposed for GCC: https://gcc.gnu.org/pipermail/gcc-patches/2024-October/667065.html. Depends on #114513. --- clang/include/clang/Basic/BuiltinsLoongArchLASX.def | 2 +- clang/include/clang/Basic/BuiltinsLoongArchLSX.def | 2 +- clang/lib/Headers/lasxintrin.h | 2 +- clang/lib/Headers/lsxintrin.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clang/include/clang/Basic/BuiltinsLoongArchLASX.def b/clang/include/clang/Basic/BuiltinsLoongArchLASX.def index f644b820a618..c4ea46a3bc5b 100644 --- a/clang/include/clang/Basic/BuiltinsLoongArchLASX.def +++ b/clang/include/clang/Basic/BuiltinsLoongArchLASX.def @@ -371,7 +371,7 @@ TARGET_BUILTIN(__builtin_lasx_xvor_v, "V32UcV32UcV32Uc", "nc", "lasx") TARGET_BUILTIN(__builtin_lasx_xvxor_v, "V32UcV32UcV32Uc", "nc", "lasx") TARGET_BUILTIN(__builtin_lasx_xvnor_v, "V32UcV32UcV32Uc", "nc", "lasx") TARGET_BUILTIN(__builtin_lasx_xvandn_v, "V32UcV32UcV32Uc", "nc", "lasx") -TARGET_BUILTIN(__builtin_lasx_xvorn_v, "V32ScV32ScV32Sc", "nc", "lasx") +TARGET_BUILTIN(__builtin_lasx_xvorn_v, "V32UcV32UcV32Uc", "nc", "lasx") TARGET_BUILTIN(__builtin_lasx_xvandi_b, "V32UcV32UcIUi", "nc", "lasx") TARGET_BUILTIN(__builtin_lasx_xvori_b, "V32UcV32UcIUi", "nc", "lasx") diff --git a/clang/include/clang/Basic/BuiltinsLoongArchLSX.def b/clang/include/clang/Basic/BuiltinsLoongArchLSX.def index b3056971986d..a823783af88c 100644 --- a/clang/include/clang/Basic/BuiltinsLoongArchLSX.def +++ b/clang/include/clang/Basic/BuiltinsLoongArchLSX.def @@ -355,7 +355,7 @@ TARGET_BUILTIN(__builtin_lsx_vor_v, "V16UcV16UcV16Uc", "nc", "lsx") TARGET_BUILTIN(__builtin_lsx_vxor_v, "V16UcV16UcV16Uc", "nc", "lsx") TARGET_BUILTIN(__builtin_lsx_vnor_v, "V16UcV16UcV16Uc", "nc", "lsx") TARGET_BUILTIN(__builtin_lsx_vandn_v, "V16UcV16UcV16Uc", "nc", "lsx") -TARGET_BUILTIN(__builtin_lsx_vorn_v, "V16ScV16ScV16Sc", "nc", "lsx") +TARGET_BUILTIN(__builtin_lsx_vorn_v, "V16UcV16UcV16Uc", "nc", "lsx") TARGET_BUILTIN(__builtin_lsx_vandi_b, "V16UcV16UcIUi", "nc", "lsx") TARGET_BUILTIN(__builtin_lsx_vori_b, "V16UcV16UcIUi", "nc", "lsx") diff --git a/clang/lib/Headers/lasxintrin.h b/clang/lib/Headers/lasxintrin.h index dafc2a2f3e6a..c065ea92a2dd 100644 --- a/clang/lib/Headers/lasxintrin.h +++ b/clang/lib/Headers/lasxintrin.h @@ -2585,7 +2585,7 @@ extern __inline extern __inline __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m256i __lasx_xvorn_v(__m256i _1, __m256i _2) { - return (__m256i)__builtin_lasx_xvorn_v((v32i8)_1, (v32i8)_2); + return (__m256i)__builtin_lasx_xvorn_v((v32u8)_1, (v32u8)_2); } #define __lasx_xvldi(/*i13*/ _1) ((__m256i)__builtin_lasx_xvldi((_1))) diff --git a/clang/lib/Headers/lsxintrin.h b/clang/lib/Headers/lsxintrin.h index f347955ce6fb..f020b0c18f0d 100644 --- a/clang/lib/Headers/lsxintrin.h +++ b/clang/lib/Headers/lsxintrin.h @@ -3425,7 +3425,7 @@ extern __inline extern __inline __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __m128i __lsx_vorn_v(__m128i _1, __m128i _2) { - return (__m128i)__builtin_lsx_vorn_v((v16i8)_1, (v16i8)_2); + return (__m128i)__builtin_lsx_vorn_v((v16u8)_1, (v16u8)_2); } #define __lsx_vldi(/*i13*/ _1) ((__m128i)__builtin_lsx_vldi((_1))) -- 2.11.4.GIT