1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=i386-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
6 source_filename = "udiv.ll"
7 target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
8 target triple = "i386--linux-gnu"
10 define i8 @test_udiv_i8(i8 %arg1, i8 %arg2) {
11 %res = udiv i8 %arg1, %arg2
15 define i16 @test_udiv_i16(i16 %arg1, i16 %arg2) {
16 %res = udiv i16 %arg1, %arg2
20 define i32 @test_udiv_i32(i32 %arg1, i32 %arg2) {
21 %res = udiv i32 %arg1, %arg2
29 exposesReturnsTwice: false
34 tracksRegLiveness: true
36 - { id: 0, class: gpr, preferred-register: '' }
37 - { id: 1, class: gpr, preferred-register: '' }
38 - { id: 2, class: gpr, preferred-register: '' }
39 - { id: 3, class: gpr, preferred-register: '' }
40 - { id: 4, class: gpr, preferred-register: '' }
43 isFrameAddressTaken: false
44 isReturnAddressTaken: false
53 maxCallFrameSize: 4294967295
54 hasOpaqueSPAdjustment: false
56 hasMustTailInVarArgFunc: false
61 - { id: 0, type: default, offset: 4, size: 1, alignment: 4, stack-id: default,
62 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
63 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
64 - { id: 1, type: default, offset: 0, size: 1, alignment: 16, stack-id: default,
65 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
66 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
71 ; CHECK-LABEL: name: test_udiv_i8
72 ; CHECK: [[MOV8rm:%[0-9]+]]:gr8 = MOV8rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 1 from %fixed-stack.0, align 16)
73 ; CHECK: [[MOV8rm1:%[0-9]+]]:gr8 = MOV8rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load 1 from %fixed-stack.1, align 4)
74 ; CHECK: $ax = MOVZX16rr8 [[MOV8rm]]
75 ; CHECK: DIV8r [[MOV8rm1]], implicit-def $al, implicit-def $ah, implicit-def $eflags, implicit $ax
76 ; CHECK: [[COPY:%[0-9]+]]:gr8 = COPY $al
77 ; CHECK: $al = COPY [[COPY]]
78 ; CHECK: RET 0, implicit $al
79 %2:gpr(p0) = G_FRAME_INDEX %fixed-stack.1
80 %0:gpr(s8) = G_LOAD %2(p0) :: (invariant load 1 from %fixed-stack.1, align 16)
81 %3:gpr(p0) = G_FRAME_INDEX %fixed-stack.0
82 %1:gpr(s8) = G_LOAD %3(p0) :: (invariant load 1 from %fixed-stack.0, align 4)
83 %4:gpr(s8) = G_UDIV %0, %1
91 exposesReturnsTwice: false
96 tracksRegLiveness: true
98 - { id: 0, class: gpr, preferred-register: '' }
99 - { id: 1, class: gpr, preferred-register: '' }
100 - { id: 2, class: gpr, preferred-register: '' }
101 - { id: 3, class: gpr, preferred-register: '' }
102 - { id: 4, class: gpr, preferred-register: '' }
105 isFrameAddressTaken: false
106 isReturnAddressTaken: false
115 maxCallFrameSize: 4294967295
116 hasOpaqueSPAdjustment: false
118 hasMustTailInVarArgFunc: false
123 - { id: 0, type: default, offset: 4, size: 2, alignment: 4, stack-id: default,
124 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
125 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
126 - { id: 1, type: default, offset: 0, size: 2, alignment: 16, stack-id: default,
127 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
128 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
133 ; CHECK-LABEL: name: test_udiv_i16
134 ; CHECK: [[MOV16rm:%[0-9]+]]:gr16 = MOV16rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 2 from %fixed-stack.0, align 16)
135 ; CHECK: [[MOV16rm1:%[0-9]+]]:gr16 = MOV16rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load 2 from %fixed-stack.1, align 4)
136 ; CHECK: $ax = COPY [[MOV16rm]]
137 ; CHECK: [[MOV32r0_:%[0-9]+]]:gr32 = MOV32r0 implicit-def $eflags
138 ; CHECK: $dx = COPY [[MOV32r0_]].sub_16bit
139 ; CHECK: DIV16r [[MOV16rm1]], implicit-def $ax, implicit-def $dx, implicit-def $eflags, implicit $ax, implicit $dx
140 ; CHECK: [[COPY:%[0-9]+]]:gr16 = COPY $ax
141 ; CHECK: $ax = COPY [[COPY]]
142 ; CHECK: RET 0, implicit $ax
143 %2:gpr(p0) = G_FRAME_INDEX %fixed-stack.1
144 %0:gpr(s16) = G_LOAD %2(p0) :: (invariant load 2 from %fixed-stack.1, align 16)
145 %3:gpr(p0) = G_FRAME_INDEX %fixed-stack.0
146 %1:gpr(s16) = G_LOAD %3(p0) :: (invariant load 2 from %fixed-stack.0, align 4)
147 %4:gpr(s16) = G_UDIV %0, %1
155 exposesReturnsTwice: false
157 regBankSelected: true
160 tracksRegLiveness: true
162 - { id: 0, class: gpr, preferred-register: '' }
163 - { id: 1, class: gpr, preferred-register: '' }
164 - { id: 2, class: gpr, preferred-register: '' }
165 - { id: 3, class: gpr, preferred-register: '' }
166 - { id: 4, class: gpr, preferred-register: '' }
169 isFrameAddressTaken: false
170 isReturnAddressTaken: false
179 maxCallFrameSize: 4294967295
180 hasOpaqueSPAdjustment: false
182 hasMustTailInVarArgFunc: false
187 - { id: 0, type: default, offset: 4, size: 4, alignment: 4, stack-id: default,
188 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
189 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
190 - { id: 1, type: default, offset: 0, size: 4, alignment: 16, stack-id: default,
191 isImmutable: true, isAliased: false, callee-saved-register: '', callee-saved-restored: true,
192 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
197 ; CHECK-LABEL: name: test_udiv_i32
198 ; CHECK: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0)
199 ; CHECK: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.1, align 16)
200 ; CHECK: $eax = COPY [[MOV32rm]]
201 ; CHECK: [[MOV32r0_:%[0-9]+]]:gr32 = MOV32r0 implicit-def $eflags
202 ; CHECK: $edx = COPY [[MOV32r0_]]
203 ; CHECK: DIV32r [[MOV32rm1]], implicit-def $eax, implicit-def $edx, implicit-def $eflags, implicit $eax, implicit $edx
204 ; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $eax
205 ; CHECK: $eax = COPY [[COPY]]
206 ; CHECK: RET 0, implicit $eax
207 %2:gpr(p0) = G_FRAME_INDEX %fixed-stack.1
208 %0:gpr(s32) = G_LOAD %2(p0) :: (invariant load 4 from %fixed-stack.1, align 4)
209 %3:gpr(p0) = G_FRAME_INDEX %fixed-stack.0
210 %1:gpr(s32) = G_LOAD %3(p0) :: (invariant load 4 from %fixed-stack.0, align 16)
211 %4:gpr(s32) = G_UDIV %0, %1