85 lines · plain
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 %s5# 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 %s9 10# The purpose of this test is to check that long branches are selected correctly11# when we have prefixed instructions that may require alignment. Prefixed12# 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 branch14# then we should use a long branch like in this test.15 16---17name: longbranchtest18alignment: 1619exposesReturnsTwice: false20legalized: false21regBankSelected: false22selected: false23failedISel: false24tracksRegLiveness: true25hasWinCFI: false26registers: []27liveins:28 - { reg: '$x3', virtual-reg: '' }29frameInfo:30 isFrameAddressTaken: false31 isReturnAddressTaken: false32 hasStackMap: false33 hasPatchPoint: false34 stackSize: 035 offsetAdjustment: 036 maxAlignment: 137 adjustsStack: false38 hasCalls: false39 stackProtector: ''40 maxCallFrameSize: 041 cvBytesOfCalleeSavedRegisters: 042 hasOpaqueSPAdjustment: false43 hasVAStart: false44 hasMustTailInVarArgFunc: false45 localFrameSize: 046 savePoint: []47 restorePoint: []48fixedStack: []49stack: []50callSites: []51constants: []52machineFunctionInfo: {}53body: |54 bb.0.entry:55 successors: %bb.1(0x30000000), %bb.2(0x50000000)56 liveins: $x357 renamable $cr0 = CMPLWI killed renamable $r3, 0, implicit $x358 BCC 76, killed renamable $cr0, %bb.159 bb.2:60 renamable $x3 = LI8 261 INLINEASM &".space 32744", 162 renamable $x3 = PADDI8 $x3, 1363 BLR8 implicit $lr8, implicit $rm, implicit killed $x364 bb.1:65 renamable $x3 = LI8 166 INLINEASM &".space 32744", 167 renamable $x3 = PADDI8 $x3, 2168 BLR8 implicit $lr8, implicit $rm, implicit killed $x369 70...71 72# Check for the long branch.73# CHECK-LE: 08 00 82 4{{[01]}} b{{[tf]}} 2, 0xc74# CHECK-LE-NEXT: fc 7f 00 48 b 0x800475# CHECK-LE-DAG: paddi 3, 3, 13, 076# CHECK-LE-DAG: paddi 3, 3, 21, 077# CHECK-LE: blr78# CHECK-BE: 4{{[01]}} 82 00 08 b{{[tf]}} 2, 0xc79# CHECK-BE-NEXT: 48 00 7f fc b 0x800480# CHECK-BE-DAG: paddi 3, 3, 13, 081# CHECK-BE-DAG: paddi 3, 3, 21, 082# CHECK-BE: blr83 84 85