1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer %s -o - | FileCheck %s
8 liveins: $vgpr0, $vgpr1, $vgpr2
10 ; CHECK-LABEL: name: test_uadde_s32
11 ; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
14 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
15 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
16 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
17 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
18 ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY1]], [[ICMP]]
19 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[UADDE1]](s1)
20 ; CHECK-NEXT: $vgpr0 = COPY [[UADDE]](s32)
21 ; CHECK-NEXT: $vgpr1 = COPY [[ZEXT]](s32)
22 %0:_(s32) = COPY $vgpr0
23 %1:_(s32) = COPY $vgpr1
24 %2:_(s32) = COPY $vgpr2
25 %3:_(s32) = G_CONSTANT i32 0
26 %4:_(s1) = G_ICMP intpred(eq), %2, %3
27 %5:_(s32), %6:_(s1) = G_UADDE %0, %1, %4
34 name: test_uadde_v2s32
37 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5
39 ; CHECK-LABEL: name: test_uadde_v2s32
40 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5
42 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
43 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr2_vgpr3
44 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr4_vgpr5
45 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
46 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY2]](<2 x s32>)
47 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[UV]](s32), [[C]]
48 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[UV1]](s32), [[C]]
49 ; CHECK-NEXT: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
50 ; CHECK-NEXT: [[UV4:%[0-9]+]]:_(s32), [[UV5:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](<2 x s32>)
51 ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV2]], [[UV4]], [[ICMP]]
52 ; CHECK-NEXT: [[UADDE2:%[0-9]+]]:_(s32), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[UV3]], [[UV5]], [[ICMP1]]
53 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[UADDE]](s32), [[UADDE2]](s32)
54 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[UADDE1]](s1)
55 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[UADDE3]](s1)
56 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
57 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C1]]
58 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ANYEXT1]], [[C1]]
59 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[AND]](s32), [[AND1]](s32)
60 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
61 ; CHECK-NEXT: $vgpr2_vgpr3 = COPY [[BUILD_VECTOR1]](<2 x s32>)
62 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
63 %1:_(<2 x s32>) = COPY $vgpr2_vgpr3
64 %2:_(<2 x s32>) = COPY $vgpr4_vgpr5
65 %3:_(s32) = G_CONSTANT i32 0
66 %4:_(<2 x s32>) = G_BUILD_VECTOR %3, %3
67 %5:_(<2 x s1>) = G_ICMP intpred(eq), %2, %4
68 %6:_(<2 x s32>), %7:_(<2 x s1>) = G_UADDE %0, %1, %5
69 %8:_(<2 x s32>) = G_ZEXT %7
70 $vgpr0_vgpr1 = COPY %6
71 $vgpr2_vgpr3 = COPY %8
78 liveins: $vgpr0, $vgpr1, $vgpr2
80 ; CHECK-LABEL: name: test_uadde_s16
81 ; CHECK: liveins: $vgpr0, $vgpr1, $vgpr2
83 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr1
84 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
85 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
86 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
87 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
88 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]]
89 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND %13, [[C1]]
90 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY [[AND1]](s32)
91 ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[AND]], [[COPY2]], [[ICMP]]
92 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ne), [[UADDE]](s32), [[AND1]]
93 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ICMP1]](s1)
94 ; CHECK-NEXT: $vgpr0 = COPY [[UADDE]](s32)
95 ; CHECK-NEXT: $vgpr1 = COPY [[ZEXT]](s32)
96 %0:_(s32) = COPY $vgpr0
97 %1:_(s32) = COPY $vgpr1
98 %2:_(s32) = COPY $vgpr2
99 %3:_(s32) = G_CONSTANT i32 0
100 %4:_(s1) = G_ICMP intpred(eq), %2, %3
101 %5:_(s16) = G_TRUNC %0
102 %6:_(s16) = G_TRUNC %1
103 %7:_(s16), %8:_(s1) = G_UADDE %6, %7, %4
104 %9:_(s32) = G_ANYEXT %7
105 %10:_(s32) = G_ZEXT %8
114 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4
116 ; CHECK-LABEL: name: test_uadde_s64
117 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4
119 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
120 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
121 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr4
122 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
123 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY2]](s32), [[C]]
124 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](s64)
125 ; CHECK-NEXT: [[UV2:%[0-9]+]]:_(s32), [[UV3:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY1]](s64)
126 ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[UV]], [[UV2]], [[ICMP]]
127 ; CHECK-NEXT: [[UADDE2:%[0-9]+]]:_(s32), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[UV1]], [[UV3]], [[UADDE1]]
128 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[UADDE]](s32), [[UADDE2]](s32)
129 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[UADDE3]](s1)
130 ; CHECK-NEXT: $vgpr0_vgpr1 = COPY [[MV]](s64)
131 ; CHECK-NEXT: $vgpr2 = COPY [[ZEXT]](s32)
132 %0:_(s64) = COPY $vgpr0_vgpr1
133 %1:_(s64) = COPY $vgpr2_vgpr3
134 %2:_(s32) = COPY $vgpr4
135 %3:_(s32) = G_CONSTANT i32 0
136 %4:_(s1) = G_ICMP intpred(eq), %2, %3
137 %5:_(s64), %6:_(s1) = G_UADDE %0, %1, %4
138 %7:_(s32) = G_ZEXT %6
139 $vgpr0_vgpr1 = COPY %5