1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=i686-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
6 source_filename = "sdiv.ll"
7 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
9 define i8 @test_sdiv_i8(i8 %arg1, i8 %arg2) {
10 %res = sdiv i8 %arg1, %arg2
14 define i16 @test_sdiv_i16(i16 %arg1, i16 %arg2) {
15 %res = sdiv i16 %arg1, %arg2
19 define i32 @test_sdiv_i32(i32 %arg1, i32 %arg2) {
20 %res = sdiv i32 %arg1, %arg2
28 tracksRegLiveness: true
39 ; CHECK-LABEL: name: test_sdiv_i8
40 ; CHECK: liveins: $edi, $esi
41 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
42 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
43 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
44 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32)
45 ; CHECK: [[SDIV:%[0-9]+]]:_(s8) = G_SDIV [[TRUNC]], [[TRUNC1]]
46 ; CHECK: $al = COPY [[SDIV]](s8)
47 ; CHECK: RET 0, implicit $al
49 %0:_(s8) = G_TRUNC %2(s32)
51 %1:_(s8) = G_TRUNC %3(s32)
52 %4:_(s8) = G_SDIV %0, %1
60 tracksRegLiveness: true
71 ; CHECK-LABEL: name: test_sdiv_i16
72 ; CHECK: liveins: $edi, $esi
73 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
74 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
75 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
76 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
77 ; CHECK: [[SDIV:%[0-9]+]]:_(s16) = G_SDIV [[TRUNC]], [[TRUNC1]]
78 ; CHECK: $ax = COPY [[SDIV]](s16)
79 ; CHECK: RET 0, implicit $ax
81 %0:_(s16) = G_TRUNC %2(s32)
83 %1:_(s16) = G_TRUNC %3(s32)
84 %4:_(s16) = G_SDIV %0, %1
92 tracksRegLiveness: true
101 ; CHECK-LABEL: name: test_sdiv_i32
102 ; CHECK: liveins: $edi, $esi
103 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
104 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
105 ; CHECK: [[SDIV:%[0-9]+]]:_(s32) = G_SDIV [[COPY]], [[COPY1]]
106 ; CHECK: $eax = COPY [[SDIV]](s32)
107 ; CHECK: RET 0, implicit $eax
108 %0:_(s32) = COPY $edi
109 %1:_(s32) = COPY $esi
110 %2:_(s32) = G_SDIV %0, %1