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", "")
#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);
}
// 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
}
// 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
}
}
// 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
}