• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=thumbv8 -o - %s | FileCheck %s
2
3define i32 @test_crc32b(i32 %cur, i8 %next) {
4; CHECK-LABEL: test_crc32b:
5; CHECK: crc32b r0, r0, r1
6  %bits = zext i8 %next to i32
7  %val = call i32 @llvm.arm.crc32b(i32 %cur, i32 %bits)
8  ret i32 %val
9}
10
11define i32 @test_crc32h(i32 %cur, i16 %next) {
12; CHECK-LABEL: test_crc32h:
13; CHECK: crc32h r0, r0, r1
14  %bits = zext i16 %next to i32
15  %val = call i32 @llvm.arm.crc32h(i32 %cur, i32 %bits)
16  ret i32 %val
17}
18
19define i32 @test_crc32w(i32 %cur, i32 %next) {
20; CHECK-LABEL: test_crc32w:
21; CHECK: crc32w r0, r0, r1
22  %val = call i32 @llvm.arm.crc32w(i32 %cur, i32 %next)
23  ret i32 %val
24}
25
26define i32 @test_crc32cb(i32 %cur, i8 %next) {
27; CHECK-LABEL: test_crc32cb:
28; CHECK: crc32cb r0, r0, r1
29  %bits = zext i8 %next to i32
30  %val = call i32 @llvm.arm.crc32cb(i32 %cur, i32 %bits)
31  ret i32 %val
32}
33
34define i32 @test_crc32ch(i32 %cur, i16 %next) {
35; CHECK-LABEL: test_crc32ch:
36; CHECK: crc32ch r0, r0, r1
37  %bits = zext i16 %next to i32
38  %val = call i32 @llvm.arm.crc32ch(i32 %cur, i32 %bits)
39  ret i32 %val
40}
41
42define i32 @test_crc32cw(i32 %cur, i32 %next) {
43; CHECK-LABEL: test_crc32cw:
44; CHECK: crc32cw r0, r0, r1
45  %val = call i32 @llvm.arm.crc32cw(i32 %cur, i32 %next)
46  ret i32 %val
47}
48
49
50declare i32 @llvm.arm.crc32b(i32, i32)
51declare i32 @llvm.arm.crc32h(i32, i32)
52declare i32 @llvm.arm.crc32w(i32, i32)
53declare i32 @llvm.arm.crc32x(i32, i64)
54
55declare i32 @llvm.arm.crc32cb(i32, i32)
56declare i32 @llvm.arm.crc32ch(i32, i32)
57declare i32 @llvm.arm.crc32cw(i32, i32)
58declare i32 @llvm.arm.crc32cx(i32, i64)
59