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 = "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
24 define i64 @test_sdiv_i64(i64 %arg1, i64 %arg2) {
25 %res = sdiv i64 %arg1, %arg2
33 tracksRegLiveness: true
44 ; CHECK-LABEL: name: test_sdiv_i8
45 ; CHECK: liveins: $edi, $esi
46 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
47 ; CHECK: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
48 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
49 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32)
50 ; CHECK: [[SDIV:%[0-9]+]]:_(s8) = G_SDIV [[TRUNC]], [[TRUNC1]]
51 ; CHECK: $al = COPY [[SDIV]](s8)
52 ; CHECK: RET 0, implicit $al
54 %0:_(s8) = G_TRUNC %2(s32)
56 %1:_(s8) = G_TRUNC %3(s32)
57 %4:_(s8) = G_SDIV %0, %1
65 tracksRegLiveness: true
76 ; CHECK-LABEL: name: test_sdiv_i16
77 ; CHECK: liveins: $edi, $esi
78 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
79 ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
80 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
81 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
82 ; CHECK: [[SDIV:%[0-9]+]]:_(s16) = G_SDIV [[TRUNC]], [[TRUNC1]]
83 ; CHECK: $ax = COPY [[SDIV]](s16)
84 ; CHECK: RET 0, implicit $ax
86 %0:_(s16) = G_TRUNC %2(s32)
88 %1:_(s16) = G_TRUNC %3(s32)
89 %4:_(s16) = G_SDIV %0, %1
97 tracksRegLiveness: true
100 - { id: 1, class: _ }
101 - { id: 2, class: _ }
106 ; CHECK-LABEL: name: test_sdiv_i32
107 ; CHECK: liveins: $edi, $esi
108 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
109 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
110 ; CHECK: [[SDIV:%[0-9]+]]:_(s32) = G_SDIV [[COPY]], [[COPY1]]
111 ; CHECK: $eax = COPY [[SDIV]](s32)
112 ; CHECK: RET 0, implicit $eax
113 %0:_(s32) = COPY $edi
114 %1:_(s32) = COPY $esi
115 %2:_(s32) = G_SDIV %0, %1
123 tracksRegLiveness: true
125 - { id: 0, class: _ }
126 - { id: 1, class: _ }
127 - { id: 2, class: _ }
132 ; CHECK-LABEL: name: test_sdiv_i64
133 ; CHECK: liveins: $rdi, $rsi
134 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $rdi
135 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $rsi
136 ; CHECK: [[SDIV:%[0-9]+]]:_(s64) = G_SDIV [[COPY]], [[COPY1]]
137 ; CHECK: $rax = COPY [[SDIV]](s64)
138 ; CHECK: RET 0, implicit $rax
139 %0:_(s64) = COPY $rdi
140 %1:_(s64) = COPY $rsi
141 %2:_(s64) = G_SDIV %0, %1