1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
4 ; FIXME: two consecutive immediate adds not fused in i16/i8 functions.
6 declare i64 @llvm.ctlz.i64(i64, i1)
7 declare i32 @llvm.ctlz.i32(i32, i1)
8 declare i16 @llvm.ctlz.i16(i16, i1)
9 declare i8 @llvm.ctlz.i8(i8, i1)
11 define i64 @f0(i64 %arg) {
14 ; CHECK-NEXT: flogr %r2, %r2
15 ; CHECK-NEXT: # kill: def $r2d killed $r2d killed $r2q
17 %1 = tail call i64 @llvm.ctlz.i64(i64 %arg, i1 false)
21 define i64 @f1(i64 %arg) {
24 ; CHECK-NEXT: flogr %r2, %r2
25 ; CHECK-NEXT: # kill: def $r2d killed $r2d killed $r2q
27 %1 = tail call i64 @llvm.ctlz.i64(i64 %arg, i1 true)
31 define i32 @f2(i32 %arg) {
34 ; CHECK-NEXT: llgfr %r0, %r2
35 ; CHECK-NEXT: flogr %r2, %r0
36 ; CHECK-NEXT: aghi %r2, -32
37 ; CHECK-NEXT: # kill: def $r2l killed $r2l killed $r2d
39 %1 = tail call i32 @llvm.ctlz.i32(i32 %arg, i1 false)
43 define i32 @f3(i32 %arg) {
46 ; CHECK-NEXT: # kill: def $r2l killed $r2l def $r2d
47 ; CHECK-NEXT: sllg %r0, %r2, 32
48 ; CHECK-NEXT: flogr %r2, %r0
49 ; CHECK-NEXT: # kill: def $r2l killed $r2l killed $r2q
51 %1 = tail call i32 @llvm.ctlz.i32(i32 %arg, i1 true)
55 define i16 @f4(i16 %arg) {
58 ; CHECK-NEXT: # kill: def $r2l killed $r2l def $r2d
59 ; CHECK-NEXT: llghr %r0, %r2
60 ; CHECK-NEXT: flogr %r0, %r0
61 ; CHECK-NEXT: aghi %r0, -32
62 ; CHECK-NEXT: ahik %r2, %r0, -16
64 %1 = tail call i16 @llvm.ctlz.i16(i16 %arg, i1 false)
68 define i16 @f5(i16 %arg) {
71 ; CHECK-NEXT: # kill: def $r2l killed $r2l def $r2d
72 ; CHECK-NEXT: sllg %r0, %r2, 48
73 ; CHECK-NEXT: flogr %r2, %r0
74 ; CHECK-NEXT: # kill: def $r2l killed $r2l killed $r2q
76 %1 = tail call i16 @llvm.ctlz.i16(i16 %arg, i1 true)
80 define i8 @f6(i8 %arg) {
83 ; CHECK-NEXT: # kill: def $r2l killed $r2l def $r2d
84 ; CHECK-NEXT: llgcr %r0, %r2
85 ; CHECK-NEXT: flogr %r0, %r0
86 ; CHECK-NEXT: aghi %r0, -32
87 ; CHECK-NEXT: ahik %r2, %r0, -24
89 %1 = tail call i8 @llvm.ctlz.i8(i8 %arg, i1 false)
93 define i8 @f7(i8 %arg) {
96 ; CHECK-NEXT: # kill: def $r2l killed $r2l def $r2d
97 ; CHECK-NEXT: sllg %r0, %r2, 56
98 ; CHECK-NEXT: flogr %r2, %r0
99 ; CHECK-NEXT: # kill: def $r2l killed $r2l killed $r2q
100 ; CHECK-NEXT: br %r14
101 %1 = tail call i8 @llvm.ctlz.i8(i8 %arg, i1 true)