mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 06:38:44 +00:00
Fix JIT encoding of conditional branches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23076 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e4bc9ea0a5
commit
6718f11feb
@ -66,28 +66,20 @@ class IForm<bits<6> opcode, bit aa, bit lk, dag OL, string asmstr>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 1.7.2 B-Form
|
// 1.7.2 B-Form
|
||||||
class BForm<bits<6> opcode, bit aa, bit lk, dag OL, string asmstr>
|
class BForm<bits<6> opcode, bit aa, bit lk, bits<5> bo, bits<2> bicode, dag OL,
|
||||||
: I<opcode, OL, asmstr> {
|
string asmstr>
|
||||||
bits<5> BO;
|
: I<opcode, OL, asmstr> {
|
||||||
bits<3> CRNum;
|
bits<3> CR;
|
||||||
bits<2> BICode;
|
|
||||||
bits<14> BD;
|
bits<14> BD;
|
||||||
|
|
||||||
let Inst{6-10} = BO;
|
let Inst{6-10} = bo;
|
||||||
let Inst{11-13} = CRNum;
|
let Inst{11-13} = CR;
|
||||||
let Inst{14-15} = BICode;
|
let Inst{14-15} = bicode;
|
||||||
let Inst{16-29} = BD;
|
let Inst{16-29} = BD;
|
||||||
let Inst{30} = aa;
|
let Inst{30} = aa;
|
||||||
let Inst{31} = lk;
|
let Inst{31} = lk;
|
||||||
}
|
}
|
||||||
|
|
||||||
class BForm_ext<bits<6> opcode, bit aa, bit lk, bits<5> bo, bits<2> bicode,
|
|
||||||
dag OL, string asmstr>
|
|
||||||
: BForm<opcode, aa, lk, OL, asmstr> {
|
|
||||||
let BO = bo;
|
|
||||||
let BICode = bicode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 1.7.4 D-Form
|
// 1.7.4 D-Form
|
||||||
class DForm_base<bits<6> opcode, dag OL, string asmstr> : I<opcode, OL, asmstr>{
|
class DForm_base<bits<6> opcode, dag OL, string asmstr> : I<opcode, OL, asmstr>{
|
||||||
bits<5> A;
|
bits<5> A;
|
||||||
|
@ -80,18 +80,18 @@ let isBranch = 1, isTerminator = 1 in {
|
|||||||
|
|
||||||
// FIXME: 4*CR# needs to be added to the BI field!
|
// FIXME: 4*CR# needs to be added to the BI field!
|
||||||
// This will only work for CR0 as it stands now
|
// This will only work for CR0 as it stands now
|
||||||
def BLT : BForm_ext<16, 0, 0, 12, 0, (ops CRRC:$crS, target:$block),
|
def BLT : BForm<16, 0, 0, 12, 0, (ops CRRC:$crS, target:$block),
|
||||||
"blt $block">;
|
"blt $block">;
|
||||||
def BLE : BForm_ext<16, 0, 0, 4, 1, (ops CRRC:$crS, target:$block),
|
def BLE : BForm<16, 0, 0, 4, 1, (ops CRRC:$crS, target:$block),
|
||||||
"ble $block">;
|
"ble $block">;
|
||||||
def BEQ : BForm_ext<16, 0, 0, 12, 2, (ops CRRC:$crS, target:$block),
|
def BEQ : BForm<16, 0, 0, 12, 2, (ops CRRC:$crS, target:$block),
|
||||||
"beq $block">;
|
"beq $block">;
|
||||||
def BGE : BForm_ext<16, 0, 0, 4, 0, (ops CRRC:$crS, target:$block),
|
def BGE : BForm<16, 0, 0, 4, 0, (ops CRRC:$crS, target:$block),
|
||||||
"bge $block">;
|
"bge $block">;
|
||||||
def BGT : BForm_ext<16, 0, 0, 12, 1, (ops CRRC:$crS, target:$block),
|
def BGT : BForm<16, 0, 0, 12, 1, (ops CRRC:$crS, target:$block),
|
||||||
"bgt $block">;
|
"bgt $block">;
|
||||||
def BNE : BForm_ext<16, 0, 0, 4, 2, (ops CRRC:$crS, target:$block),
|
def BNE : BForm<16, 0, 0, 4, 2, (ops CRRC:$crS, target:$block),
|
||||||
"bne $block">;
|
"bne $block">;
|
||||||
}
|
}
|
||||||
|
|
||||||
let isCall = 1,
|
let isCall = 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user