annotate clang/test/CodeGen/neon-crypto.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple arm-none-linux-gnueabi -target-feature +neon \
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
2 // RUN: -target-feature +sha2 -target-feature +aes \
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
3 // RUN: -target-cpu cortex-a57 -emit-llvm -O1 -o - %s | FileCheck %s
150
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
6 // RUN: -target-feature +sha2 -target-feature +aes \
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 // RUN: -emit-llvm -O1 -o - %s | FileCheck %s
150
anatofuz
parents:
diff changeset
8 // RUN: not %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
anatofuz
parents:
diff changeset
9 // RUN: -S -O3 -o - %s 2>&1 | FileCheck --check-prefix=CHECK-NO-CRYPTO %s
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 // Test new aarch64 intrinsics and types
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 #include <arm_neon.h>
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 uint8x16_t test_vaeseq_u8(uint8x16_t data, uint8x16_t key) {
anatofuz
parents:
diff changeset
16 // CHECK-LABEL: @test_vaeseq_u8
anatofuz
parents:
diff changeset
17 // CHECK-NO-CRYPTO: warning: implicit declaration of function 'vaeseq_u8' is invalid in C99
anatofuz
parents:
diff changeset
18 return vaeseq_u8(data, key);
anatofuz
parents:
diff changeset
19 // CHECK: call <16 x i8> @llvm.{{arm.neon|aarch64.crypto}}.aese(<16 x i8> %data, <16 x i8> %key)
anatofuz
parents:
diff changeset
20 }
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 uint8x16_t test_vaesdq_u8(uint8x16_t data, uint8x16_t key) {
anatofuz
parents:
diff changeset
23 // CHECK-LABEL: @test_vaesdq_u8
anatofuz
parents:
diff changeset
24 return vaesdq_u8(data, key);
anatofuz
parents:
diff changeset
25 // CHECK: call <16 x i8> @llvm.{{arm.neon|aarch64.crypto}}.aesd(<16 x i8> %data, <16 x i8> %key)
anatofuz
parents:
diff changeset
26 }
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 uint8x16_t test_vaesmcq_u8(uint8x16_t data) {
anatofuz
parents:
diff changeset
29 // CHECK-LABEL: @test_vaesmcq_u8
anatofuz
parents:
diff changeset
30 return vaesmcq_u8(data);
anatofuz
parents:
diff changeset
31 // CHECK: call <16 x i8> @llvm.{{arm.neon|aarch64.crypto}}.aesmc(<16 x i8> %data)
anatofuz
parents:
diff changeset
32 }
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 uint8x16_t test_vaesimcq_u8(uint8x16_t data) {
anatofuz
parents:
diff changeset
35 // CHECK-LABEL: @test_vaesimcq_u8
anatofuz
parents:
diff changeset
36 return vaesimcq_u8(data);
anatofuz
parents:
diff changeset
37 // CHECK: call <16 x i8> @llvm.{{arm.neon|aarch64.crypto}}.aesimc(<16 x i8> %data)
anatofuz
parents:
diff changeset
38 }
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 uint32_t test_vsha1h_u32(uint32_t hash_e) {
anatofuz
parents:
diff changeset
41 // CHECK-LABEL: @test_vsha1h_u32
anatofuz
parents:
diff changeset
42 return vsha1h_u32(hash_e);
anatofuz
parents:
diff changeset
43 // CHECK: call i32 @llvm.{{arm.neon|aarch64.crypto}}.sha1h(i32 %hash_e)
anatofuz
parents:
diff changeset
44 }
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 uint32x4_t test_vsha1su1q_u32(uint32x4_t w0_3, uint32x4_t w12_15) {
anatofuz
parents:
diff changeset
47 // CHECK-LABEL: @test_vsha1su1q_u32
anatofuz
parents:
diff changeset
48 return vsha1su1q_u32(w0_3, w12_15);
anatofuz
parents:
diff changeset
49 // CHECK: call <4 x i32> @llvm.{{arm.neon|aarch64.crypto}}.sha1su1(<4 x i32> %w0_3, <4 x i32> %w12_15)
anatofuz
parents:
diff changeset
50 }
anatofuz
parents:
diff changeset
51
anatofuz
parents:
diff changeset
52 uint32x4_t test_vsha256su0q_u32(uint32x4_t w0_3, uint32x4_t w4_7) {
anatofuz
parents:
diff changeset
53 // CHECK-LABEL: @test_vsha256su0q_u32
anatofuz
parents:
diff changeset
54 return vsha256su0q_u32(w0_3, w4_7);
anatofuz
parents:
diff changeset
55 // CHECK: call <4 x i32> @llvm.{{arm.neon|aarch64.crypto}}.sha256su0(<4 x i32> %w0_3, <4 x i32> %w4_7)
anatofuz
parents:
diff changeset
56 }
anatofuz
parents:
diff changeset
57
anatofuz
parents:
diff changeset
58 uint32x4_t test_vsha1cq_u32(uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) {
anatofuz
parents:
diff changeset
59 // CHECK-LABEL: @test_vsha1cq_u32
anatofuz
parents:
diff changeset
60 return vsha1cq_u32(hash_abcd, hash_e, wk);
anatofuz
parents:
diff changeset
61 // CHECK: call <4 x i32> @llvm.{{arm.neon|aarch64.crypto}}.sha1c(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk)
anatofuz
parents:
diff changeset
62 }
anatofuz
parents:
diff changeset
63
anatofuz
parents:
diff changeset
64 uint32x4_t test_vsha1pq_u32(uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) {
anatofuz
parents:
diff changeset
65 // CHECK-LABEL: @test_vsha1pq_u32
anatofuz
parents:
diff changeset
66 return vsha1pq_u32(hash_abcd, hash_e, wk);
anatofuz
parents:
diff changeset
67 // CHECK: call <4 x i32> @llvm.{{arm.neon|aarch64.crypto}}.sha1p(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk)
anatofuz
parents:
diff changeset
68 }
anatofuz
parents:
diff changeset
69
anatofuz
parents:
diff changeset
70 uint32x4_t test_vsha1mq_u32(uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) {
anatofuz
parents:
diff changeset
71 // CHECK-LABEL: @test_vsha1mq_u32
anatofuz
parents:
diff changeset
72 return vsha1mq_u32(hash_abcd, hash_e, wk);
anatofuz
parents:
diff changeset
73 // CHECK: call <4 x i32> @llvm.{{arm.neon|aarch64.crypto}}.sha1m(<4 x i32> %hash_abcd, i32 %hash_e, <4 x i32> %wk)
anatofuz
parents:
diff changeset
74 }
anatofuz
parents:
diff changeset
75
anatofuz
parents:
diff changeset
76 uint32x4_t test_vsha1su0q_u32(uint32x4_t w0_3, uint32x4_t w4_7, uint32x4_t w8_11) {
anatofuz
parents:
diff changeset
77 // CHECK-LABEL: @test_vsha1su0q_u32
anatofuz
parents:
diff changeset
78 return vsha1su0q_u32(w0_3, w4_7, w8_11);
anatofuz
parents:
diff changeset
79 // CHECK: call <4 x i32> @llvm.{{arm.neon|aarch64.crypto}}.sha1su0(<4 x i32> %w0_3, <4 x i32> %w4_7, <4 x i32> %w8_11)
anatofuz
parents:
diff changeset
80 }
anatofuz
parents:
diff changeset
81
anatofuz
parents:
diff changeset
82 uint32x4_t test_vsha256hq_u32(uint32x4_t hash_abcd, uint32x4_t hash_efgh, uint32x4_t wk) {
anatofuz
parents:
diff changeset
83 // CHECK-LABEL: @test_vsha256hq_u32
anatofuz
parents:
diff changeset
84 return vsha256hq_u32(hash_abcd, hash_efgh, wk);
anatofuz
parents:
diff changeset
85 // CHECK: call <4 x i32> @llvm.{{arm.neon|aarch64.crypto}}.sha256h(<4 x i32> %hash_abcd, <4 x i32> %hash_efgh, <4 x i32> %wk)
anatofuz
parents:
diff changeset
86 }
anatofuz
parents:
diff changeset
87
anatofuz
parents:
diff changeset
88 uint32x4_t test_vsha256h2q_u32(uint32x4_t hash_efgh, uint32x4_t hash_abcd, uint32x4_t wk) {
anatofuz
parents:
diff changeset
89 // CHECK-LABEL: @test_vsha256h2q_u32
anatofuz
parents:
diff changeset
90 return vsha256h2q_u32(hash_efgh, hash_abcd, wk);
anatofuz
parents:
diff changeset
91 // CHECK: call <4 x i32> @llvm.{{arm.neon|aarch64.crypto}}.sha256h2(<4 x i32> %hash_efgh, <4 x i32> %hash_abcd, <4 x i32> %wk)
anatofuz
parents:
diff changeset
92 }
anatofuz
parents:
diff changeset
93
anatofuz
parents:
diff changeset
94 uint32x4_t test_vsha256su1q_u32(uint32x4_t w0_3, uint32x4_t w8_11, uint32x4_t w12_15) {
anatofuz
parents:
diff changeset
95 // CHECK-LABEL: @test_vsha256su1q_u32
anatofuz
parents:
diff changeset
96 return vsha256su1q_u32(w0_3, w8_11, w12_15);
anatofuz
parents:
diff changeset
97 // CHECK: call <4 x i32> @llvm.{{arm.neon|aarch64.crypto}}.sha256su1(<4 x i32> %w0_3, <4 x i32> %w8_11, <4 x i32> %w12_15)
anatofuz
parents:
diff changeset
98 }