• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
9
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.
15
16---
17name:            longbranchtest
18alignment:       16
19exposesReturnsTwice: false
20legalized:       false
21regBankSelected: false
22selected:        false
23failedISel:      false
24tracksRegLiveness: true
25hasWinCFI:       false
26registers:       []
27liveins:
28  - { reg: '$x3', virtual-reg: '' }
29frameInfo:
30  isFrameAddressTaken: false
31  isReturnAddressTaken: false
32  hasStackMap:     false
33  hasPatchPoint:   false
34  stackSize:       0
35  offsetAdjustment: 0
36  maxAlignment:    1
37  adjustsStack:    false
38  hasCalls:        false
39  stackProtector:  ''
40  maxCallFrameSize: 0
41  cvBytesOfCalleeSavedRegisters: 0
42  hasOpaqueSPAdjustment: false
43  hasVAStart:      false
44  hasMustTailInVarArgFunc: false
45  localFrameSize:  0
46  savePoint:       ''
47  restorePoint:    ''
48fixedStack:      []
49stack:           []
50callSites:       []
51constants:       []
52machineFunctionInfo: {}
53body:             |
54  bb.0.entry:
55    successors: %bb.1(0x30000000), %bb.2(0x50000000)
56    liveins: $x3
57    renamable $cr0 = CMPLWI killed renamable $r3, 0, implicit $x3
58    BCC 76, killed renamable $cr0, %bb.1
59  bb.2:
60    renamable $x3 = LI8 2
61    INLINEASM &".space 32744", 1
62    renamable $x3 = PADDI8 $x3, 13
63    BLR8 implicit $lr8, implicit $rm, implicit killed $x3
64  bb.1:
65    renamable $x3 = LI8 1
66    INLINEASM &".space 32744", 1
67    renamable $x3 = PADDI8 $x3, 21
68    BLR8 implicit $lr8, implicit $rm, implicit killed $x3
69
70...
71
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
77# CHECK-LE:         blr
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
82# CHECK-BE:         blr
83
84
85