• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Test indirect jumps on z14.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
4
5define i32 @f1(i32 %x, i32 %y, i32 %op) {
6; CHECK-LABEL: f1:
7; CHECK: ahi %r4, -1
8; CHECK: clibh %r4, 5, 0(%r14)
9; CHECK: llgfr [[OP64:%r[0-5]]], %r4
10; CHECK: sllg [[INDEX:%r[1-5]]], [[OP64]], 3
11; CHECK: larl [[BASE:%r[1-5]]]
12; CHECK: bi 0([[BASE]],[[INDEX]])
13entry:
14  switch i32 %op, label %exit [
15    i32 1, label %b.add
16    i32 2, label %b.sub
17    i32 3, label %b.and
18    i32 4, label %b.or
19    i32 5, label %b.xor
20    i32 6, label %b.mul
21  ]
22
23b.add:
24  %add = add i32 %x, %y
25  br label %exit
26
27b.sub:
28  %sub = sub i32 %x, %y
29  br label %exit
30
31b.and:
32  %and = and i32 %x, %y
33  br label %exit
34
35b.or:
36  %or = or i32 %x, %y
37  br label %exit
38
39b.xor:
40  %xor = xor i32 %x, %y
41  br label %exit
42
43b.mul:
44  %mul = mul i32 %x, %y
45  br label %exit
46
47exit:
48  %res = phi i32 [ %x,   %entry ],
49                 [ %add, %b.add ],
50                 [ %sub, %b.sub ],
51                 [ %and, %b.and ],
52                 [ %or,  %b.or ],
53                 [ %xor, %b.xor ],
54                 [ %mul, %b.mul ]
55  ret i32 %res
56}
57