]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/X86/GlobalISel/x86_64-legalize-udiv.mir
Vendor import of llvm trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / CodeGen / X86 / GlobalISel / x86_64-legalize-udiv.mir
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
3
4 --- |
5   ; ModuleID = 'udiv.ll'
6   source_filename = "udiv.ll"
7   target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8
9   define i8 @test_udiv_i8(i8 %arg1, i8 %arg2) {
10     %res = udiv i8 %arg1, %arg2
11     ret i8 %res
12   }
13
14   define i16 @test_udiv_i16(i16 %arg1, i16 %arg2) {
15     %res = udiv i16 %arg1, %arg2
16     ret i16 %res
17   }
18
19   define i32 @test_udiv_i32(i32 %arg1, i32 %arg2) {
20     %res = udiv i32 %arg1, %arg2
21     ret i32 %res
22   }
23
24   define i64 @test_udiv_i64(i64 %arg1, i64 %arg2) {
25     %res = udiv i64 %arg1, %arg2
26     ret i64 %res
27   }
28
29 ...
30 ---
31 name:            test_udiv_i8
32 alignment:       4
33 exposesReturnsTwice: false
34 legalized:       false
35 regBankSelected: false
36 selected:        false
37 failedISel:      false
38 tracksRegLiveness: true
39 registers:
40   - { id: 0, class: _, preferred-register: '' }
41   - { id: 1, class: _, preferred-register: '' }
42   - { id: 2, class: _, preferred-register: '' }
43   - { id: 3, class: _, preferred-register: '' }
44   - { id: 4, class: _, preferred-register: '' }
45 liveins:
46 frameInfo:
47   isFrameAddressTaken: false
48   isReturnAddressTaken: false
49   hasStackMap:     false
50   hasPatchPoint:   false
51   stackSize:       0
52   offsetAdjustment: 0
53   maxAlignment:    0
54   adjustsStack:    false
55   hasCalls:        false
56   stackProtector:  ''
57   maxCallFrameSize: 4294967295
58   hasOpaqueSPAdjustment: false
59   hasVAStart:      false
60   hasMustTailInVarArgFunc: false
61   localFrameSize:  0
62   savePoint:       ''
63   restorePoint:    ''
64 fixedStack:
65 stack:
66 constants:
67 body:             |
68   bb.1 (%ir-block.0):
69     liveins: $edi, $esi
70
71     ; CHECK-LABEL: name: test_udiv_i8
72     ; CHECK: liveins: $edi, $esi
73     ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
74     ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
75     ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
76     ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32)
77     ; CHECK: [[UDIV:%[0-9]+]]:_(s8) = G_UDIV [[TRUNC]], [[TRUNC1]]
78     ; CHECK: $al = COPY [[UDIV]](s8)
79     ; CHECK: RET 0, implicit $al
80     %2:_(s32) = COPY $edi
81     %0:_(s8) = G_TRUNC %2(s32)
82     %3:_(s32) = COPY $esi
83     %1:_(s8) = G_TRUNC %3(s32)
84     %4:_(s8) = G_UDIV %0, %1
85     $al = COPY %4(s8)
86     RET 0, implicit $al
87
88 ...
89 ---
90 name:            test_udiv_i16
91 alignment:       4
92 exposesReturnsTwice: false
93 legalized:       false
94 regBankSelected: false
95 selected:        false
96 failedISel:      false
97 tracksRegLiveness: true
98 registers:
99   - { id: 0, class: _, preferred-register: '' }
100   - { id: 1, class: _, preferred-register: '' }
101   - { id: 2, class: _, preferred-register: '' }
102   - { id: 3, class: _, preferred-register: '' }
103   - { id: 4, class: _, preferred-register: '' }
104 liveins:
105 frameInfo:
106   isFrameAddressTaken: false
107   isReturnAddressTaken: false
108   hasStackMap:     false
109   hasPatchPoint:   false
110   stackSize:       0
111   offsetAdjustment: 0
112   maxAlignment:    0
113   adjustsStack:    false
114   hasCalls:        false
115   stackProtector:  ''
116   maxCallFrameSize: 4294967295
117   hasOpaqueSPAdjustment: false
118   hasVAStart:      false
119   hasMustTailInVarArgFunc: false
120   localFrameSize:  0
121   savePoint:       ''
122   restorePoint:    ''
123 fixedStack:
124 stack:
125 constants:
126 body:             |
127   bb.1 (%ir-block.0):
128     liveins: $edi, $esi
129
130     ; CHECK-LABEL: name: test_udiv_i16
131     ; CHECK: liveins: $edi, $esi
132     ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
133     ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
134     ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
135     ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
136     ; CHECK: [[UDIV:%[0-9]+]]:_(s16) = G_UDIV [[TRUNC]], [[TRUNC1]]
137     ; CHECK: $ax = COPY [[UDIV]](s16)
138     ; CHECK: RET 0, implicit $ax
139     %2:_(s32) = COPY $edi
140     %0:_(s16) = G_TRUNC %2(s32)
141     %3:_(s32) = COPY $esi
142     %1:_(s16) = G_TRUNC %3(s32)
143     %4:_(s16) = G_UDIV %0, %1
144     $ax = COPY %4(s16)
145     RET 0, implicit $ax
146
147 ...
148 ---
149 name:            test_udiv_i32
150 alignment:       4
151 exposesReturnsTwice: false
152 legalized:       false
153 regBankSelected: false
154 selected:        false
155 failedISel:      false
156 tracksRegLiveness: true
157 registers:
158   - { id: 0, class: _, preferred-register: '' }
159   - { id: 1, class: _, preferred-register: '' }
160   - { id: 2, class: _, preferred-register: '' }
161 liveins:
162 frameInfo:
163   isFrameAddressTaken: false
164   isReturnAddressTaken: false
165   hasStackMap:     false
166   hasPatchPoint:   false
167   stackSize:       0
168   offsetAdjustment: 0
169   maxAlignment:    0
170   adjustsStack:    false
171   hasCalls:        false
172   stackProtector:  ''
173   maxCallFrameSize: 4294967295
174   hasOpaqueSPAdjustment: false
175   hasVAStart:      false
176   hasMustTailInVarArgFunc: false
177   localFrameSize:  0
178   savePoint:       ''
179   restorePoint:    ''
180 fixedStack:
181 stack:
182 constants:
183 body:             |
184   bb.1 (%ir-block.0):
185     liveins: $edi, $esi
186
187     ; CHECK-LABEL: name: test_udiv_i32
188     ; CHECK: liveins: $edi, $esi
189     ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
190     ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
191     ; CHECK: [[UDIV:%[0-9]+]]:_(s32) = G_UDIV [[COPY]], [[COPY1]]
192     ; CHECK: $eax = COPY [[UDIV]](s32)
193     ; CHECK: RET 0, implicit $eax
194     %0:_(s32) = COPY $edi
195     %1:_(s32) = COPY $esi
196     %2:_(s32) = G_UDIV %0, %1
197     $eax = COPY %2(s32)
198     RET 0, implicit $eax
199
200 ...
201 ---
202 name:            test_udiv_i64
203 alignment:       4
204 exposesReturnsTwice: false
205 legalized:       false
206 regBankSelected: false
207 selected:        false
208 failedISel:      false
209 tracksRegLiveness: true
210 registers:
211   - { id: 0, class: _, preferred-register: '' }
212   - { id: 1, class: _, preferred-register: '' }
213   - { id: 2, class: _, preferred-register: '' }
214 liveins:
215 frameInfo:
216   isFrameAddressTaken: false
217   isReturnAddressTaken: false
218   hasStackMap:     false
219   hasPatchPoint:   false
220   stackSize:       0
221   offsetAdjustment: 0
222   maxAlignment:    0
223   adjustsStack:    false
224   hasCalls:        false
225   stackProtector:  ''
226   maxCallFrameSize: 4294967295
227   hasOpaqueSPAdjustment: false
228   hasVAStart:      false
229   hasMustTailInVarArgFunc: false
230   localFrameSize:  0
231   savePoint:       ''
232   restorePoint:    ''
233 fixedStack:
234 stack:
235 constants:
236 body:             |
237   bb.1 (%ir-block.0):
238     liveins: $rdi, $rsi
239
240     ; CHECK-LABEL: name: test_udiv_i64
241     ; CHECK: liveins: $rdi, $rsi
242     ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $rdi
243     ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $rsi
244     ; CHECK: [[UDIV:%[0-9]+]]:_(s64) = G_UDIV [[COPY]], [[COPY1]]
245     ; CHECK: $rax = COPY [[UDIV]](s64)
246     ; CHECK: RET 0, implicit $rax
247     %0:_(s64) = COPY $rdi
248     %1:_(s64) = COPY $rsi
249     %2:_(s64) = G_UDIV %0, %1
250     $rax = COPY %2(s64)
251     RET 0, implicit $rax
252
253 ...