Skip to content

Commit fc2317f

Browse files
committed
[PowerPC] Precommit 64-bit funnel shift test cases
1 parent 3a624c3 commit fc2317f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

llvm/test/CodeGen/PowerPC/funnel-shift.ll

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ define i32 @fshl_i32(i32 %x, i32 %y, i32 %z) {
2929
ret i32 %f
3030
}
3131

32+
define i64 @fshl_i64(i64 %x, i64 %y, i64 %z) {
33+
; CHECK-LABEL: fshl_i64:
34+
; CHECK: # %bb.0:
35+
; CHECK-NEXT: andi. 5, 5, 63
36+
; CHECK-NEXT: subfic 6, 5, 64
37+
; CHECK-NEXT: sld 5, 3, 5
38+
; CHECK-NEXT: srd 4, 4, 6
39+
; CHECK-NEXT: or 4, 5, 4
40+
; CHECK-NEXT: iseleq 3, 3, 4
41+
; CHECK-NEXT: blr
42+
%f = call i64 @llvm.fshl.i64(i64 %x, i64 %y, i64 %z)
43+
ret i64 %f
44+
}
45+
3246
; Verify that weird types are minimally supported.
3347
declare i37 @llvm.fshl.i37(i37, i37, i37)
3448
define i37 @fshl_i37(i37 %x, i37 %y, i37 %z) {
@@ -135,6 +149,20 @@ define i32 @fshr_i32(i32 %x, i32 %y, i32 %z) {
135149
ret i32 %f
136150
}
137151

152+
define i64 @fshr_i64(i64 %x, i64 %y, i64 %z) {
153+
; CHECK-LABEL: fshr_i64:
154+
; CHECK: # %bb.0:
155+
; CHECK-NEXT: andi. 5, 5, 63
156+
; CHECK-NEXT: subfic 6, 5, 64
157+
; CHECK-NEXT: srd 5, 4, 5
158+
; CHECK-NEXT: sld 3, 3, 6
159+
; CHECK-NEXT: or 3, 3, 5
160+
; CHECK-NEXT: iseleq 3, 4, 3
161+
; CHECK-NEXT: blr
162+
%f = call i64 @llvm.fshr.i64(i64 %x, i64 %y, i64 %z)
163+
ret i64 %f
164+
}
165+
138166
; Verify that weird types are minimally supported.
139167
declare i37 @llvm.fshr.i37(i37, i37, i37)
140168
define i37 @fshr_i37(i37 %x, i37 %y, i37 %z) {

0 commit comments

Comments
 (0)