1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK
--- |
define i1 @trunc_i32toi1(i32 %a) {
%r = trunc i32 %a to i1
ret i1 %r
}
define i8 @trunc_i32toi8(i32 %a) {
%r = trunc i32 %a to i8
ret i8 %r
}
define i16 @trunc_i32toi16(i32 %a) {
%r = trunc i32 %a to i16
ret i16 %r
}
define i8 @trunc_i64toi8(i64 %a) {
%r = trunc i64 %a to i8
ret i8 %r
}
define i16 @trunc_i64toi16(i64 %a) {
%r = trunc i64 %a to i16
ret i16 %r
}
define i32 @trunc_i64toi32(i64 %a) {
%r = trunc i64 %a to i32
ret i32 %r
}
...
---
name: trunc_i32toi1
alignment: 16
legalized: true
regBankSelected: true
registers:
- { id: 0, class: gpr }
- { id: 1, class: gpr }
- { id: 2, class: gpr }
body: |
bb.1 (%ir-block.0):
liveins: $edi
; CHECK-LABEL: name: trunc_i32toi1
; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
; CHECK: $al = COPY [[COPY1]]
; CHECK: RET 0, implicit $al
%0(s32) = COPY $edi
%1(s1) = G_TRUNC %0(s32)
%2(s8) = G_ANYEXT %1(s1)
$al = COPY %2(s8)
RET 0, implicit $al
...
---
name: trunc_i32toi8
alignment: 16
legalized: true
regBankSelected: true
registers:
- { id: 0, class: gpr }
- { id: 1, class: gpr }
body: |
bb.1 (%ir-block.0):
liveins: $edi
; CHECK-LABEL: name: trunc_i32toi8
; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
; CHECK: $al = COPY [[COPY1]]
; CHECK: RET 0, implicit $al
%0(s32) = COPY $edi
%1(s8) = G_TRUNC %0(s32)
$al = COPY %1(s8)
RET 0, implicit $al
...
---
name: trunc_i32toi16
alignment: 16
legalized: true
regBankSelected: true
registers:
- { id: 0, class: gpr }
- { id: 1, class: gpr }
body: |
bb.1 (%ir-block.0):
liveins: $edi
; CHECK-LABEL: name: trunc_i32toi16
; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
; CHECK: [[COPY1:%[0-9]+]]:gr16 = COPY [[COPY]].sub_16bit
; CHECK: $ax = COPY [[COPY1]]
; CHECK: RET 0, implicit $ax
%0(s32) = COPY $edi
%1(s16) = G_TRUNC %0(s32)
$ax = COPY %1(s16)
RET 0, implicit $ax
...
---
name: trunc_i64toi8
alignment: 16
legalized: true
regBankSelected: true
registers:
- { id: 0, class: gpr }
- { id: 1, class: gpr }
body: |
bb.1 (%ir-block.0):
liveins: $rdi
; CHECK-LABEL: name: trunc_i64toi8
; CHECK: [[COPY:%[0-9]+]]:gr64_with_sub_8bit = COPY $rdi
; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
; CHECK: $al = COPY [[COPY1]]
; CHECK: RET 0, implicit $al
%0(s64) = COPY $rdi
%1(s8) = G_TRUNC %0(s64)
$al = COPY %1(s8)
RET 0, implicit $al
...
---
name: trunc_i64toi16
alignment: 16
legalized: true
regBankSelected: true
registers:
- { id: 0, class: gpr }
- { id: 1, class: gpr }
body: |
bb.1 (%ir-block.0):
liveins: $rdi
; CHECK-LABEL: name: trunc_i64toi16
; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
; CHECK: [[COPY1:%[0-9]+]]:gr16 = COPY [[COPY]].sub_16bit
; CHECK: $ax = COPY [[COPY1]]
; CHECK: RET 0, implicit $ax
%0(s64) = COPY $rdi
%1(s16) = G_TRUNC %0(s64)
$ax = COPY %1(s16)
RET 0, implicit $ax
...
---
name: trunc_i64toi32
alignment: 16
legalized: true
regBankSelected: true
registers:
- { id: 0, class: gpr }
- { id: 1, class: gpr }
body: |
bb.1 (%ir-block.0):
liveins: $rdi
; CHECK-LABEL: name: trunc_i64toi32
; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
; CHECK: [[COPY1:%[0-9]+]]:gr32 = COPY [[COPY]].sub_32bit
; CHECK: $eax = COPY [[COPY1]]
; CHECK: RET 0, implicit $eax
%0(s64) = COPY $rdi
%1(s32) = G_TRUNC %0(s64)
$eax = COPY %1(s32)
RET 0, implicit $eax
...
|