1 ; RUN: llc -mtriple=arm64-eabi -mattr=+crc -o - %s | FileCheck %s
2 ; RUN: llc -mtriple=arm64-eabi -mattr=+v8r -o - %s | FileCheck %s
3 ; RUN: llc -mtriple=arm64-eabi -mcpu=cortex-a53 -mattr=+crc -o - %s | FileCheck %s
5 define i32 @test_crc32b(i32 %cur, i8 %next) {
6 ; CHECK-LABEL: test_crc32b:
7 ; CHECK: crc32b w0, w0, w1
8 %bits = zext i8 %next to i32
9 %val = call i32 @llvm.aarch64.crc32b(i32 %cur, i32 %bits)
13 define i32 @test_crc32h(i32 %cur, i16 %next) {
14 ; CHECK-LABEL: test_crc32h:
15 ; CHECK: crc32h w0, w0, w1
16 %bits = zext i16 %next to i32
17 %val = call i32 @llvm.aarch64.crc32h(i32 %cur, i32 %bits)
21 define i32 @test_crc32w(i32 %cur, i32 %next) {
22 ; CHECK-LABEL: test_crc32w:
23 ; CHECK: crc32w w0, w0, w1
24 %val = call i32 @llvm.aarch64.crc32w(i32 %cur, i32 %next)
28 define i32 @test_crc32x(i32 %cur, i64 %next) {
29 ; CHECK-LABEL: test_crc32x:
30 ; CHECK: crc32x w0, w0, x1
31 %val = call i32 @llvm.aarch64.crc32x(i32 %cur, i64 %next)
35 define i32 @test_crc32cb(i32 %cur, i8 %next) {
36 ; CHECK-LABEL: test_crc32cb:
37 ; CHECK: crc32cb w0, w0, w1
38 %bits = zext i8 %next to i32
39 %val = call i32 @llvm.aarch64.crc32cb(i32 %cur, i32 %bits)
43 define i32 @test_crc32ch(i32 %cur, i16 %next) {
44 ; CHECK-LABEL: test_crc32ch:
45 ; CHECK: crc32ch w0, w0, w1
46 %bits = zext i16 %next to i32
47 %val = call i32 @llvm.aarch64.crc32ch(i32 %cur, i32 %bits)
51 define i32 @test_crc32cw(i32 %cur, i32 %next) {
52 ; CHECK-LABEL: test_crc32cw:
53 ; CHECK: crc32cw w0, w0, w1
54 %val = call i32 @llvm.aarch64.crc32cw(i32 %cur, i32 %next)
58 define i32 @test_crc32cx(i32 %cur, i64 %next) {
59 ; CHECK-LABEL: test_crc32cx:
60 ; CHECK: crc32cx w0, w0, x1
61 %val = call i32 @llvm.aarch64.crc32cx(i32 %cur, i64 %next)
65 declare i32 @llvm.aarch64.crc32b(i32, i32)
66 declare i32 @llvm.aarch64.crc32h(i32, i32)
67 declare i32 @llvm.aarch64.crc32w(i32, i32)
68 declare i32 @llvm.aarch64.crc32x(i32, i64)
70 declare i32 @llvm.aarch64.crc32cb(i32, i32)
71 declare i32 @llvm.aarch64.crc32ch(i32, i32)
72 declare i32 @llvm.aarch64.crc32cw(i32, i32)
73 declare i32 @llvm.aarch64.crc32cx(i32, i64)