add encoding for BCC, after finally wrestling strange ppc/tblgen endianness

issues to the ground.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31836 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-11-17 23:53:28 +00:00
parent 18258c6404
commit d5275157b5
2 changed files with 22 additions and 3 deletions

View File

@ -74,6 +74,24 @@ class BForm<bits<6> opcode, bit aa, bit lk, bits<5> bo, bits<2> bicode, dag OL,
let Inst{31} = lk; let Inst{31} = lk;
} }
class CBForm<bits<6> opcode, bit aa, bit lk, dag OL,
string asmstr> : I<opcode, OL, asmstr, BrB> {
bits<7> BIBO; // 2 bits of BI and 5 bits of BO.
bits<3> CR;
bits<14> BD;
bits<5> BI;
let BI{0-1} = BIBO{5-6};
let BI{2-4} = CR{0-2};
let Inst{6-10} = BIBO{4-0};
let Inst{11-15} = BI;
let Inst{16-29} = BD;
let Inst{30} = aa;
let Inst{31} = lk;
}
// 1.7.4 D-Form // 1.7.4 D-Form
class DForm_base<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin, class DForm_base<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
list<dag> pattern> list<dag> pattern>

View File

@ -361,10 +361,11 @@ let isBranch = 1, isTerminator = 1, hasCtrlDep = 1,
// BCC represents an arbitrary conditional branch on a predicate. // BCC represents an arbitrary conditional branch on a predicate.
// FIXME: should be able to write a pattern for PPCcondbranch, but can't use // 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. :( // a two-value operand where a dag node expects two operands. :(
def BCC : Pseudo<(ops pred:$cond, target:$dst), def BCC : CBForm<16, 0, 0, (ops pred:$cond, target:$dst),
"b${cond:cc} ${cond:reg}, $dst", "b${cond:cc} ${cond:reg}, $dst"
[/*(PPCcondbranch CRRC:$crS, imm:$opc, bb:$dst)*/]>; /*[(PPCcondbranch CRRC:$crS, imm:$opc, bb:$dst)]*/>;
// REMOVE BForm when these go away.
def BLT : BForm<16, 0, 0, 12, 0, (ops CRRC:$crS, target:$block), def BLT : BForm<16, 0, 0, 12, 0, (ops CRRC:$crS, target:$block),
"blt $crS, $block", BrB>; "blt $crS, $block", BrB>;
def BLE : BForm<16, 0, 0, 4, 1, (ops CRRC:$crS, target:$block), def BLE : BForm<16, 0, 0, 4, 1, (ops CRRC:$crS, target:$block),