Skip to content

Commit ab9bd07

Browse files
committed
fixup! [AArch64][GlobalISel] Legalize Shifts for Smaller/Larger Vectors
1 parent 956ee14 commit ab9bd07

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

llvm/test/CodeGen/AArch64/icmp.ll

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
; RUN: llc -mtriple=aarch64-none-eabi -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD
33
; RUN: llc -mtriple=aarch64-none-eabi -global-isel -global-isel-abort=2 -verify-machineinstrs %s -o - 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI
44

5-
; CHECK-GI: warning: Instruction selection used fallback path for v3i32_i32
6-
75
define i64 @i64_i64(i64 %a, i64 %b, i64 %d, i64 %e) {
86
; CHECK-LABEL: i64_i64:
97
; CHECK: // %bb.0: // %entry
@@ -165,11 +163,33 @@ entry:
165163
}
166164

167165
define <3 x i32> @v3i32_i32(<3 x i32> %a, <3 x i32> %b, <3 x i32> %d, <3 x i32> %e) {
168-
; CHECK-LABEL: v3i32_i32:
169-
; CHECK: // %bb.0: // %entry
170-
; CHECK-NEXT: cmgt v0.4s, v1.4s, v0.4s
171-
; CHECK-NEXT: bsl v0.16b, v2.16b, v3.16b
172-
; CHECK-NEXT: ret
166+
; CHECK-SD-LABEL: v3i32_i32:
167+
; CHECK-SD: // %bb.0: // %entry
168+
; CHECK-SD-NEXT: cmgt v0.4s, v1.4s, v0.4s
169+
; CHECK-SD-NEXT: bsl v0.16b, v2.16b, v3.16b
170+
; CHECK-SD-NEXT: ret
171+
;
172+
; CHECK-GI-LABEL: v3i32_i32:
173+
; CHECK-GI: // %bb.0: // %entry
174+
; CHECK-GI-NEXT: mov w8, #31 // =0x1f
175+
; CHECK-GI-NEXT: cmgt v0.4s, v1.4s, v0.4s
176+
; CHECK-GI-NEXT: fmov s4, w8
177+
; CHECK-GI-NEXT: mov v4.s[1], w8
178+
; CHECK-GI-NEXT: mov v4.s[2], w8
179+
; CHECK-GI-NEXT: mov w8, #-1 // =0xffffffff
180+
; CHECK-GI-NEXT: fmov s5, w8
181+
; CHECK-GI-NEXT: mov v5.s[1], w8
182+
; CHECK-GI-NEXT: mov v4.s[3], w8
183+
; CHECK-GI-NEXT: mov v5.s[2], w8
184+
; CHECK-GI-NEXT: neg v1.4s, v4.4s
185+
; CHECK-GI-NEXT: ushl v0.4s, v0.4s, v4.4s
186+
; CHECK-GI-NEXT: mov v5.s[3], w8
187+
; CHECK-GI-NEXT: sshl v0.4s, v0.4s, v1.4s
188+
; CHECK-GI-NEXT: eor v1.16b, v0.16b, v5.16b
189+
; CHECK-GI-NEXT: and v0.16b, v2.16b, v0.16b
190+
; CHECK-GI-NEXT: and v1.16b, v3.16b, v1.16b
191+
; CHECK-GI-NEXT: orr v0.16b, v0.16b, v1.16b
192+
; CHECK-GI-NEXT: ret
173193
entry:
174194
%c = icmp slt <3 x i32> %a, %b
175195
%s = select <3 x i1> %c, <3 x i32> %d, <3 x i32> %e

0 commit comments

Comments
 (0)