1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main -mattr=+cdecp0 -mattr=+cdecp1 -verify-machineinstrs -o - %s | FileCheck %s
3 ; RUN: llc -mtriple=thumbebv8.1m.main -mattr=+cdecp0 -mattr=+cdecp1 -verify-machineinstrs -o - %s | FileCheck %s
5 declare i32 @llvm.arm.cde.cx1(i32 immarg, i32 immarg)
6 declare i32 @llvm.arm.cde.cx1a(i32 immarg, i32, i32 immarg)
7 declare { i32, i32 } @llvm.arm.cde.cx1d(i32 immarg, i32 immarg)
8 declare { i32, i32 } @llvm.arm.cde.cx1da(i32 immarg, i32, i32, i32 immarg)
10 declare i32 @llvm.arm.cde.cx2(i32 immarg, i32, i32 immarg)
11 declare i32 @llvm.arm.cde.cx2a(i32 immarg, i32, i32, i32 immarg)
12 declare { i32, i32 } @llvm.arm.cde.cx2d(i32 immarg, i32, i32 immarg)
13 declare { i32, i32 } @llvm.arm.cde.cx2da(i32 immarg, i32, i32, i32, i32 immarg)
15 declare i32 @llvm.arm.cde.cx3(i32 immarg, i32, i32, i32 immarg)
16 declare i32 @llvm.arm.cde.cx3a(i32 immarg, i32, i32, i32, i32 immarg)
17 declare { i32, i32 } @llvm.arm.cde.cx3d(i32 immarg, i32, i32, i32 immarg)
18 declare { i32, i32 } @llvm.arm.cde.cx3da(i32 immarg, i32, i32, i32, i32, i32 immarg)
20 define arm_aapcs_vfpcc i32 @test_cx1() {
21 ; CHECK-LABEL: test_cx1:
22 ; CHECK: @ %bb.0: @ %entry
23 ; CHECK-NEXT: cx1 p0, r0, #123
26 %0 = call i32 @llvm.arm.cde.cx1(i32 0, i32 123)
30 define arm_aapcs_vfpcc i32 @test_cx1a(i32 %acc) {
31 ; CHECK-LABEL: test_cx1a:
32 ; CHECK: @ %bb.0: @ %entry
33 ; CHECK-NEXT: cx1a p0, r0, #345
36 %0 = call i32 @llvm.arm.cde.cx1a(i32 0, i32 %acc, i32 345)
40 define arm_aapcs_vfpcc i64 @test_cx1d() {
41 ; CHECK-LABEL: test_cx1d:
42 ; CHECK: @ %bb.0: @ %entry
43 ; CHECK-NEXT: cx1d p1, r0, r1, #567
46 %0 = call { i32, i32 } @llvm.arm.cde.cx1d(i32 1, i32 567)
47 %1 = extractvalue { i32, i32 } %0, 1
48 %2 = zext i32 %1 to i64
50 %4 = extractvalue { i32, i32 } %0, 0
51 %5 = zext i32 %4 to i64
56 define arm_aapcs_vfpcc i64 @test_cx1da(i64 %acc) {
57 ; CHECK-LABEL: test_cx1da:
58 ; CHECK: @ %bb.0: @ %entry
59 ; CHECK-NEXT: @ kill: def $r1 killed $r1 killed $r0_r1 def $r0_r1
60 ; CHECK-NEXT: @ kill: def $r0 killed $r0 killed $r0_r1 def $r0_r1
61 ; CHECK-NEXT: cx1da p0, r0, r1, #789
64 %0 = lshr i64 %acc, 32
65 %1 = trunc i64 %0 to i32
66 %2 = trunc i64 %acc to i32
67 %3 = call { i32, i32 } @llvm.arm.cde.cx1da(i32 0, i32 %2, i32 %1, i32 789)
68 %4 = extractvalue { i32, i32 } %3, 1
69 %5 = zext i32 %4 to i64
71 %7 = extractvalue { i32, i32 } %3, 0
72 %8 = zext i32 %7 to i64
77 define arm_aapcs_vfpcc i32 @test_cx2(i32 %n) {
78 ; CHECK-LABEL: test_cx2:
79 ; CHECK: @ %bb.0: @ %entry
80 ; CHECK-NEXT: cx2 p0, r0, r0, #11
83 %0 = call i32 @llvm.arm.cde.cx2(i32 0, i32 %n, i32 11)
87 define arm_aapcs_vfpcc i32 @test_cx2a(i32 %acc, i32 %n) {
88 ; CHECK-LABEL: test_cx2a:
89 ; CHECK: @ %bb.0: @ %entry
90 ; CHECK-NEXT: cx2a p1, r0, r1, #22
93 %0 = call i32 @llvm.arm.cde.cx2a(i32 1, i32 %acc, i32 %n, i32 22)
97 define arm_aapcs_vfpcc i64 @test_cx2d(i32 %n) #0 {
98 ; CHECK-LABEL: test_cx2d:
99 ; CHECK: @ %bb.0: @ %entry
100 ; CHECK-NEXT: cx2d p1, r0, r1, r0, #33
103 %0 = call { i32, i32 } @llvm.arm.cde.cx2d(i32 1, i32 %n, i32 33)
104 %1 = extractvalue { i32, i32 } %0, 1
105 %2 = zext i32 %1 to i64
107 %4 = extractvalue { i32, i32 } %0, 0
108 %5 = zext i32 %4 to i64
113 define arm_aapcs_vfpcc i64 @test_cx2da(i64 %acc, i32 %n) {
114 ; CHECK-LABEL: test_cx2da:
115 ; CHECK: @ %bb.0: @ %entry
116 ; CHECK-NEXT: @ kill: def $r1 killed $r1 killed $r0_r1 def $r0_r1
117 ; CHECK-NEXT: @ kill: def $r0 killed $r0 killed $r0_r1 def $r0_r1
118 ; CHECK-NEXT: cx2da p0, r0, r1, r2, #44
121 %0 = lshr i64 %acc, 32
122 %1 = trunc i64 %0 to i32
123 %2 = trunc i64 %acc to i32
124 %3 = call { i32, i32 } @llvm.arm.cde.cx2da(i32 0, i32 %2, i32 %1, i32 %n, i32 44)
125 %4 = extractvalue { i32, i32 } %3, 1
126 %5 = zext i32 %4 to i64
128 %7 = extractvalue { i32, i32 } %3, 0
129 %8 = zext i32 %7 to i64
134 define arm_aapcs_vfpcc i32 @test_cx3(i32 %n, i32 %m) {
135 ; CHECK-LABEL: test_cx3:
136 ; CHECK: @ %bb.0: @ %entry
137 ; CHECK-NEXT: cx3 p0, r0, r0, r1, #1
140 %0 = call i32 @llvm.arm.cde.cx3(i32 0, i32 %n, i32 %m, i32 1)
144 define arm_aapcs_vfpcc i32 @test_cx3a(i32 %acc, i32 %n, i32 %m) {
145 ; CHECK-LABEL: test_cx3a:
146 ; CHECK: @ %bb.0: @ %entry
147 ; CHECK-NEXT: cx3a p1, r0, r1, r2, #2
150 %0 = call i32 @llvm.arm.cde.cx3a(i32 1, i32 %acc, i32 %n, i32 %m, i32 2)
154 define arm_aapcs_vfpcc i64 @test_cx3d(i32 %n, i32 %m) {
155 ; CHECK-LABEL: test_cx3d:
156 ; CHECK: @ %bb.0: @ %entry
157 ; CHECK-NEXT: cx3d p1, r0, r1, r0, r1, #3
160 %0 = call { i32, i32 } @llvm.arm.cde.cx3d(i32 1, i32 %n, i32 %m, i32 3)
161 %1 = extractvalue { i32, i32 } %0, 1
162 %2 = zext i32 %1 to i64
164 %4 = extractvalue { i32, i32 } %0, 0
165 %5 = zext i32 %4 to i64
170 define arm_aapcs_vfpcc i64 @test_cx3da(i64 %acc, i32 %n, i32 %m) {
171 ; CHECK-LABEL: test_cx3da:
172 ; CHECK: @ %bb.0: @ %entry
173 ; CHECK-NEXT: @ kill: def $r1 killed $r1 killed $r0_r1 def $r0_r1
174 ; CHECK-NEXT: @ kill: def $r0 killed $r0 killed $r0_r1 def $r0_r1
175 ; CHECK-NEXT: cx3da p0, r0, r1, r2, r3, #4
178 %0 = lshr i64 %acc, 32
179 %1 = trunc i64 %0 to i32
180 %2 = trunc i64 %acc to i32
181 %3 = call { i32, i32 } @llvm.arm.cde.cx3da(i32 0, i32 %2, i32 %1, i32 %n, i32 %m, i32 4)
182 %4 = extractvalue { i32, i32 } %3, 1
183 %5 = zext i32 %4 to i64
185 %7 = extractvalue { i32, i32 } %3, 0
186 %8 = zext i32 %7 to i64