1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
5 define void @any_i64() {entry: ret void}
6 define void @any_i32() {entry: ret void}
7 define void @signed_i16() {entry: ret void}
8 define void @signed_i8() {entry: ret void}
9 define void @unsigned_i16() {entry: ret void}
10 define void @unsigned_i8() {entry: ret void}
11 define void @i1_true() {entry: ret void}
12 define void @i1_false() {entry: ret void}
18 tracksRegLiveness: true
21 ; MIPS32-LABEL: name: any_i64
22 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
23 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
24 ; MIPS32: $v0 = COPY [[C1]](s32)
25 ; MIPS32: $v1 = COPY [[C]](s32)
26 ; MIPS32: RetRA implicit $v0, implicit $v1
27 %0:_(s64) = G_CONSTANT i64 -9223372036854775808
28 %1:_(s32), %2:_(s32) = G_UNMERGE_VALUES %0(s64)
31 RetRA implicit $v0, implicit $v1
37 tracksRegLiveness: true
40 ; MIPS32-LABEL: name: any_i32
41 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
42 ; MIPS32: $v0 = COPY [[C]](s32)
43 ; MIPS32: RetRA implicit $v0
44 %0:_(s32) = G_CONSTANT i32 -2147483648
52 tracksRegLiveness: true
55 ; MIPS32-LABEL: name: signed_i16
56 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
57 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY [[C]](s32)
58 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
59 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C1]](s32)
60 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C1]](s32)
61 ; MIPS32: $v0 = COPY [[ASHR]](s32)
62 ; MIPS32: RetRA implicit $v0
63 %0:_(s16) = G_CONSTANT i16 -32768
64 %1:_(s32) = G_SEXT %0(s16)
72 tracksRegLiveness: true
75 ; MIPS32-LABEL: name: signed_i8
76 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -128
77 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY [[C]](s32)
78 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
79 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C1]](s32)
80 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C1]](s32)
81 ; MIPS32: $v0 = COPY [[ASHR]](s32)
82 ; MIPS32: RetRA implicit $v0
83 %0:_(s8) = G_CONSTANT i8 -128
84 %1:_(s32) = G_SEXT %0(s8)
92 tracksRegLiveness: true
95 ; MIPS32-LABEL: name: unsigned_i16
96 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -32768
97 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
98 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY [[C]](s32)
99 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]]
100 ; MIPS32: $v0 = COPY [[AND]](s32)
101 ; MIPS32: RetRA implicit $v0
102 %0:_(s16) = G_CONSTANT i16 -32768
103 %1:_(s32) = G_ZEXT %0(s16)
111 tracksRegLiveness: true
114 ; MIPS32-LABEL: name: unsigned_i8
115 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -128
116 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
117 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY [[C]](s32)
118 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]]
119 ; MIPS32: $v0 = COPY [[AND]](s32)
120 ; MIPS32: RetRA implicit $v0
121 %0:_(s8) = G_CONSTANT i8 -128
122 %1:_(s32) = G_ZEXT %0(s8)
130 tracksRegLiveness: true
133 ; MIPS32-LABEL: name: i1_true
134 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
135 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
136 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY [[C]](s32)
137 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]]
138 ; MIPS32: $v0 = COPY [[AND]](s32)
139 ; MIPS32: RetRA implicit $v0
140 %0:_(s1) = G_CONSTANT i1 true
141 %1:_(s32) = G_ZEXT %0(s1)
149 tracksRegLiveness: true
152 ; MIPS32-LABEL: name: i1_false
153 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
154 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
155 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY [[C]](s32)
156 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]]
157 ; MIPS32: $v0 = COPY [[AND]](s32)
158 ; MIPS32: RetRA implicit $v0
159 %0:_(s1) = G_CONSTANT i1 false
160 %1:_(s32) = G_ZEXT %0(s1)