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 3 4--- | 5 ; ModuleID = 'urem.ll' 6 source_filename = "urem.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" 9 10 define i8 @test_urem_i8(i8 %arg1, i8 %arg2) { 11 %res = urem i8 %arg1, %arg2 12 ret i8 %res 13 } 14 15 define i16 @test_urem_i16(i16 %arg1, i16 %arg2) { 16 %res = urem i16 %arg1, %arg2 17 ret i16 %res 18 } 19 20 define i32 @test_urem_i32(i32 %arg1, i32 %arg2) { 21 %res = urem i32 %arg1, %arg2 22 ret i32 %res 23 } 24 25... 26--- 27name: test_urem_i8 28alignment: 16 29exposesReturnsTwice: false 30legalized: true 31regBankSelected: true 32selected: false 33failedISel: false 34tracksRegLiveness: true 35registers: 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: '' } 41liveins: 42frameInfo: 43 isFrameAddressTaken: false 44 isReturnAddressTaken: false 45 hasStackMap: false 46 hasPatchPoint: false 47 stackSize: 0 48 offsetAdjustment: 0 49 maxAlignment: 4 50 adjustsStack: false 51 hasCalls: false 52 stackProtector: '' 53 maxCallFrameSize: 4294967295 54 hasOpaqueSPAdjustment: false 55 hasVAStart: false 56 hasMustTailInVarArgFunc: false 57 localFrameSize: 0 58 savePoint: '' 59 restorePoint: '' 60fixedStack: 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: '' } 67stack: 68constants: 69body: | 70 bb.1 (%ir-block.0): 71 ; CHECK-LABEL: name: test_urem_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 $ah 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_UREM %0, %1 84 $al = COPY %4(s8) 85 RET 0, implicit $al 86 87... 88--- 89name: test_urem_i16 90alignment: 16 91exposesReturnsTwice: false 92legalized: true 93regBankSelected: true 94selected: false 95failedISel: false 96tracksRegLiveness: true 97registers: 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: '' } 103liveins: 104frameInfo: 105 isFrameAddressTaken: false 106 isReturnAddressTaken: false 107 hasStackMap: false 108 hasPatchPoint: false 109 stackSize: 0 110 offsetAdjustment: 0 111 maxAlignment: 4 112 adjustsStack: false 113 hasCalls: false 114 stackProtector: '' 115 maxCallFrameSize: 4294967295 116 hasOpaqueSPAdjustment: false 117 hasVAStart: false 118 hasMustTailInVarArgFunc: false 119 localFrameSize: 0 120 savePoint: '' 121 restorePoint: '' 122fixedStack: 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: '' } 129stack: 130constants: 131body: | 132 bb.1 (%ir-block.0): 133 ; CHECK-LABEL: name: test_urem_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 $dx 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_UREM %0, %1 148 $ax = COPY %4(s16) 149 RET 0, implicit $ax 150 151... 152--- 153name: test_urem_i32 154alignment: 16 155exposesReturnsTwice: false 156legalized: true 157regBankSelected: true 158selected: false 159failedISel: false 160tracksRegLiveness: true 161registers: 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: '' } 167liveins: 168frameInfo: 169 isFrameAddressTaken: false 170 isReturnAddressTaken: false 171 hasStackMap: false 172 hasPatchPoint: false 173 stackSize: 0 174 offsetAdjustment: 0 175 maxAlignment: 4 176 adjustsStack: false 177 hasCalls: false 178 stackProtector: '' 179 maxCallFrameSize: 4294967295 180 hasOpaqueSPAdjustment: false 181 hasVAStart: false 182 hasMustTailInVarArgFunc: false 183 localFrameSize: 0 184 savePoint: '' 185 restorePoint: '' 186fixedStack: 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: '' } 193stack: 194constants: 195body: | 196 bb.1 (%ir-block.0): 197 ; CHECK-LABEL: name: test_urem_i32 198 ; CHECK: [[MOV32rm:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.0, align 16) 199 ; CHECK: [[MOV32rm1:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (invariant load 4 from %fixed-stack.1) 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 $edx 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 16) 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 4) 211 %4:gpr(s32) = G_UREM %0, %1 212 $eax = COPY %4(s32) 213 RET 0, implicit $eax 214 215... 216