Skip to content

Commit

Permalink
[NFC] Add tests for i128 fshl on a few targets.
Browse files Browse the repository at this point in the history
In preparation for D108058.
  • Loading branch information
efriedma-quic committed Aug 24, 2021
1 parent d25e91d commit 09dcf31
Show file tree
Hide file tree
Showing 3 changed files with 680 additions and 4 deletions.
32 changes: 32 additions & 0 deletions llvm/test/CodeGen/AArch64/funnel-shift.ll
Expand Up @@ -5,6 +5,7 @@ declare i8 @llvm.fshl.i8(i8, i8, i8)
declare i16 @llvm.fshl.i16(i16, i16, i16)
declare i32 @llvm.fshl.i32(i32, i32, i32)
declare i64 @llvm.fshl.i64(i64, i64, i64)
declare i128 @llvm.fshl.i128(i128, i128, i128)
declare <4 x i32> @llvm.fshl.v4i32(<4 x i32>, <4 x i32>, <4 x i32>)

declare i8 @llvm.fshr.i8(i8, i8, i8)
Expand Down Expand Up @@ -42,6 +43,37 @@ define i64 @fshl_i64(i64 %x, i64 %y, i64 %z) {
ret i64 %f
}

define i128 @fshl_i128(i128 %x, i128 %y, i128 %z) nounwind {
; CHECK-LABEL: fshl_i128:
; CHECK: // %bb.0:
; CHECK-NEXT: mvn w9, w4
; CHECK-NEXT: and x12, x9, #0x7f
; CHECK-NEXT: extr x8, x3, x2, #1
; CHECK-NEXT: lsr x10, x3, #1
; CHECK-NEXT: tst x12, #0x40
; CHECK-NEXT: lsr x12, x0, #1
; CHECK-NEXT: lsr x8, x8, x9
; CHECK-NEXT: lsr x12, x12, x9
; CHECK-NEXT: lsr x9, x10, x9
; CHECK-NEXT: lsl x10, x10, #1
; CHECK-NEXT: lsl x10, x10, x4
; CHECK-NEXT: lsl x11, x1, x4
; CHECK-NEXT: and x14, x4, #0x7f
; CHECK-NEXT: orr x8, x10, x8
; CHECK-NEXT: lsl x13, x0, x4
; CHECK-NEXT: orr x11, x11, x12
; CHECK-NEXT: csel x10, xzr, x9, ne
; CHECK-NEXT: csel x8, x9, x8, ne
; CHECK-NEXT: tst x14, #0x40
; CHECK-NEXT: csel x9, x13, x11, ne
; CHECK-NEXT: csel x11, xzr, x13, ne
; CHECK-NEXT: orr x1, x9, x10
; CHECK-NEXT: orr x0, x11, x8
; CHECK-NEXT: ret
%f = call i128 @llvm.fshl.i128(i128 %x, i128 %y, i128 %z)
ret i128 %f
}

; Verify that weird types are minimally supported.
declare i37 @llvm.fshl.i37(i37, i37, i37)
define i37 @fshl_i37(i37 %x, i37 %y, i37 %z) {
Expand Down

0 comments on commit 09dcf31

Please sign in to comment.