1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \
8 ; CHECK-LABEL: name: and_i7
9 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
10 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
11 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]]
12 ; CHECK-NEXT: $x10 = COPY [[AND]](s32)
13 ; CHECK-NEXT: PseudoRET implicit $x10
16 %2:_(s7) = G_TRUNC %0(s32)
17 %3:_(s7) = G_TRUNC %1(s32)
18 %4:_(s7) = G_AND %2, %3
19 %5:_(s32) = G_ANYEXT %4(s7)
21 PseudoRET implicit $x10
28 ; CHECK-LABEL: name: and_i8
29 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
30 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
31 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]]
32 ; CHECK-NEXT: $x10 = COPY [[AND]](s32)
33 ; CHECK-NEXT: PseudoRET implicit $x10
36 %2:_(s8) = G_TRUNC %0(s32)
37 %3:_(s8) = G_TRUNC %1(s32)
38 %4:_(s8) = G_AND %2, %3
39 %5:_(s32) = G_ANYEXT %4(s8)
41 PseudoRET implicit $x10
48 ; CHECK-LABEL: name: and_i16
49 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
51 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]]
52 ; CHECK-NEXT: $x10 = COPY [[AND]](s32)
53 ; CHECK-NEXT: PseudoRET implicit $x10
56 %2:_(s16) = G_TRUNC %0(s32)
57 %3:_(s16) = G_TRUNC %1(s32)
58 %4:_(s16) = G_AND %2, %3
59 %5:_(s32) = G_ANYEXT %4(s16)
61 PseudoRET implicit $x10
68 ; CHECK-LABEL: name: and_i32
69 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
70 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
71 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]]
72 ; CHECK-NEXT: $x10 = COPY [[AND]](s32)
73 ; CHECK-NEXT: PseudoRET implicit $x10
76 %2:_(s32) = G_AND %0, %1
78 PseudoRET implicit $x10
85 ; CHECK-LABEL: name: and_i48
86 ; CHECK: %xlo:_(s32) = COPY $x10
87 ; CHECK-NEXT: %xhi:_(s32) = COPY $x11
88 ; CHECK-NEXT: %ylo:_(s32) = COPY $x12
89 ; CHECK-NEXT: %yhi:_(s32) = COPY $x13
90 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND %xlo, %ylo
91 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND %xhi, %yhi
92 ; CHECK-NEXT: $x10 = COPY [[AND]](s32)
93 ; CHECK-NEXT: $x11 = COPY [[AND1]](s32)
94 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
95 %xlo:_(s32) = COPY $x10
96 %xhi:_(s32) = COPY $x11
97 %ylo:_(s32) = COPY $x12
98 %yhi:_(s32) = COPY $x13
99 %x0:_(s64) = G_MERGE_VALUES %xlo(s32), %xhi(s32)
100 %y0:_(s64) = G_MERGE_VALUES %ylo(s32), %yhi(s32)
101 %x:_(s48) = G_TRUNC %x0(s64)
102 %y:_(s48) = G_TRUNC %y0(s64)
103 %z:_(s48) = G_AND %x, %y
104 %z0:_(s64) = G_ANYEXT %z(s48)
105 %zlo:_(s32), %zhi:_(s32) = G_UNMERGE_VALUES %z0(s64)
106 $x10 = COPY %zlo(s32)
107 $x11 = COPY %zhi(s32)
108 PseudoRET implicit $x10, implicit $x11
115 ; CHECK-LABEL: name: and_i64
116 ; CHECK: %lo1:_(s32) = COPY $x10
117 ; CHECK-NEXT: %hi1:_(s32) = COPY $x11
118 ; CHECK-NEXT: %lo2:_(s32) = COPY $x12
119 ; CHECK-NEXT: %hi2:_(s32) = COPY $x13
120 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND %lo1, %lo2
121 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND %hi1, %hi2
122 ; CHECK-NEXT: $x10 = COPY [[AND]](s32)
123 ; CHECK-NEXT: $x11 = COPY [[AND1]](s32)
124 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
125 %lo1:_(s32) = COPY $x10
126 %hi1:_(s32) = COPY $x11
127 %lo2:_(s32) = COPY $x12
128 %hi2:_(s32) = COPY $x13
129 %x1:_(s64) = G_MERGE_VALUES %lo1(s32), %hi1(s32)
130 %x2:_(s64) = G_MERGE_VALUES %lo2(s32), %hi2(s32)
131 %y:_(s64) = G_AND %x1, %x2
132 %loy:_(s32), %hiy:_(s32) = G_UNMERGE_VALUES %y(s64)
133 $x10 = COPY %loy(s32)
134 $x11 = COPY %hiy(s32)
135 PseudoRET implicit $x10, implicit $x11
142 ; CHECK-LABEL: name: and_i96
143 ; CHECK: %lo1:_(s32) = COPY $x10
144 ; CHECK-NEXT: %mid1:_(s32) = COPY $x11
145 ; CHECK-NEXT: %hi1:_(s32) = COPY $x12
146 ; CHECK-NEXT: %lo2:_(s32) = COPY $x13
147 ; CHECK-NEXT: %mid2:_(s32) = COPY $x14
148 ; CHECK-NEXT: %hi2:_(s32) = COPY $x15
149 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND %lo1, %lo2
150 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND %mid1, %mid2
151 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND %hi1, %hi2
152 ; CHECK-NEXT: $x10 = COPY [[AND]](s32)
153 ; CHECK-NEXT: $x11 = COPY [[AND1]](s32)
154 ; CHECK-NEXT: $x12 = COPY [[AND2]](s32)
155 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11, implicit $x12
156 %lo1:_(s32) = COPY $x10
157 %mid1:_(s32) = COPY $x11
158 %hi1:_(s32) = COPY $x12
159 %lo2:_(s32) = COPY $x13
160 %mid2:_(s32) = COPY $x14
161 %hi2:_(s32) = COPY $x15
162 %x1:_(s96) = G_MERGE_VALUES %lo1(s32), %mid1(s32), %hi1(s32)
163 %x2:_(s96) = G_MERGE_VALUES %lo2(s32), %mid2(s32), %hi2(s32)
164 %y:_(s96) = G_AND %x1, %x2
165 %lo:_(s32), %mid:_(s32), %hi:_(s32) = G_UNMERGE_VALUES %y(s96)
167 $x11 = COPY %mid(s32)
169 PseudoRET implicit $x10, implicit $x11, implicit $x12