1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -O0 -run-pass=legalizer -o - %s | FileCheck %s
8 liveins: $vgpr0, $vgpr1
10 ; CHECK-LABEL: name: test_ssubo_s16
11 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
12 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
13 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
14 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
15 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY2]], [[COPY3]]
16 ; CHECK: [[C:%[0-9]+]]:_(s16) = G_CONSTANT i16 0
17 ; CHECK: [[COPY4:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
18 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
19 ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY4]], [[C1]](s32)
20 ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C1]](s32)
21 ; CHECK: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
22 ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY5]], [[C1]](s32)
23 ; CHECK: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]](s32)
24 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(slt), [[ASHR]](s32), [[ASHR1]]
25 ; CHECK: [[COPY6:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
26 ; CHECK: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[COPY6]], [[C1]](s32)
27 ; CHECK: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[SHL2]], [[C1]](s32)
28 ; CHECK: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[C]](s16)
29 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(sgt), [[ASHR2]](s32), [[SEXT]]
30 ; CHECK: [[XOR:%[0-9]+]]:_(s1) = G_XOR [[ICMP1]], [[ICMP]]
31 ; CHECK: [[COPY7:%[0-9]+]]:_(s32) = COPY [[SUB]](s32)
32 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[XOR]](s1)
33 ; CHECK: $vgpr0 = COPY [[COPY7]](s32)
34 ; CHECK: $vgpr1 = COPY [[ZEXT]](s32)
35 %0:_(s32) = COPY $vgpr0
36 %1:_(s32) = COPY $vgpr1
37 %2:_(s16) = G_TRUNC %0
38 %3:_(s16) = G_TRUNC %1
39 %4:_(s16), %5:_(s1) = G_SSUBO %2, %3
40 %6:_(s32) = G_ANYEXT %4
50 liveins: $vgpr0, $vgpr1
52 ; CHECK-LABEL: name: test_ssubo_s32
53 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
54 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
55 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]]
56 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
57 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(slt), [[SUB]](s32), [[COPY]]
58 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(sgt), [[COPY1]](s32), [[C]]
59 ; CHECK: [[XOR:%[0-9]+]]:_(s1) = G_XOR [[ICMP1]], [[ICMP]]
60 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[XOR]](s1)
61 ; CHECK: $vgpr0 = COPY [[SUB]](s32)
62 ; CHECK: $vgpr1 = COPY [[ZEXT]](s32)
63 %0:_(s32) = COPY $vgpr0
64 %1:_(s32) = COPY $vgpr1
65 %2:_(s32), %3:_(s1) = G_SSUBO %0, %1
75 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
77 ; CHECK-LABEL: name: test_ssubo_s64
78 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
79 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
80 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
81 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](s64)
82 ; CHECK: [[USUBO:%[0-9]+]]:_(s32), [[USUBO1:%[0-9]+]]:_(s1) = G_USUBO [[UV]], [[UV2]]
83 ; CHECK: [[USUBE:%[0-9]+]]:_(s32), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[UV1]], [[UV3]], [[USUBO1]]
84 ; CHECK: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[USUBO]](s32), [[USUBE]](s32)
85 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
86 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(slt), [[MV]](s64), [[COPY]]
87 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(sgt), [[COPY1]](s64), [[C]]
88 ; CHECK: [[XOR:%[0-9]+]]:_(s1) = G_XOR [[ICMP1]], [[ICMP]]
89 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[XOR]](s1)
90 ; CHECK: $vgpr0_vgpr1 = COPY [[MV]](s64)
91 ; CHECK: $vgpr2 = COPY [[ZEXT]](s32)
92 %0:_(s64) = COPY $vgpr0_vgpr1
93 %1:_(s64) = COPY $vgpr2_vgpr3
94 %2:_(s64), %3:_(s1) = G_SSUBO %0, %1
96 $vgpr0_vgpr1 = COPY %2
101 name: test_ssubo_v2s32
104 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
106 ; CHECK-LABEL: name: test_ssubo_v2s32
107 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
108 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
109 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
110 ; CHECK: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
111 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[UV]], [[UV2]]
112 ; CHECK: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[UV1]], [[UV3]]
113 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[SUB]](s32), [[SUB1]](s32)
114 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
115 ; CHECK: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
116 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(slt), [[SUB]](s32), [[UV4]]
117 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(slt), [[SUB1]](s32), [[UV5]]
118 ; CHECK: [[UV6:%[0-9]+]]:_(s32), [[UV7:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
119 ; CHECK: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(sgt), [[UV6]](s32), [[C]]
120 ; CHECK: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(sgt), [[UV7]](s32), [[C]]
121 ; CHECK: [[XOR:%[0-9]+]]:_(s1) = G_XOR [[ICMP2]], [[ICMP]]
122 ; CHECK: [[XOR1:%[0-9]+]]:_(s1) = G_XOR [[ICMP3]], [[ICMP1]]
123 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[XOR]](s1)
124 ; CHECK: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[XOR1]](s1)
125 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
126 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
127 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
128 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ANYEXT1]](s32)
129 ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C1]]
130 ; CHECK: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32)
131 ; CHECK: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
132 ; CHECK: $vgpr2_vgpr3 = COPY [[BUILD_VECTOR1]](<2 x s32>)
133 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
134 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
135 %2:_(<2 x s32>), %3:_(<2 x s1>) = G_SSUBO %0, %1
136 %4:_(<2 x s32>) = G_ZEXT %3
137 $vgpr0_vgpr1 = COPY %2
138 $vgpr2_vgpr3 = COPY %4