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

issues to the ground.

llvm-svn: 31836
This commit is contained in:
Chris Lattner 2006-11-17 23:53:28 +00:00
parent be9377a1e3
commit 33fc1d45e5
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;
}
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
class DForm_base<bits<6> opcode, dag OL, string asmstr, InstrItinClass itin,
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.
// 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 : Pseudo<(ops pred:$cond, target:$dst),
"b${cond:cc} ${cond:reg}, $dst",
[/*(PPCcondbranch CRRC:$crS, imm:$opc, bb:$dst)*/]>;
def BCC : CBForm<16, 0, 0, (ops pred:$cond, target:$dst),
"b${cond:cc} ${cond:reg}, $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),
"blt $crS, $block", BrB>;
def BLE : BForm<16, 0, 0, 4, 1, (ops CRRC:$crS, target:$block),