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 3 4--- | 5 ; ModuleID = 'sdiv.ll' 6 source_filename = "sdiv.ll" 7 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 8 9 define i8 @test_sdiv_i8(i8 %arg1, i8 %arg2) { 10 %res = sdiv i8 %arg1, %arg2 11 ret i8 %res 12 } 13 14 define i16 @test_sdiv_i16(i16 %arg1, i16 %arg2) { 15 %res = sdiv i16 %arg1, %arg2 16 ret i16 %res 17 } 18 19 define i32 @test_sdiv_i32(i32 %arg1, i32 %arg2) { 20 %res = sdiv i32 %arg1, %arg2 21 ret i32 %res 22 } 23 24... 25--- 26name: test_sdiv_i8 27alignment: 4 28tracksRegLiveness: true 29registers: 30 - { id: 0, class: _ } 31 - { id: 1, class: _ } 32 - { id: 2, class: _ } 33 - { id: 3, class: _ } 34 - { id: 4, class: _ } 35body: | 36 bb.1 (%ir-block.0): 37 liveins: $edi, $esi 38 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 48 %2:_(s32) = COPY $edi 49 %0:_(s8) = G_TRUNC %2(s32) 50 %3:_(s32) = COPY $esi 51 %1:_(s8) = G_TRUNC %3(s32) 52 %4:_(s8) = G_SDIV %0, %1 53 $al = COPY %4(s8) 54 RET 0, implicit $al 55 56... 57--- 58name: test_sdiv_i16 59alignment: 4 60tracksRegLiveness: true 61registers: 62 - { id: 0, class: _ } 63 - { id: 1, class: _ } 64 - { id: 2, class: _ } 65 - { id: 3, class: _ } 66 - { id: 4, class: _ } 67body: | 68 bb.1 (%ir-block.0): 69 liveins: $edi, $esi 70 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 80 %2:_(s32) = COPY $edi 81 %0:_(s16) = G_TRUNC %2(s32) 82 %3:_(s32) = COPY $esi 83 %1:_(s16) = G_TRUNC %3(s32) 84 %4:_(s16) = G_SDIV %0, %1 85 $ax = COPY %4(s16) 86 RET 0, implicit $ax 87 88... 89--- 90name: test_sdiv_i32 91alignment: 4 92tracksRegLiveness: true 93registers: 94 - { id: 0, class: _ } 95 - { id: 1, class: _ } 96 - { id: 2, class: _ } 97body: | 98 bb.1 (%ir-block.0): 99 liveins: $edi, $esi 100 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 111 $eax = COPY %2(s32) 112 RET 0, implicit $eax 113 114... 115