2015-03-05 05:48:22 +08:00
|
|
|
// REQUIRES: powerpc-registered-target
|
2017-03-22 06:06:18 +08:00
|
|
|
// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64le-unknown-unknown \
|
2015-03-05 05:48:22 +08:00
|
|
|
// RUN: -target-feature +crypto -target-feature +power8-vector \
|
|
|
|
// RUN: -emit-llvm %s -o - | FileCheck %s
|
|
|
|
|
2017-03-22 06:06:18 +08:00
|
|
|
// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64-unknown-unknown \
|
2015-03-05 05:48:22 +08:00
|
|
|
// RUN: -target-feature +crypto -target-feature +power8-vector \
|
|
|
|
// RUN: -emit-llvm %s -o - | FileCheck %s
|
|
|
|
#include <altivec.h>
|
|
|
|
#define B_INIT1 { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
|
|
|
|
0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 };
|
|
|
|
#define B_INIT2 { 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, \
|
|
|
|
0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x70 };
|
|
|
|
#define H_INIT1 { 0x0102, 0x0304, 0x0506, 0x0708, \
|
|
|
|
0x090A, 0x0B0C, 0x0D0E, 0x0F10 };
|
|
|
|
#define H_INIT2 { 0x7172, 0x7374, 0x7576, 0x7778, \
|
|
|
|
0x797A, 0x7B7C, 0x7D7E, 0x7F70 };
|
|
|
|
#define W_INIT1 { 0x01020304, 0x05060708, \
|
|
|
|
0x090A0B0C, 0x0D0E0F10 };
|
|
|
|
#define W_INIT2 { 0x71727374, 0x75767778, \
|
|
|
|
0x797A7B7C, 0x7D7E7F70 };
|
|
|
|
#define D_INIT1 { 0x0102030405060708, \
|
|
|
|
0x090A0B0C0D0E0F10 };
|
|
|
|
#define D_INIT2 { 0x7172737475767778, \
|
|
|
|
0x797A7B7C7D7E7F70 };
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <16 x i8> @test_vpmsumb
|
|
|
|
vector unsigned char test_vpmsumb(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
vector unsigned char b = B_INIT2
|
|
|
|
return __builtin_altivec_crypto_vpmsumb(a, b);
|
2015-09-01 05:48:52 +08:00
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumb
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <8 x i16> @test_vpmsumh
|
|
|
|
vector unsigned short test_vpmsumh(void)
|
|
|
|
{
|
|
|
|
vector unsigned short a = H_INIT1
|
|
|
|
vector unsigned short b = H_INIT2
|
|
|
|
return __builtin_altivec_crypto_vpmsumh(a, b);
|
2015-09-01 05:48:52 +08:00
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumh
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <4 x i32> @test_vpmsumw
|
|
|
|
vector unsigned int test_vpmsumw(void)
|
|
|
|
{
|
|
|
|
vector unsigned int a = W_INIT1
|
|
|
|
vector unsigned int b = W_INIT2
|
|
|
|
return __builtin_altivec_crypto_vpmsumw(a, b);
|
2015-09-01 05:48:52 +08:00
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumw
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vpmsumd
|
|
|
|
vector unsigned long long test_vpmsumd(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_altivec_crypto_vpmsumd(a, b);
|
2015-09-01 05:48:52 +08:00
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumd
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vsbox
|
|
|
|
vector unsigned long long test_vsbox(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
return __builtin_altivec_crypto_vsbox(a);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vsbox
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <16 x i8> @test_vpermxorb
|
|
|
|
vector unsigned char test_vpermxorb(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
vector unsigned char b = B_INIT2
|
|
|
|
vector unsigned char c = B_INIT2
|
|
|
|
return __builtin_altivec_crypto_vpermxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <8 x i16> @test_vpermxorh
|
|
|
|
vector unsigned short test_vpermxorh(void)
|
|
|
|
{
|
|
|
|
vector unsigned short a = H_INIT1
|
|
|
|
vector unsigned short b = H_INIT2
|
|
|
|
vector unsigned short c = H_INIT2
|
|
|
|
return __builtin_altivec_crypto_vpermxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <4 x i32> @test_vpermxorw
|
|
|
|
vector unsigned int test_vpermxorw(void)
|
|
|
|
{
|
|
|
|
vector unsigned int a = W_INIT1
|
|
|
|
vector unsigned int b = W_INIT2
|
|
|
|
vector unsigned int c = W_INIT2
|
|
|
|
return __builtin_altivec_crypto_vpermxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vpermxord
|
|
|
|
vector unsigned long long test_vpermxord(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
vector unsigned long long c = D_INIT2
|
|
|
|
return __builtin_altivec_crypto_vpermxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
2016-11-12 06:34:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: test_vpermxorbc
|
|
|
|
vector bool char test_vpermxorbc(vector bool char a,
|
|
|
|
vector bool char b,
|
|
|
|
vector bool char c) {
|
|
|
|
return vec_permxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: test_vpermxorsc
|
|
|
|
vector signed char test_vpermxorsc(vector signed char a,
|
|
|
|
vector signed char b,
|
|
|
|
vector signed char c) {
|
|
|
|
return vec_permxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: test_vpermxoruc
|
|
|
|
vector unsigned char test_vpermxoruc(vector unsigned char a,
|
|
|
|
vector unsigned char b,
|
|
|
|
vector unsigned char c) {
|
|
|
|
return vec_permxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vcipher
|
|
|
|
vector unsigned long long test_vcipher(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_altivec_crypto_vcipher(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vcipher
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vcipherlast
|
|
|
|
vector unsigned long long test_vcipherlast(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_altivec_crypto_vcipherlast(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vcipherlast
|
|
|
|
}
|
|
|
|
|
Addition of interfaces the FE to conform to Table A-2 of ELF V2 ABI V1.1
This patch corresponds to review:
http://reviews.llvm.org/D13190
Implemented the following interfaces to conform to ELF V2 ABI version 1.1.
vector signed __int128 vec_adde (vector signed __int128, vector signed __int128, vector signed __int128);
vector unsigned __int128 vec_adde (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);
vector signed __int128 vec_addec (vector signed __int128, vector signed __int128, vector signed __int128);
vector unsigned __int128 vec_addec (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);
vector signed int vec_addc(vector signed int __a, vector signed int __b);
vector bool char vec_cmpge (vector signed char __a, vector signed char __b);
vector bool char vec_cmpge (vector unsigned char __a, vector unsigned char __b);
vector bool short vec_cmpge (vector signed short __a, vector signed short __b);
vector bool short vec_cmpge (vector unsigned short __a, vector unsigned short __b);
vector bool int vec_cmpge (vector signed int __a, vector signed int __b);
vector bool int vec_cmpge (vector unsigned int __a, vector unsigned int __b);
vector bool char vec_cmple (vector signed char __a, vector signed char __b);
vector bool char vec_cmple (vector unsigned char __a, vector unsigned char __b);
vector bool short vec_cmple (vector signed short __a, vector signed short __b);
vector bool short vec_cmple (vector unsigned short __a, vector unsigned short __b);
vector bool int vec_cmple (vector signed int __a, vector signed int __b);
vector bool int vec_cmple (vector unsigned int __a, vector unsigned int __b);
vector double vec_double (vector signed long long __a);
vector double vec_double (vector unsigned long long __a);
vector bool char vec_eqv(vector bool char __a, vector bool char __b);
vector bool short vec_eqv(vector bool short __a, vector bool short __b);
vector bool int vec_eqv(vector bool int __a, vector bool int __b);
vector bool long long vec_eqv(vector bool long long __a, vector bool long long __b);
vector signed short vec_madd(vector signed short __a, vector signed short __b, vector signed short __c);
vector signed short vec_madd(vector signed short __a, vector unsigned short __b, vector unsigned short __c);
vector signed short vec_madd(vector unsigned short __a, vector signed short __b, vector signed short __c);
vector unsigned short vec_madd(vector unsigned short __a, vector unsigned short __b, vector unsigned short __c);
vector bool long long vec_mergeh(vector bool long long __a, vector bool long long __b);
vector bool long long vec_mergel(vector bool long long __a, vector bool long long __b);
vector bool char vec_nand(vector bool char __a, vector bool char __b);
vector bool short vec_nand(vector bool short __a, vector bool short __b);
vector bool int vec_nand(vector bool int __a, vector bool int __b);
vector bool long long vec_nand(vector bool long long __a, vector bool long long __b);
vector bool char vec_orc(vector bool char __a, vector bool char __b);
vector bool short vec_orc(vector bool short __a, vector bool short __b);
vector bool int vec_orc(vector bool int __a, vector bool int __b);
vector bool long long vec_orc(vector bool long long __a, vector bool long long __b);
vector signed long long vec_sub(vector signed long long __a, vector signed long long __b);
vector signed long long vec_sub(vector bool long long __a, vector signed long long __b);
vector signed long long vec_sub(vector signed long long __a, vector bool long long __b);
vector unsigned long long vec_sub(vector unsigned long long __a, vector unsigned long long __b);
vector unsigned long long vec_sub(vector bool long long __a, vector unsigned long long __b);
vector unsigned long long vec_sub(vector unsigned long long __V2 ABI V1.1
http://ror float vec_sub(vector float __a, vector float __b);
unsigned char vec_extract(vector bool char __a, int __b);
signed short vec_extract(vector signed short __a, int __b);
unsigned short vec_extract(vector bool short __a, int __b);
signed int vec_extract(vector signed int __a, int __b);
unsigned int vec_extract(vector bool int __a, int __b);
signed long long vec_extract(vector signed long long __a, int __b);
unsigned long long vec_extract(vector unsigned long long __a, int __b);
unsigned long long vec_extract(vector bool long long __a, int __b);
double vec_extract(vector double __a, int __b);
vector bool char vec_insert(unsigned char __a, vector bool char __b, int __c);
vector signed short vec_insert(signed short __a, vector signed short __b, int __c);
vector bool short vec_insert(unsigned short __a, vector bool short __b, int __c);
vector signed int vec_insert(signed int __a, vector signed int __b, int __c);
vector bool int vec_insert(unsigned int __a, vector bool int __b, int __c);
vector signed long long vec_insert(signed long long __a, vector signed long long __b, int __c);
vector unsigned long long vec_insert(unsigned long long __a, vector unsigned long long __b, int __c);
vector bool long long vec_insert(unsigned long long __a, vector bool long long __b, int __c);
vector double vec_insert(double __a, vector double __b, int __c);
vector signed long long vec_splats(signed long long __a);
vector unsigned long long vec_splats(unsigned long long __a);
vector signed __int128 vec_splats(signed __int128 __a);
vector unsigned __int128 vec_splats(unsigned __int128 __a);
vector double vec_splats(double __a);
int vec_all_eq(vector double __a, vector double __b);
int vec_all_ge(vector double __a, vector double __b);
int vec_all_gt(vector double __a, vector double __b);
int vec_all_le(vector double __a, vector double __b);
int vec_all_lt(vector double __a, vector double __b);
int vec_all_nan(vector double __a);
int vec_all_ne(vector double __a, vector double __b);
int vec_all_nge(vector double __a, vector double __b);
int vec_all_ngt(vector double __a, vector double __b);
int vec_any_eq(vector double __a, vector double __b);
int vec_any_ge(vector double __a, vector double __b);
int vec_any_gt(vector double __a, vector double __b);
int vec_any_le(vector double __a, vector double __b);
int vec_any_lt(vector double __a, vector double __b);
int vec_any_ne(vector double __a, vector double __b);
vector unsigned char vec_sbox_be (vector unsigned char);
vector unsigned char vec_cipher_be (vector unsigned char, vector unsigned char);
vector unsigned char vec_cipherlast_be (vector unsigned char, vector unsigned char);
vector unsigned char vec_ncipher_be (vector unsigned char, vector unsigned char);
vector unsigned char vec_ncipherlast_be (vector unsigned char, vector unsigned char);
vector unsigned int vec_shasigma_be (vector unsigned int, const int, const int);
vector unsigned long long vec_shasigma_be (vector unsigned long long, const int, const int);
vector unsigned short vec_pmsum_be (vector unsigned char, vector unsigned char);
vector unsigned int vec_pmsum_be (vector unsigned short, vector unsigned short);
vector unsigned long long vec_pmsum_be (vector unsigned int, vector unsigned int);
vector unsigned __int128 vec_pmsum_be (vector unsigned long long, vector unsigned long long);
vector unsigned char vec_gb (vector unsigned char);
vector unsigned long long vec_bperm (vector unsigned __int128 __a, vector unsigned char __b);
Removed the folowing interfaces either because their signatures have changed
in version 1.1 of the ABI or because they were implemented for ELF V2 ABI but
have actually been deprecated in version 1.1.
vector signed char vec_eqv(vector bool char __a, vector signed char __b);
vector signed char vec_eqv(vector signed char __a, vector bool char __b);
vector unsigned char vec_eqv(vector bool char __a, vector unsigned char __b);
vector unsigned char vec_eqv(vector unsigned char __a, vector bool char __b);
vector signed short vec_eqv(vector bool short __a, vector signed short __b);
vector signed short vec_eqv(vector signed short __a, vector bool short __b);
vector unsigned short vec_eqv(vector bool short __a, vector unsigned short __b);
vector unsigned short vec_eqv(vector unsigned short __a, vector bool short __b);
vector signed int vec_eqv(vector bool int __a, vector signed int __b);
vector signed int vec_eqv(vector signed int __a, vector bool int __b);
vector unsigned int vec_eqv(vector bool int __a, vector unsigned int __b);
vector unsigned int vec_eqv(vector unsigned int __a, vector bool int __b);
vector signed long long vec_eqv(vector bool long long __a, vector signed long long __b);
vector signed long long vec_eqv(vector signed long long __a, vector bool long long __b);
vector unsigned long long vec_eqv(vector bool long long __a, vector unsigned long long __b);
vector unsigned long long vec_eqv(vector unsigned long long __a, vector bool long long __b);
vector float vec_eqv(vector bool int __a, vector float __b);
vector float vec_eqv(vector float __a, vector bool int __b);
vector double vec_eqv(vector bool long long __a, vector double __b);
vector double vec_eqv(vector double __a, vector bool long long __b);
vector unsigned short vec_nand(vector bool short __a, vector unsigned short __b);
llvm-svn: 248813
2015-09-30 02:13:34 +08:00
|
|
|
// CHECK-LABEL: @test_vncipher
|
2015-03-05 05:48:22 +08:00
|
|
|
vector unsigned long long test_vncipher(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_altivec_crypto_vncipher(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vncipher
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vncipherlast
|
|
|
|
vector unsigned long long test_vncipherlast(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_altivec_crypto_vncipherlast(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vncipherlast
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <4 x i32> @test_vshasigmaw
|
|
|
|
vector unsigned int test_vshasigmaw(void)
|
|
|
|
{
|
|
|
|
vector unsigned int a = W_INIT1
|
|
|
|
return __builtin_altivec_crypto_vshasigmaw(a, 1, 15);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vshasigmaw
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vshasigmad
|
|
|
|
vector unsigned long long test_vshasigmad(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT2
|
|
|
|
return __builtin_altivec_crypto_vshasigmad(a, 1, 15);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vshasigmad
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test cases for the builtins the way they are exposed to
|
|
|
|
// users through altivec.h
|
|
|
|
// CHECK-LABEL: define <16 x i8> @test_vpmsumb_e
|
|
|
|
vector unsigned char test_vpmsumb_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
vector unsigned char b = B_INIT2
|
|
|
|
return __builtin_crypto_vpmsumb(a, b);
|
2015-09-01 05:48:52 +08:00
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumb
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <8 x i16> @test_vpmsumh_e
|
|
|
|
vector unsigned short test_vpmsumh_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned short a = H_INIT1
|
|
|
|
vector unsigned short b = H_INIT2
|
|
|
|
return __builtin_crypto_vpmsumb(a, b);
|
2015-09-01 05:48:52 +08:00
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumh
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <4 x i32> @test_vpmsumw_e
|
|
|
|
vector unsigned int test_vpmsumw_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned int a = W_INIT1
|
|
|
|
vector unsigned int b = W_INIT2
|
|
|
|
return __builtin_crypto_vpmsumb(a, b);
|
2015-09-01 05:48:52 +08:00
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumw
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vpmsumd_e
|
|
|
|
vector unsigned long long test_vpmsumd_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_crypto_vpmsumb(a, b);
|
2015-09-01 05:48:52 +08:00
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumd
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vsbox_e
|
|
|
|
vector unsigned long long test_vsbox_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
return __builtin_crypto_vsbox(a);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vsbox
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <16 x i8> @test_vpermxorb_e
|
|
|
|
vector unsigned char test_vpermxorb_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
vector unsigned char b = B_INIT2
|
|
|
|
vector unsigned char c = B_INIT2
|
|
|
|
return __builtin_crypto_vpermxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <8 x i16> @test_vpermxorh_e
|
|
|
|
vector unsigned short test_vpermxorh_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned short a = H_INIT1
|
|
|
|
vector unsigned short b = H_INIT2
|
|
|
|
vector unsigned short c = H_INIT2
|
|
|
|
return __builtin_crypto_vpermxor(a, b, c);
|
2015-09-01 05:48:52 +08:00
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
2015-03-05 05:48:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <4 x i32> @test_vpermxorw_e
|
|
|
|
vector unsigned int test_vpermxorw_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned int a = W_INIT1
|
|
|
|
vector unsigned int b = W_INIT2
|
|
|
|
vector unsigned int c = W_INIT2
|
|
|
|
return __builtin_crypto_vpermxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vpermxord_e
|
|
|
|
vector unsigned long long test_vpermxord_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
vector unsigned long long c = D_INIT2
|
|
|
|
return __builtin_crypto_vpermxor(a, b, c);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpermxor
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vcipher_e
|
|
|
|
vector unsigned long long test_vcipher_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_crypto_vcipher(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vcipher
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vcipherlast_e
|
|
|
|
vector unsigned long long test_vcipherlast_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_crypto_vcipherlast(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vcipherlast
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vncipher_e
|
|
|
|
vector unsigned long long test_vncipher_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_crypto_vncipher(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vncipher
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vncipherlast_e
|
|
|
|
vector unsigned long long test_vncipherlast_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return __builtin_crypto_vncipherlast(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vncipherlast
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <4 x i32> @test_vshasigmaw_e
|
|
|
|
vector unsigned int test_vshasigmaw_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned int a = W_INIT1
|
|
|
|
return __builtin_crypto_vshasigmaw(a, 1, 15);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vshasigmaw
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: define <2 x i64> @test_vshasigmad_e
|
|
|
|
vector unsigned long long test_vshasigmad_e(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT2
|
|
|
|
return __builtin_crypto_vshasigmad(a, 0, 15);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vshasigmad
|
|
|
|
}
|
|
|
|
|
Addition of interfaces the FE to conform to Table A-2 of ELF V2 ABI V1.1
This patch corresponds to review:
http://reviews.llvm.org/D13190
Implemented the following interfaces to conform to ELF V2 ABI version 1.1.
vector signed __int128 vec_adde (vector signed __int128, vector signed __int128, vector signed __int128);
vector unsigned __int128 vec_adde (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);
vector signed __int128 vec_addec (vector signed __int128, vector signed __int128, vector signed __int128);
vector unsigned __int128 vec_addec (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128);
vector signed int vec_addc(vector signed int __a, vector signed int __b);
vector bool char vec_cmpge (vector signed char __a, vector signed char __b);
vector bool char vec_cmpge (vector unsigned char __a, vector unsigned char __b);
vector bool short vec_cmpge (vector signed short __a, vector signed short __b);
vector bool short vec_cmpge (vector unsigned short __a, vector unsigned short __b);
vector bool int vec_cmpge (vector signed int __a, vector signed int __b);
vector bool int vec_cmpge (vector unsigned int __a, vector unsigned int __b);
vector bool char vec_cmple (vector signed char __a, vector signed char __b);
vector bool char vec_cmple (vector unsigned char __a, vector unsigned char __b);
vector bool short vec_cmple (vector signed short __a, vector signed short __b);
vector bool short vec_cmple (vector unsigned short __a, vector unsigned short __b);
vector bool int vec_cmple (vector signed int __a, vector signed int __b);
vector bool int vec_cmple (vector unsigned int __a, vector unsigned int __b);
vector double vec_double (vector signed long long __a);
vector double vec_double (vector unsigned long long __a);
vector bool char vec_eqv(vector bool char __a, vector bool char __b);
vector bool short vec_eqv(vector bool short __a, vector bool short __b);
vector bool int vec_eqv(vector bool int __a, vector bool int __b);
vector bool long long vec_eqv(vector bool long long __a, vector bool long long __b);
vector signed short vec_madd(vector signed short __a, vector signed short __b, vector signed short __c);
vector signed short vec_madd(vector signed short __a, vector unsigned short __b, vector unsigned short __c);
vector signed short vec_madd(vector unsigned short __a, vector signed short __b, vector signed short __c);
vector unsigned short vec_madd(vector unsigned short __a, vector unsigned short __b, vector unsigned short __c);
vector bool long long vec_mergeh(vector bool long long __a, vector bool long long __b);
vector bool long long vec_mergel(vector bool long long __a, vector bool long long __b);
vector bool char vec_nand(vector bool char __a, vector bool char __b);
vector bool short vec_nand(vector bool short __a, vector bool short __b);
vector bool int vec_nand(vector bool int __a, vector bool int __b);
vector bool long long vec_nand(vector bool long long __a, vector bool long long __b);
vector bool char vec_orc(vector bool char __a, vector bool char __b);
vector bool short vec_orc(vector bool short __a, vector bool short __b);
vector bool int vec_orc(vector bool int __a, vector bool int __b);
vector bool long long vec_orc(vector bool long long __a, vector bool long long __b);
vector signed long long vec_sub(vector signed long long __a, vector signed long long __b);
vector signed long long vec_sub(vector bool long long __a, vector signed long long __b);
vector signed long long vec_sub(vector signed long long __a, vector bool long long __b);
vector unsigned long long vec_sub(vector unsigned long long __a, vector unsigned long long __b);
vector unsigned long long vec_sub(vector bool long long __a, vector unsigned long long __b);
vector unsigned long long vec_sub(vector unsigned long long __V2 ABI V1.1
http://ror float vec_sub(vector float __a, vector float __b);
unsigned char vec_extract(vector bool char __a, int __b);
signed short vec_extract(vector signed short __a, int __b);
unsigned short vec_extract(vector bool short __a, int __b);
signed int vec_extract(vector signed int __a, int __b);
unsigned int vec_extract(vector bool int __a, int __b);
signed long long vec_extract(vector signed long long __a, int __b);
unsigned long long vec_extract(vector unsigned long long __a, int __b);
unsigned long long vec_extract(vector bool long long __a, int __b);
double vec_extract(vector double __a, int __b);
vector bool char vec_insert(unsigned char __a, vector bool char __b, int __c);
vector signed short vec_insert(signed short __a, vector signed short __b, int __c);
vector bool short vec_insert(unsigned short __a, vector bool short __b, int __c);
vector signed int vec_insert(signed int __a, vector signed int __b, int __c);
vector bool int vec_insert(unsigned int __a, vector bool int __b, int __c);
vector signed long long vec_insert(signed long long __a, vector signed long long __b, int __c);
vector unsigned long long vec_insert(unsigned long long __a, vector unsigned long long __b, int __c);
vector bool long long vec_insert(unsigned long long __a, vector bool long long __b, int __c);
vector double vec_insert(double __a, vector double __b, int __c);
vector signed long long vec_splats(signed long long __a);
vector unsigned long long vec_splats(unsigned long long __a);
vector signed __int128 vec_splats(signed __int128 __a);
vector unsigned __int128 vec_splats(unsigned __int128 __a);
vector double vec_splats(double __a);
int vec_all_eq(vector double __a, vector double __b);
int vec_all_ge(vector double __a, vector double __b);
int vec_all_gt(vector double __a, vector double __b);
int vec_all_le(vector double __a, vector double __b);
int vec_all_lt(vector double __a, vector double __b);
int vec_all_nan(vector double __a);
int vec_all_ne(vector double __a, vector double __b);
int vec_all_nge(vector double __a, vector double __b);
int vec_all_ngt(vector double __a, vector double __b);
int vec_any_eq(vector double __a, vector double __b);
int vec_any_ge(vector double __a, vector double __b);
int vec_any_gt(vector double __a, vector double __b);
int vec_any_le(vector double __a, vector double __b);
int vec_any_lt(vector double __a, vector double __b);
int vec_any_ne(vector double __a, vector double __b);
vector unsigned char vec_sbox_be (vector unsigned char);
vector unsigned char vec_cipher_be (vector unsigned char, vector unsigned char);
vector unsigned char vec_cipherlast_be (vector unsigned char, vector unsigned char);
vector unsigned char vec_ncipher_be (vector unsigned char, vector unsigned char);
vector unsigned char vec_ncipherlast_be (vector unsigned char, vector unsigned char);
vector unsigned int vec_shasigma_be (vector unsigned int, const int, const int);
vector unsigned long long vec_shasigma_be (vector unsigned long long, const int, const int);
vector unsigned short vec_pmsum_be (vector unsigned char, vector unsigned char);
vector unsigned int vec_pmsum_be (vector unsigned short, vector unsigned short);
vector unsigned long long vec_pmsum_be (vector unsigned int, vector unsigned int);
vector unsigned __int128 vec_pmsum_be (vector unsigned long long, vector unsigned long long);
vector unsigned char vec_gb (vector unsigned char);
vector unsigned long long vec_bperm (vector unsigned __int128 __a, vector unsigned char __b);
Removed the folowing interfaces either because their signatures have changed
in version 1.1 of the ABI or because they were implemented for ELF V2 ABI but
have actually been deprecated in version 1.1.
vector signed char vec_eqv(vector bool char __a, vector signed char __b);
vector signed char vec_eqv(vector signed char __a, vector bool char __b);
vector unsigned char vec_eqv(vector bool char __a, vector unsigned char __b);
vector unsigned char vec_eqv(vector unsigned char __a, vector bool char __b);
vector signed short vec_eqv(vector bool short __a, vector signed short __b);
vector signed short vec_eqv(vector signed short __a, vector bool short __b);
vector unsigned short vec_eqv(vector bool short __a, vector unsigned short __b);
vector unsigned short vec_eqv(vector unsigned short __a, vector bool short __b);
vector signed int vec_eqv(vector bool int __a, vector signed int __b);
vector signed int vec_eqv(vector signed int __a, vector bool int __b);
vector unsigned int vec_eqv(vector bool int __a, vector unsigned int __b);
vector unsigned int vec_eqv(vector unsigned int __a, vector bool int __b);
vector signed long long vec_eqv(vector bool long long __a, vector signed long long __b);
vector signed long long vec_eqv(vector signed long long __a, vector bool long long __b);
vector unsigned long long vec_eqv(vector bool long long __a, vector unsigned long long __b);
vector unsigned long long vec_eqv(vector unsigned long long __a, vector bool long long __b);
vector float vec_eqv(vector bool int __a, vector float __b);
vector float vec_eqv(vector float __a, vector bool int __b);
vector double vec_eqv(vector bool long long __a, vector double __b);
vector double vec_eqv(vector double __a, vector bool long long __b);
vector unsigned short vec_nand(vector bool short __a, vector unsigned short __b);
llvm-svn: 248813
2015-09-30 02:13:34 +08:00
|
|
|
// CHECK-LABEL: @test_vec_sbox_be
|
|
|
|
vector unsigned char test_vec_sbox_be(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
return vec_sbox_be(a);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vsbox
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_cipher_be
|
|
|
|
vector unsigned char test_vec_cipher_be(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
vector unsigned char b = B_INIT2
|
|
|
|
return vec_cipher_be(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vcipher
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_cipherlast_be
|
|
|
|
vector unsigned char test_vec_cipherlast_be(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
vector unsigned char b = B_INIT2
|
|
|
|
return vec_cipherlast_be(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vcipherlast
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_ncipher_be
|
|
|
|
vector unsigned char test_vec_ncipher_be(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
vector unsigned char b = B_INIT2
|
|
|
|
return vec_ncipher_be(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vncipher
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_ncipherlast_be
|
|
|
|
vector unsigned char test_vec_ncipherlast_be(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
vector unsigned char b = B_INIT2
|
|
|
|
return vec_ncipherlast_be(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vncipherlast
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_shasigma_bew
|
|
|
|
vector unsigned int test_vec_shasigma_bew(void)
|
|
|
|
{
|
|
|
|
vector unsigned int a = W_INIT1
|
|
|
|
return vec_shasigma_be(a, 1, 15);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vshasigmaw
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_shasigma_bed
|
|
|
|
vector unsigned long long test_vec_shasigma_bed(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT2
|
|
|
|
return vec_shasigma_be(a, 1, 15);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vshasigmad
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_pmsum_beb
|
|
|
|
vector unsigned short test_vec_pmsum_beb(void)
|
|
|
|
{
|
|
|
|
vector unsigned char a = B_INIT1
|
|
|
|
vector unsigned char b = B_INIT2
|
|
|
|
return vec_pmsum_be(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumb
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_pmsum_beh
|
|
|
|
vector unsigned int test_vec_pmsum_beh(void)
|
|
|
|
{
|
|
|
|
vector unsigned short a = H_INIT1
|
|
|
|
vector unsigned short b = H_INIT2
|
|
|
|
return vec_pmsum_be(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumh
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_pmsum_bew
|
|
|
|
vector unsigned long long test_vec_pmsum_bew(void)
|
|
|
|
{
|
|
|
|
vector unsigned int a = W_INIT1
|
|
|
|
vector unsigned int b = W_INIT2
|
|
|
|
return vec_pmsum_be(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumw
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK-LABEL: @test_vec_pmsum_bed
|
|
|
|
vector unsigned __int128 test_vec_pmsum_bed(void)
|
|
|
|
{
|
|
|
|
vector unsigned long long a = D_INIT1
|
|
|
|
vector unsigned long long b = D_INIT2
|
|
|
|
return vec_pmsum_be(a, b);
|
|
|
|
// CHECK: @llvm.ppc.altivec.crypto.vpmsumd
|
|
|
|
}
|
|
|
|
|