1 # RUN: llc -mcpu=future -mtriple=powerpc64le-unknown-unknown %s \
2 # RUN: -start-before=ppc-branch-select -verify-machineinstrs \
3 # RUN: -filetype=obj -o - | llvm-objdump --mcpu=future -d -r - | \
4 # RUN: FileCheck --check-prefix=CHECK-LE %s
5 # RUN: llc -mcpu=future -mtriple=powerpc64-unknown-unknown %s \
6 # RUN: -start-before=ppc-branch-select -verify-machineinstrs \
7 # RUN: -filetype=obj -o - | llvm-objdump --mcpu=future -d -r - | \
8 # RUN: FileCheck --check-prefix=CHECK-BE %s
10 # The purpose of this test is to check that long branches are selected correctly
11 # when we have prefixed instructions that may require alignment. Prefixed
12 # instructions may require alignment and so an additional 4 bytes may be added.
13 # If those 4 bytes put the target of the branch past the range of a short branch
14 # then we should use a long branch like in this test.
19 exposesReturnsTwice: false
21 regBankSelected: false
24 tracksRegLiveness: true
28 - { reg: '$x3', virtual-reg: '' }
30 isFrameAddressTaken: false
31 isReturnAddressTaken: false
41 cvBytesOfCalleeSavedRegisters: 0
42 hasOpaqueSPAdjustment: false
44 hasMustTailInVarArgFunc: false
52 machineFunctionInfo: {}
55 successors: %bb.1(0x30000000), %bb.2(0x50000000)
57 renamable $cr0 = CMPLWI killed renamable $r3, 0, implicit $x3
58 BCC 76, killed renamable $cr0, %bb.1
61 INLINEASM &".space 32744", 1
62 renamable $x3 = PADDI8 $x3, 13
63 BLR8 implicit $lr8, implicit $rm, implicit killed $x3
66 INLINEASM &".space 32744", 1
67 renamable $x3 = PADDI8 $x3, 21
68 BLR8 implicit $lr8, implicit $rm, implicit killed $x3
72 # Check for the long branch.
73 # CHECK-LE: 08 00 82 4{{[01]}} b{{[tf]}} 2, 0xc
74 # CHECK-LE-NEXT: fc 7f 00 48 b 0x8004
75 # CHECK-LE-DAG: paddi 3, 3, 13, 0
76 # CHECK-LE-DAG: paddi 3, 3, 21, 0
78 # CHECK-BE: 4{{[01]}} 82 00 08 b{{[tf]}} 2, 0xc
79 # CHECK-BE-NEXT: 48 00 7f fc b 0x8004
80 # CHECK-BE-DAG: paddi 3, 3, 13, 0
81 # CHECK-BE-DAG: paddi 3, 3, 21, 0