diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-15 06:09:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-15 06:09:35 +0000 |
commit | 8d70411dcd5e1af47c3f4fddb993bb93c8eed6d0 (patch) | |
tree | 0f9f34d9ed0753c3a059e3030ba120e2ea406691 /lib/Target/PowerPC/PPCInstrInfo.td | |
parent | 019aef6df791bbccc26b2a18b17ab42aad6aaa0d (diff) | |
download | external_llvm-8d70411dcd5e1af47c3f4fddb993bb93c8eed6d0.zip external_llvm-8d70411dcd5e1af47c3f4fddb993bb93c8eed6d0.tar.gz external_llvm-8d70411dcd5e1af47c3f4fddb993bb93c8eed6d0.tar.bz2 |
change direct branches to encode with the same encoding method
as direct calls. Change conditional branches to encode with
their own method, simplifying the JIT encoder and making room
for adding an mc fixup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119125 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCInstrInfo.td')
-rw-r--r-- | lib/Target/PowerPC/PPCInstrInfo.td | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Target/PowerPC/PPCInstrInfo.td b/lib/Target/PowerPC/PPCInstrInfo.td index ba5aab7..269f371 100644 --- a/lib/Target/PowerPC/PPCInstrInfo.td +++ b/lib/Target/PowerPC/PPCInstrInfo.td @@ -286,11 +286,15 @@ def u16imm : Operand<i32> { def s16immX4 : Operand<i32> { // Multiply imm by 4 before printing. let PrintMethod = "printS16X4ImmOperand"; } -def target : Operand<OtherVT> { +def directbrtarget : Operand<OtherVT> { let PrintMethod = "printBranchOperand"; + let EncoderMethod = "getDirectBrEncoding"; +} +def condbrtarget : Operand<OtherVT> { + let EncoderMethod = "getCondBrEncoding"; } def calltarget : Operand<iPTR> { - let EncoderMethod = "getCallTargetEncoding"; + let EncoderMethod = "getDirectBrEncoding"; } def aaddr : Operand<iPTR> { let PrintMethod = "printAbsAddrOperand"; @@ -409,7 +413,7 @@ let Defs = [LR] in let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7 in { let isBarrier = 1 in { - def B : IForm<18, 0, 0, (outs), (ins target:$dst), + def B : IForm<18, 0, 0, (outs), (ins directbrtarget:$dst), "b $dst", BrB, [(br bb:$dst)]>; } @@ -417,7 +421,7 @@ let isBranch = 1, isTerminator = 1, hasCtrlDep = 1, PPC970_Unit = 7 in { // BCC represents an arbitrary conditional branch on a predicate. // FIXME: should be able to write a pattern for PPCcondbranch, but can't use // a two-value operand where a dag node expects two operands. :( - def BCC : BForm<16, 0, 0, (outs), (ins pred:$cond, target:$dst), + def BCC : BForm<16, 0, 0, (outs), (ins pred:$cond, condbrtarget:$dst), "b${cond:cc} ${cond:reg}, $dst" /*[(PPCcondbranch CRRC:$crS, imm:$opc, bb:$dst)]*/>; } |