1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon \
3 // RUN:  -target-feature +sha3 -S -emit-llvm -o - %s \
4 // RUN:  | FileCheck %s
5 
6 #include <arm_neon.h>
7 
8 // CHECK-LABEL: @test_vsha512h(
9 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.sha512h
10 //
test_vsha512h(uint64x2_t hash_ed,uint64x2_t hash_gf,uint64x2_t kwh_kwh2)11 void test_vsha512h(uint64x2_t hash_ed, uint64x2_t hash_gf, uint64x2_t kwh_kwh2) {
12   uint64x2_t result = vsha512hq_u64(hash_ed, hash_gf, kwh_kwh2);
13 }
14 
15 // CHECK-LABEL: @test_vsha512h2(
16 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.sha512h2
17 //
test_vsha512h2(uint64x2_t sum_ab,uint64x2_t hash_c_,uint64x2_t hash_ab)18 void test_vsha512h2(uint64x2_t sum_ab, uint64x2_t hash_c_, uint64x2_t hash_ab) {
19   uint64x2_t result = vsha512h2q_u64(sum_ab, hash_c_, hash_ab);
20 }
21 
22 // CHECK-LABEL: @test_vsha512su0(
23 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.sha512su0
24 //
test_vsha512su0(uint64x2_t w0_1,uint64x2_t w2_)25 void test_vsha512su0(uint64x2_t w0_1, uint64x2_t w2_) {
26   uint64x2_t result = vsha512su0q_u64(w0_1, w2_);
27 }
28 
29 // CHECK-LABEL: @test_vsha512su1(
30 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.sha512su1
31 //
test_vsha512su1(uint64x2_t s01_s02,uint64x2_t w14_15,uint64x2_t w9_10)32 void test_vsha512su1(uint64x2_t s01_s02, uint64x2_t w14_15, uint64x2_t w9_10) {
33   uint64x2_t result = vsha512su1q_u64(s01_s02, w14_15, w9_10);
34 }
35 
36 // CHECK-LABEL: @test_vrax1(
37 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.rax1
38 //
test_vrax1(uint64x2_t a,uint64x2_t b)39 void test_vrax1(uint64x2_t a, uint64x2_t b) {
40   uint64x2_t result = vrax1q_u64(a, b);
41 }
42 
43 
44 // CHECK-LABEL: @test_xar(
45 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.xar
46 //
test_xar(uint64x2_t a,uint64x2_t b)47 void test_xar(uint64x2_t a, uint64x2_t b) {
48   uint64x2_t result = vxarq_u64(a, b, 10);
49 }
50 
51 
52 // CHECK-LABEL: @test_vbcax_u8(
53 // CHECK:    call <16 x i8> @llvm.aarch64.crypto.bcaxu.v16i8
54 //
test_vbcax_u8(uint8x16_t a,uint8x16_t b,uint8x16_t c)55 void test_vbcax_u8(uint8x16_t a, uint8x16_t b, uint8x16_t c) {
56   uint8x16_t result = vbcaxq_u8(a, b, c);
57 }
58 
59 // CHECK-LABEL: @test_vbcax_u16(
60 // CHECK:    call <8 x i16> @llvm.aarch64.crypto.bcaxu.v8i16
61 //
test_vbcax_u16(uint16x8_t a,uint16x8_t b,uint16x8_t c)62 void test_vbcax_u16(uint16x8_t a, uint16x8_t b, uint16x8_t c) {
63   uint16x8_t result = vbcaxq_u16(a, b, c);
64 }
65 
66 // CHECK-LABEL: @test_vbcax_u32(
67 // CHECK:    call <4 x i32> @llvm.aarch64.crypto.bcaxu.v4i32
68 //
test_vbcax_u32(uint32x4_t a,uint32x4_t b,uint32x4_t c)69 void test_vbcax_u32(uint32x4_t a, uint32x4_t b, uint32x4_t c) {
70   uint32x4_t result = vbcaxq_u32(a, b, c);
71 }
72 
73 // CHECK-LABEL: @test_vbcax_u64(
74 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.bcaxu.v2i64
75 //
test_vbcax_u64(uint64x2_t a,uint64x2_t b,uint64x2_t c)76 void test_vbcax_u64(uint64x2_t a, uint64x2_t b, uint64x2_t c) {
77   uint64x2_t result = vbcaxq_u64(a, b, c);
78 }
79 
80 // CHECK-LABEL: @test_vbcax_s8(
81 // CHECK:    call <16 x i8> @llvm.aarch64.crypto.bcaxs.v16i8
82 //
test_vbcax_s8(int8x16_t a,int8x16_t b,int8x16_t c)83 void test_vbcax_s8(int8x16_t a, int8x16_t b, int8x16_t c) {
84   int8x16_t result = vbcaxq_s8(a, b, c);
85 }
86 
87 // CHECK-LABEL: @test_vbcax_s16(
88 // CHECK:    call <8 x i16> @llvm.aarch64.crypto.bcaxs.v8i16
89 //
test_vbcax_s16(int16x8_t a,int16x8_t b,int16x8_t c)90 void test_vbcax_s16(int16x8_t a, int16x8_t b, int16x8_t c) {
91   int16x8_t result = vbcaxq_s16(a, b, c);
92 }
93 
94 // CHECK-LABEL: @test_vbcax_s32(
95 // CHECK:    call <4 x i32> @llvm.aarch64.crypto.bcaxs.v4i32
96 //
test_vbcax_s32(int32x4_t a,int32x4_t b,int32x4_t c)97 void test_vbcax_s32(int32x4_t a, int32x4_t b, int32x4_t c) {
98   int32x4_t result = vbcaxq_s32(a, b, c);
99 }
100 
101 // CHECK-LABEL: @test_vbcax_s64(
102 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.bcaxs.v2i64
103 //
test_vbcax_s64(int64x2_t a,int64x2_t b,int64x2_t c)104 void test_vbcax_s64(int64x2_t a, int64x2_t b, int64x2_t c) {
105   int64x2_t result = vbcaxq_s64(a, b, c);
106 }
107 
108 // CHECK-LABEL: @test_veor3_u8(
109 // CHECK:    call <16 x i8> @llvm.aarch64.crypto.eor3u.v16i8
110 //
test_veor3_u8(uint8x16_t a,uint8x16_t b,uint8x16_t c)111 void test_veor3_u8(uint8x16_t a, uint8x16_t b, uint8x16_t c) {
112   uint8x16_t result = veor3q_u8(a, b, c);
113 }
114 
115 // CHECK-LABEL: @test_veor3_u16(
116 // CHECK:    call <8 x i16> @llvm.aarch64.crypto.eor3u.v8i16
117 //
test_veor3_u16(uint16x8_t a,uint16x8_t b,uint16x8_t c)118 void test_veor3_u16(uint16x8_t a, uint16x8_t b, uint16x8_t c) {
119   uint16x8_t result = veor3q_u16(a, b, c);
120 }
121 
122 // CHECK-LABEL: @test_veor3_u32(
123 // CHECK:    call <4 x i32> @llvm.aarch64.crypto.eor3u.v4i32
124 //
test_veor3_u32(uint32x4_t a,uint32x4_t b,uint32x4_t c)125 void test_veor3_u32(uint32x4_t a, uint32x4_t b, uint32x4_t c) {
126   uint32x4_t result = veor3q_u32(a, b, c);
127 }
128 
129 // CHECK-LABEL: @test_veor3_u64(
130 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.eor3u.v2i64
131 //
test_veor3_u64(uint64x2_t a,uint64x2_t b,uint64x2_t c)132 void test_veor3_u64(uint64x2_t a, uint64x2_t b, uint64x2_t c) {
133   uint64x2_t result = veor3q_u64(a, b, c);
134 }
135 
136 // CHECK-LABEL: @test_veor3_s8(
137 // CHECK:    call <16 x i8> @llvm.aarch64.crypto.eor3s.v16i8
138 //
test_veor3_s8(int8x16_t a,int8x16_t b,int8x16_t c)139 void test_veor3_s8(int8x16_t a, int8x16_t b, int8x16_t c) {
140   int8x16_t result = veor3q_s8(a, b, c);
141 }
142 
143 // CHECK-LABEL: @test_veor3_s16(
144 // CHECK:     call <8 x i16> @llvm.aarch64.crypto.eor3s.v8i16
145 //
test_veor3_s16(int16x8_t a,int16x8_t b,int16x8_t c)146 void test_veor3_s16(int16x8_t a, int16x8_t b, int16x8_t c) {
147   int16x8_t result = veor3q_s16(a, b, c);
148 }
149 
150 // CHECK-LABEL: @test_veor3_s32(
151 // CHECK:    call <4 x i32> @llvm.aarch64.crypto.eor3s.v4i32
152 //
test_veor3_s32(int32x4_t a,int32x4_t b,int32x4_t c)153 void test_veor3_s32(int32x4_t a, int32x4_t b, int32x4_t c) {
154   int32x4_t result = veor3q_s32(a, b, c);
155 }
156 
157 // CHECK-LABEL: @test_veor3_s64(
158 // CHECK:    call <2 x i64> @llvm.aarch64.crypto.eor3s.v2i64
159 //
test_veor3_s64(int64x2_t a,int64x2_t b,int64x2_t c)160 void test_veor3_s64(int64x2_t a, int64x2_t b, int64x2_t c) {
161   int64x2_t result = veor3q_s64(a, b, c);
162 }
163