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
6 source_filename = "srem.ll"
7 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
9 define i8 @test_srem_i8(i8 %arg1, i8 %arg2) {
10 %res = srem i8 %arg1, %arg2
14 define i16 @test_srem_i16(i16 %arg1, i16 %arg2) {
15 %res = srem i16 %arg1, %arg2
19 define i32 @test_srem_i32(i32 %arg1, i32 %arg2) {
20 %res = srem i32 %arg1, %arg2
24 define i64 @test_srem_i64(i64 %arg1, i64 %arg2) {
25 %res = srem i64 %arg1, %arg2
33 exposesReturnsTwice: false
35 regBankSelected: false
38 tracksRegLiveness: true
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: '' }
47 isFrameAddressTaken: false
48 isReturnAddressTaken: false
57 maxCallFrameSize: 4294967295
58 hasOpaqueSPAdjustment: false
60 hasMustTailInVarArgFunc: false
71 ; CHECK-LABEL: name: test_srem_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: [[SREM:%[0-9]+]]:_(s8) = G_SREM [[TRUNC]], [[TRUNC1]]
78 ; CHECK: $al = COPY [[SREM]](s8)
79 ; CHECK: RET 0, implicit $al
81 %0:_(s8) = G_TRUNC %2(s32)
83 %1:_(s8) = G_TRUNC %3(s32)
84 %4:_(s8) = G_SREM %0, %1
92 exposesReturnsTwice: false
94 regBankSelected: false
97 tracksRegLiveness: true
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: '' }
106 isFrameAddressTaken: false
107 isReturnAddressTaken: false
116 maxCallFrameSize: 4294967295
117 hasOpaqueSPAdjustment: false
119 hasMustTailInVarArgFunc: false
130 ; CHECK-LABEL: name: test_srem_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: [[SREM:%[0-9]+]]:_(s16) = G_SREM [[TRUNC]], [[TRUNC1]]
137 ; CHECK: $ax = COPY [[SREM]](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_SREM %0, %1
151 exposesReturnsTwice: false
153 regBankSelected: false
156 tracksRegLiveness: true
158 - { id: 0, class: _, preferred-register: '' }
159 - { id: 1, class: _, preferred-register: '' }
160 - { id: 2, class: _, preferred-register: '' }
163 isFrameAddressTaken: false
164 isReturnAddressTaken: false
173 maxCallFrameSize: 4294967295
174 hasOpaqueSPAdjustment: false
176 hasMustTailInVarArgFunc: false
187 ; CHECK-LABEL: name: test_srem_i32
188 ; CHECK: liveins: $edi, $esi
189 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
190 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
191 ; CHECK: [[SREM:%[0-9]+]]:_(s32) = G_SREM [[COPY]], [[COPY1]]
192 ; CHECK: $eax = COPY [[SREM]](s32)
193 ; CHECK: RET 0, implicit $eax
194 %0:_(s32) = COPY $edi
195 %1:_(s32) = COPY $esi
196 %2:_(s32) = G_SREM %0, %1
204 exposesReturnsTwice: false
206 regBankSelected: false
209 tracksRegLiveness: true
211 - { id: 0, class: _, preferred-register: '' }
212 - { id: 1, class: _, preferred-register: '' }
213 - { id: 2, class: _, preferred-register: '' }
216 isFrameAddressTaken: false
217 isReturnAddressTaken: false
226 maxCallFrameSize: 4294967295
227 hasOpaqueSPAdjustment: false
229 hasMustTailInVarArgFunc: false
240 ; CHECK-LABEL: name: test_srem_i64
241 ; CHECK: liveins: $rdi, $rsi
242 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $rdi
243 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $rsi
244 ; CHECK: [[SREM:%[0-9]+]]:_(s64) = G_SREM [[COPY]], [[COPY1]]
245 ; CHECK: $rax = COPY [[SREM]](s64)
246 ; CHECK: RET 0, implicit $rax
247 %0:_(s64) = COPY $rdi
248 %1:_(s64) = COPY $rsi
249 %2:_(s64) = G_SREM %0, %1