@@ -9,22 +9,35 @@ name: abds_i8
99body : |
1010 bb.0.entry:
1111 liveins: $x10, $x11
12- ; CHECK-LABEL: name: abds_i8
13- ; CHECK: liveins: $x10, $x11
14- ; CHECK-NEXT: {{ $}}
15- ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
16- ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
17- ; CHECK-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 8
18- ; CHECK-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 8
19- ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
20- ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT1]], [[ASSERT_SEXT]]
21- ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(sgt), [[ASSERT_SEXT]](s64), [[ASSERT_SEXT1]]
22- ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SUB]](s64)
23- ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SUB1]](s64)
24- ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
25- ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
26- ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
27- ; CHECK-NEXT: PseudoRET implicit $x10
12+ ; RV64I-LABEL: name: abds_i8
13+ ; RV64I: liveins: $x10, $x11
14+ ; RV64I-NEXT: {{ $}}
15+ ; RV64I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
16+ ; RV64I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
17+ ; RV64I-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 8
18+ ; RV64I-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 8
19+ ; RV64I-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
20+ ; RV64I-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT1]], [[ASSERT_SEXT]]
21+ ; RV64I-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(sgt), [[ASSERT_SEXT]](s64), [[ASSERT_SEXT1]]
22+ ; RV64I-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SUB]](s64)
23+ ; RV64I-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SUB1]](s64)
24+ ; RV64I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
25+ ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
26+ ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
27+ ; RV64I-NEXT: PseudoRET implicit $x10
28+ ;
29+ ; RV64ZBB-LABEL: name: abds_i8
30+ ; RV64ZBB: liveins: $x10, $x11
31+ ; RV64ZBB-NEXT: {{ $}}
32+ ; RV64ZBB-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
33+ ; RV64ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
34+ ; RV64ZBB-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 8
35+ ; RV64ZBB-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 8
36+ ; RV64ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s64) = G_SMAX [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
37+ ; RV64ZBB-NEXT: [[SMIN:%[0-9]+]]:_(s64) = G_SMIN [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
38+ ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[SMAX]], [[SMIN]]
39+ ; RV64ZBB-NEXT: $x10 = COPY [[SUB]](s64)
40+ ; RV64ZBB-NEXT: PseudoRET implicit $x10
2841 %1:_(s64) = COPY $x10
2942 %2:_(s64) = COPY $x11
3043 %3:_(s64) = G_ASSERT_SEXT %1, 8
@@ -42,22 +55,35 @@ body: |
4255 bb.0.entry:
4356 liveins: $x10, $x11
4457
45- ; CHECK-LABEL: name: abds_i16
46- ; CHECK: liveins: $x10, $x11
47- ; CHECK-NEXT: {{ $}}
48- ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
49- ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
50- ; CHECK-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 16
51- ; CHECK-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 16
52- ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
53- ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT1]], [[ASSERT_SEXT]]
54- ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(sgt), [[ASSERT_SEXT]](s64), [[ASSERT_SEXT1]]
55- ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SUB]](s64)
56- ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SUB1]](s64)
57- ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
58- ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
59- ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
60- ; CHECK-NEXT: PseudoRET implicit $x10
58+ ; RV64I-LABEL: name: abds_i16
59+ ; RV64I: liveins: $x10, $x11
60+ ; RV64I-NEXT: {{ $}}
61+ ; RV64I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
62+ ; RV64I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
63+ ; RV64I-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 16
64+ ; RV64I-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 16
65+ ; RV64I-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
66+ ; RV64I-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT1]], [[ASSERT_SEXT]]
67+ ; RV64I-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(sgt), [[ASSERT_SEXT]](s64), [[ASSERT_SEXT1]]
68+ ; RV64I-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SUB]](s64)
69+ ; RV64I-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SUB1]](s64)
70+ ; RV64I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
71+ ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
72+ ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
73+ ; RV64I-NEXT: PseudoRET implicit $x10
74+ ;
75+ ; RV64ZBB-LABEL: name: abds_i16
76+ ; RV64ZBB: liveins: $x10, $x11
77+ ; RV64ZBB-NEXT: {{ $}}
78+ ; RV64ZBB-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
79+ ; RV64ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
80+ ; RV64ZBB-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 16
81+ ; RV64ZBB-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 16
82+ ; RV64ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s64) = G_SMAX [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
83+ ; RV64ZBB-NEXT: [[SMIN:%[0-9]+]]:_(s64) = G_SMIN [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
84+ ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[SMAX]], [[SMIN]]
85+ ; RV64ZBB-NEXT: $x10 = COPY [[SUB]](s64)
86+ ; RV64ZBB-NEXT: PseudoRET implicit $x10
6187 %1:_(s64) = COPY $x10
6288 %2:_(s64) = COPY $x11
6389 %3:_(s64) = G_ASSERT_SEXT %1, 16
@@ -75,24 +101,37 @@ body: |
75101 bb.0.entry:
76102 liveins: $x10, $x11
77103
78- ; CHECK-LABEL: name: abds_i32
79- ; CHECK: liveins: $x10, $x11
80- ; CHECK-NEXT: {{ $}}
81- ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
82- ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
83- ; CHECK-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32
84- ; CHECK-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 32
85- ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
86- ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB]], 32
87- ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SEXT_INREG]](s64)
88- ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT1]], [[ASSERT_SEXT]]
89- ; CHECK-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB1]], 32
90- ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SEXT_INREG1]](s64)
91- ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(sgt), [[ASSERT_SEXT]](s64), [[ASSERT_SEXT1]]
92- ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
93- ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
94- ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
95- ; CHECK-NEXT: PseudoRET implicit $x10
104+ ; RV64I-LABEL: name: abds_i32
105+ ; RV64I: liveins: $x10, $x11
106+ ; RV64I-NEXT: {{ $}}
107+ ; RV64I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
108+ ; RV64I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
109+ ; RV64I-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32
110+ ; RV64I-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 32
111+ ; RV64I-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
112+ ; RV64I-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB]], 32
113+ ; RV64I-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SEXT_INREG]](s64)
114+ ; RV64I-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT1]], [[ASSERT_SEXT]]
115+ ; RV64I-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB1]], 32
116+ ; RV64I-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SEXT_INREG1]](s64)
117+ ; RV64I-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(sgt), [[ASSERT_SEXT]](s64), [[ASSERT_SEXT1]]
118+ ; RV64I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
119+ ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
120+ ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
121+ ; RV64I-NEXT: PseudoRET implicit $x10
122+ ;
123+ ; RV64ZBB-LABEL: name: abds_i32
124+ ; RV64ZBB: liveins: $x10, $x11
125+ ; RV64ZBB-NEXT: {{ $}}
126+ ; RV64ZBB-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
127+ ; RV64ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
128+ ; RV64ZBB-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32
129+ ; RV64ZBB-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 32
130+ ; RV64ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s64) = G_SMAX [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
131+ ; RV64ZBB-NEXT: [[SMIN:%[0-9]+]]:_(s64) = G_SMIN [[ASSERT_SEXT]], [[ASSERT_SEXT1]]
132+ ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[SMAX]], [[SMIN]]
133+ ; RV64ZBB-NEXT: $x10 = COPY [[SUB]](s64)
134+ ; RV64ZBB-NEXT: PseudoRET implicit $x10
96135 %1:_(s64) = COPY $x10
97136 %2:_(s64) = COPY $x11
98137 %3:_(s64) = G_ASSERT_SEXT %1, 32
@@ -138,22 +177,35 @@ name: abdu_i8
138177body : |
139178 bb.0.entry:
140179 liveins: $x10, $x11
141- ; CHECK-LABEL: name: abdu_i8
142- ; CHECK: liveins: $x10, $x11
143- ; CHECK-NEXT: {{ $}}
144- ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
145- ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
146- ; CHECK-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 8
147- ; CHECK-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 8
148- ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
149- ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT1]], [[ASSERT_ZEXT]]
150- ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ugt), [[ASSERT_ZEXT]](s64), [[ASSERT_ZEXT1]]
151- ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SUB]](s64)
152- ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SUB1]](s64)
153- ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
154- ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
155- ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
156- ; CHECK-NEXT: PseudoRET implicit $x10
180+ ; RV64I-LABEL: name: abdu_i8
181+ ; RV64I: liveins: $x10, $x11
182+ ; RV64I-NEXT: {{ $}}
183+ ; RV64I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
184+ ; RV64I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
185+ ; RV64I-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 8
186+ ; RV64I-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 8
187+ ; RV64I-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
188+ ; RV64I-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT1]], [[ASSERT_ZEXT]]
189+ ; RV64I-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ugt), [[ASSERT_ZEXT]](s64), [[ASSERT_ZEXT1]]
190+ ; RV64I-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SUB]](s64)
191+ ; RV64I-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SUB1]](s64)
192+ ; RV64I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
193+ ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
194+ ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
195+ ; RV64I-NEXT: PseudoRET implicit $x10
196+ ;
197+ ; RV64ZBB-LABEL: name: abdu_i8
198+ ; RV64ZBB: liveins: $x10, $x11
199+ ; RV64ZBB-NEXT: {{ $}}
200+ ; RV64ZBB-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
201+ ; RV64ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
202+ ; RV64ZBB-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 8
203+ ; RV64ZBB-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 8
204+ ; RV64ZBB-NEXT: [[UMAX:%[0-9]+]]:_(s64) = G_UMAX [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
205+ ; RV64ZBB-NEXT: [[UMIN:%[0-9]+]]:_(s64) = G_UMIN [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
206+ ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[UMAX]], [[UMIN]]
207+ ; RV64ZBB-NEXT: $x10 = COPY [[SUB]](s64)
208+ ; RV64ZBB-NEXT: PseudoRET implicit $x10
157209 %1:_(s64) = COPY $x10
158210 %2:_(s64) = COPY $x11
159211 %3:_(s64) = G_ASSERT_ZEXT %1, 8
@@ -171,22 +223,35 @@ body: |
171223 bb.0.entry:
172224 liveins: $x10, $x11
173225
174- ; CHECK-LABEL: name: abdu_i16
175- ; CHECK: liveins: $x10, $x11
176- ; CHECK-NEXT: {{ $}}
177- ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
178- ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
179- ; CHECK-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 16
180- ; CHECK-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 16
181- ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
182- ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT1]], [[ASSERT_ZEXT]]
183- ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ugt), [[ASSERT_ZEXT]](s64), [[ASSERT_ZEXT1]]
184- ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SUB]](s64)
185- ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SUB1]](s64)
186- ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
187- ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
188- ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
189- ; CHECK-NEXT: PseudoRET implicit $x10
226+ ; RV64I-LABEL: name: abdu_i16
227+ ; RV64I: liveins: $x10, $x11
228+ ; RV64I-NEXT: {{ $}}
229+ ; RV64I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
230+ ; RV64I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
231+ ; RV64I-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 16
232+ ; RV64I-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 16
233+ ; RV64I-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
234+ ; RV64I-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT1]], [[ASSERT_ZEXT]]
235+ ; RV64I-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ugt), [[ASSERT_ZEXT]](s64), [[ASSERT_ZEXT1]]
236+ ; RV64I-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SUB]](s64)
237+ ; RV64I-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SUB1]](s64)
238+ ; RV64I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
239+ ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
240+ ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
241+ ; RV64I-NEXT: PseudoRET implicit $x10
242+ ;
243+ ; RV64ZBB-LABEL: name: abdu_i16
244+ ; RV64ZBB: liveins: $x10, $x11
245+ ; RV64ZBB-NEXT: {{ $}}
246+ ; RV64ZBB-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
247+ ; RV64ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
248+ ; RV64ZBB-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 16
249+ ; RV64ZBB-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 16
250+ ; RV64ZBB-NEXT: [[UMAX:%[0-9]+]]:_(s64) = G_UMAX [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
251+ ; RV64ZBB-NEXT: [[UMIN:%[0-9]+]]:_(s64) = G_UMIN [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
252+ ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[UMAX]], [[UMIN]]
253+ ; RV64ZBB-NEXT: $x10 = COPY [[SUB]](s64)
254+ ; RV64ZBB-NEXT: PseudoRET implicit $x10
190255 %1:_(s64) = COPY $x10
191256 %2:_(s64) = COPY $x11
192257 %3:_(s64) = G_ASSERT_ZEXT %1, 16
@@ -204,26 +269,39 @@ body: |
204269 bb.0.entry:
205270 liveins: $x10, $x11
206271
207- ; CHECK-LABEL: name: abdu_i32
208- ; CHECK: liveins: $x10, $x11
209- ; CHECK-NEXT: {{ $}}
210- ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
211- ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
212- ; CHECK-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 32
213- ; CHECK-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 32
214- ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
215- ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB]], 32
216- ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SEXT_INREG]](s64)
217- ; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT1]], [[ASSERT_ZEXT]]
218- ; CHECK-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB1]], 32
219- ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SEXT_INREG1]](s64)
220- ; CHECK-NEXT: [[SEXT_INREG2:%[0-9]+]]:_(s64) = G_SEXT_INREG [[ASSERT_ZEXT]], 32
221- ; CHECK-NEXT: [[SEXT_INREG3:%[0-9]+]]:_(s64) = G_SEXT_INREG [[ASSERT_ZEXT1]], 32
222- ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ugt), [[SEXT_INREG2]](s64), [[SEXT_INREG3]]
223- ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
224- ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
225- ; CHECK-NEXT: $x10 = COPY [[ANYEXT]](s64)
226- ; CHECK-NEXT: PseudoRET implicit $x10
272+ ; RV64I-LABEL: name: abdu_i32
273+ ; RV64I: liveins: $x10, $x11
274+ ; RV64I-NEXT: {{ $}}
275+ ; RV64I-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
276+ ; RV64I-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
277+ ; RV64I-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 32
278+ ; RV64I-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 32
279+ ; RV64I-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
280+ ; RV64I-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB]], 32
281+ ; RV64I-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SEXT_INREG]](s64)
282+ ; RV64I-NEXT: [[SUB1:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_ZEXT1]], [[ASSERT_ZEXT]]
283+ ; RV64I-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB1]], 32
284+ ; RV64I-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[SEXT_INREG1]](s64)
285+ ; RV64I-NEXT: [[SEXT_INREG2:%[0-9]+]]:_(s64) = G_SEXT_INREG [[ASSERT_ZEXT]], 32
286+ ; RV64I-NEXT: [[SEXT_INREG3:%[0-9]+]]:_(s64) = G_SEXT_INREG [[ASSERT_ZEXT1]], 32
287+ ; RV64I-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ugt), [[SEXT_INREG2]](s64), [[SEXT_INREG3]]
288+ ; RV64I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s64), [[TRUNC]], [[TRUNC1]]
289+ ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[SELECT]](s32)
290+ ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
291+ ; RV64I-NEXT: PseudoRET implicit $x10
292+ ;
293+ ; RV64ZBB-LABEL: name: abdu_i32
294+ ; RV64ZBB: liveins: $x10, $x11
295+ ; RV64ZBB-NEXT: {{ $}}
296+ ; RV64ZBB-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
297+ ; RV64ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
298+ ; RV64ZBB-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 32
299+ ; RV64ZBB-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 32
300+ ; RV64ZBB-NEXT: [[UMAX:%[0-9]+]]:_(s64) = G_UMAX [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
301+ ; RV64ZBB-NEXT: [[UMIN:%[0-9]+]]:_(s64) = G_UMIN [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]]
302+ ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[UMAX]], [[UMIN]]
303+ ; RV64ZBB-NEXT: $x10 = COPY [[SUB]](s64)
304+ ; RV64ZBB-NEXT: PseudoRET implicit $x10
227305 %1:_(s64) = COPY $x10
228306 %2:_(s64) = COPY $x11
229307 %3:_(s64) = G_ASSERT_ZEXT %1, 32
0 commit comments