diff --git a/clang/include/clang/Basic/BuiltinsPPC.def b/clang/include/clang/Basic/BuiltinsPPC.def --- a/clang/include/clang/Basic/BuiltinsPPC.def +++ b/clang/include/clang/Basic/BuiltinsPPC.def @@ -418,7 +418,7 @@ BUILTIN(__builtin_altivec_vbpermd, "V2ULLiV2ULLiV16Uc", "") // P8 Crypto built-ins. -BUILTIN(__builtin_altivec_crypto_vsbox, "V2ULLiV2ULLi", "") +BUILTIN(__builtin_altivec_crypto_vsbox, "V16UcV16Uc", "") BUILTIN(__builtin_altivec_crypto_vpermxor, "V16UcV16UcV16UcV16Uc", "") BUILTIN(__builtin_altivec_crypto_vpermxor_be, "V16UcV16UcV16UcV16Uc", "") BUILTIN(__builtin_altivec_crypto_vshasigmaw, "V4UiV4UiIiIi", "") diff --git a/clang/lib/Headers/altivec.h b/clang/lib/Headers/altivec.h --- a/clang/lib/Headers/altivec.h +++ b/clang/lib/Headers/altivec.h @@ -17323,8 +17323,8 @@ #define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast #ifdef __VSX__ -static __inline__ vector unsigned long long __attribute__((__always_inline__)) -__builtin_crypto_vsbox(vector unsigned long long __a) { +static __inline__ vector unsigned char __attribute__((__always_inline__)) +__builtin_crypto_vsbox(vector unsigned char __a) { return __builtin_altivec_crypto_vsbox(__a); } diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-crypto.c b/clang/test/CodeGen/PowerPC/builtins-ppc-crypto.c --- a/clang/test/CodeGen/PowerPC/builtins-ppc-crypto.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-crypto.c @@ -60,10 +60,10 @@ // CHECK: @llvm.ppc.altivec.crypto.vpmsumd } -// CHECK-LABEL: define{{.*}} <2 x i64> @test_vsbox -vector unsigned long long test_vsbox(void) +// CHECK-LABEL: define{{.*}} <16 x i8> @test_vsbox +vector unsigned char test_vsbox(void) { - vector unsigned long long a = D_INIT1 + vector unsigned char a = B_INIT1 return __builtin_altivec_crypto_vsbox(a); // CHECK: @llvm.ppc.altivec.crypto.vsbox } @@ -200,10 +200,10 @@ // CHECK: @llvm.ppc.altivec.crypto.vpmsumd } -// CHECK-LABEL: define{{.*}} <2 x i64> @test_vsbox_e -vector unsigned long long test_vsbox_e(void) +// CHECK-LABEL: define{{.*}} <16 x i8> @test_vsbox_e +vector unsigned char test_vsbox_e(void) { - vector unsigned long long a = D_INIT1 + vector unsigned char a = B_INIT1 return __builtin_crypto_vsbox(a); // CHECK: @llvm.ppc.altivec.crypto.vsbox } @@ -283,9 +283,9 @@ } // CHECK-LABEL: @test_vec_sbox_be -vector unsigned long long test_vec_sbox_be(void) +vector unsigned char test_vec_sbox_be(void) { - vector unsigned long long a = D_INIT1 + vector unsigned char a = B_INIT1 return vec_sbox_be(a); // CHECK: @llvm.ppc.altivec.crypto.vsbox }