1 // RUN: %clang_cc1 -triple arm64-apple-ios7.0 -target-feature +neon -target-feature +aes -target-feature +sha2 -ffreestanding -Os -S -o - %s | FileCheck %s 2 // RUN: %clang_cc1 -triple arm64-apple-ios7.0 -target-feature +neon -target-feature +aes -target-feature +sha2 -ffreestanding -fexperimental-new-pass-manager -Os -S -o - %s | FileCheck %s 3 4 // REQUIRES: aarch64-registered-target 5 6 #include <arm_neon.h> 7 8 uint8x16_t test_aese(uint8x16_t data, uint8x16_t key) { 9 // CHECK-LABEL: test_aese: 10 // CHECK: aese.16b v0, v1 11 return vaeseq_u8(data, key); 12 } 13 14 uint8x16_t test_aesd(uint8x16_t data, uint8x16_t key) { 15 // CHECK-LABEL: test_aesd: 16 // CHECK: aesd.16b v0, v1 17 return vaesdq_u8(data, key); 18 } 19 20 uint8x16_t test_aesmc(uint8x16_t data, uint8x16_t key) { 21 // CHECK-LABEL: test_aesmc: 22 // CHECK: aesmc.16b v0, v0 23 return vaesmcq_u8(data); 24 } 25 26 uint8x16_t test_aesimc(uint8x16_t data, uint8x16_t key) { 27 // CHECK-LABEL: test_aesimc: 28 // CHECK: aesimc.16b v0, v0 29 return vaesimcq_u8(data); 30 } 31 32 uint32x4_t test_sha1c(uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) { 33 // CHECK-LABEL: test_sha1c: 34 // CHECK: fmov [[HASH_E:s[0-9]+]], w0 35 // CHECK: sha1c.4s q0, [[HASH_E]], v1 36 return vsha1cq_u32(hash_abcd, hash_e, wk); 37 } 38 39 uint32x4_t test_sha1p(uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) { 40 // CHECK-LABEL: test_sha1p: 41 // CHECK: fmov [[HASH_E:s[0-9]+]], w0 42 // CHECK: sha1p.4s q0, [[HASH_E]], v1 43 return vsha1pq_u32(hash_abcd, hash_e, wk); 44 } 45 46 uint32x4_t test_sha1m(uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) { 47 // CHECK-LABEL: test_sha1m: 48 // CHECK: fmov [[HASH_E:s[0-9]+]], w0 49 // CHECK: sha1m.4s q0, [[HASH_E]], v1 50 return vsha1mq_u32(hash_abcd, hash_e, wk); 51 } 52 53 uint32_t test_sha1h(uint32_t hash_e) { 54 // CHECK-LABEL: test_sha1h: 55 // CHECK: fmov [[HASH_E:s[0-9]+]], w0 56 // CHECK: sha1h [[RES:s[0-9]+]], [[HASH_E]] 57 // CHECK: fmov w0, [[RES]] 58 return vsha1h_u32(hash_e); 59 } 60 61 uint32x4_t test_sha1su0(uint32x4_t wk0_3, uint32x4_t wk4_7, uint32x4_t wk8_11) { 62 // CHECK-LABEL: test_sha1su0: 63 // CHECK: sha1su0.4s v0, v1, v2 64 return vsha1su0q_u32(wk0_3, wk4_7, wk8_11); 65 } 66 67 uint32x4_t test_sha1su1(uint32x4_t wk0_3, uint32x4_t wk12_15) { 68 // CHECK-LABEL: test_sha1su1: 69 // CHECK: sha1su1.4s v0, v1 70 return vsha1su1q_u32(wk0_3, wk12_15); 71 } 72 73 uint32x4_t test_sha256h(uint32x4_t hash_abcd, uint32x4_t hash_efgh, uint32x4_t wk) { 74 // CHECK-LABEL: test_sha256h: 75 // CHECK: sha256h.4s q0, q1, v2 76 return vsha256hq_u32(hash_abcd, hash_efgh, wk); 77 } 78 79 uint32x4_t test_sha256h2(uint32x4_t hash_efgh, uint32x4_t hash_abcd, uint32x4_t wk) { 80 // CHECK-LABEL: test_sha256h2: 81 // CHECK: sha256h2.4s q0, q1, v2 82 return vsha256h2q_u32(hash_efgh, hash_abcd, wk); 83 } 84 85 uint32x4_t test_sha256su0(uint32x4_t w0_3, uint32x4_t w4_7) { 86 // CHECK-LABEL: test_sha256su0: 87 // CHECK: sha256su0.4s v0, v1 88 return vsha256su0q_u32(w0_3, w4_7); 89 } 90 91 uint32x4_t test_sha256su1(uint32x4_t w0_3, uint32x4_t w8_11, uint32x4_t w12_15) { 92 // CHECK-LABEL: test_sha256su1: 93 // CHECK: sha256su1.4s v0, v1, v2 94 return vsha256su1q_u32(w0_3, w8_11, w12_15); 95 } 96