[PowerPC] Fix parameters for __builtin_crypto_vsbox

The documentation specifies that the input and ouput for the builtin
__builtin_crypto_vsbox should be vector unsigned char.

This patch fixes this type for the builtin.

Reviewed By: amyk

Differential Revision: https://reviews.llvm.org/D135834
This commit is contained in:
Stefan Pintilie 2022-10-14 09:51:06 -05:00
parent a43c0974f0
commit 6897dbc463
3 changed files with 11 additions and 11 deletions

View File

@ -418,7 +418,7 @@ BUILTIN(__builtin_altivec_vbpermq, "V2ULLiV16UcV16Uc", "")
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", "")

View File

@ -17323,8 +17323,8 @@ provided.
#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);
}

View File

@ -60,10 +60,10 @@ vector unsigned long long test_vpmsumd(void)
// 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 @@ vector unsigned long long test_vpmsumd_e(void)
// 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 @@ vector unsigned long long test_vshasigmad_e(void)
}
// 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
}