mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
SubRegIndex'ize Mips
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104514 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
59f7199e16
commit
fff916a960
@ -225,12 +225,12 @@ SDNode *MipsDAGToDAGISel::SelectLoadFp64(SDNode *N) {
|
||||
MVT::Other, Offset0, Base, Chain);
|
||||
SDValue Undef = SDValue(CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF,
|
||||
dl, NVT), 0);
|
||||
SDValue I0 = CurDAG->getTargetInsertSubreg(Mips::SUBREG_FPEVEN, dl,
|
||||
SDValue I0 = CurDAG->getTargetInsertSubreg(Mips::sub_fpeven, dl,
|
||||
MVT::f64, Undef, SDValue(LD0, 0));
|
||||
|
||||
SDNode *LD1 = CurDAG->getMachineNode(Mips::LWC1, dl, MVT::f32,
|
||||
MVT::Other, Offset1, Base, SDValue(LD0, 1));
|
||||
SDValue I1 = CurDAG->getTargetInsertSubreg(Mips::SUBREG_FPODD, dl,
|
||||
SDValue I1 = CurDAG->getTargetInsertSubreg(Mips::sub_fpodd, dl,
|
||||
MVT::f64, I0, SDValue(LD1, 0));
|
||||
|
||||
ReplaceUses(SDValue(N, 0), I1);
|
||||
@ -266,9 +266,9 @@ SDNode *MipsDAGToDAGISel::SelectStoreFp64(SDNode *N) {
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
|
||||
// Get the even and odd part from the f64 register
|
||||
SDValue FPOdd = CurDAG->getTargetExtractSubreg(Mips::SUBREG_FPODD,
|
||||
SDValue FPOdd = CurDAG->getTargetExtractSubreg(Mips::sub_fpodd,
|
||||
dl, MVT::f32, N1);
|
||||
SDValue FPEven = CurDAG->getTargetExtractSubreg(Mips::SUBREG_FPEVEN,
|
||||
SDValue FPEven = CurDAG->getTargetExtractSubreg(Mips::sub_fpeven,
|
||||
dl, MVT::f32, N1);
|
||||
|
||||
// The second store should start after for 4 bytes.
|
||||
@ -438,9 +438,9 @@ SDNode* MipsDAGToDAGISel::Select(SDNode *Node) {
|
||||
SDValue Undef = SDValue(
|
||||
CurDAG->getMachineNode(TargetOpcode::IMPLICIT_DEF, dl, MVT::f64), 0);
|
||||
SDNode *MTC = CurDAG->getMachineNode(Mips::MTC1, dl, MVT::f32, Zero);
|
||||
SDValue I0 = CurDAG->getTargetInsertSubreg(Mips::SUBREG_FPEVEN, dl,
|
||||
SDValue I0 = CurDAG->getTargetInsertSubreg(Mips::sub_fpeven, dl,
|
||||
MVT::f64, Undef, SDValue(MTC, 0));
|
||||
SDValue I1 = CurDAG->getTargetInsertSubreg(Mips::SUBREG_FPODD, dl,
|
||||
SDValue I1 = CurDAG->getTargetInsertSubreg(Mips::sub_fpodd, dl,
|
||||
MVT::f64, I0, SDValue(MTC, 0));
|
||||
ReplaceUses(SDValue(Node, 0), I1);
|
||||
return I1.getNode();
|
||||
|
@ -23,15 +23,6 @@ class MipsSubtarget;
|
||||
class TargetInstrInfo;
|
||||
class Type;
|
||||
|
||||
namespace Mips {
|
||||
/// SubregIndex - The index of various sized subregister classes. Note that
|
||||
/// these indices must be kept in sync with the class indices in the
|
||||
/// MipsRegisterInfo.td file.
|
||||
enum SubregIndex {
|
||||
SUBREG_FPEVEN = 1, SUBREG_FPODD = 2
|
||||
};
|
||||
}
|
||||
|
||||
struct MipsRegisterInfo : public MipsGenRegisterInfo {
|
||||
const MipsSubtarget &Subtarget;
|
||||
const TargetInstrInfo &TII;
|
||||
|
@ -144,8 +144,10 @@ let Namespace = "Mips" in {
|
||||
// Subregister Set Definitions
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
def mips_subreg_fpeven : PatLeaf<(i32 1)>;
|
||||
def mips_subreg_fpodd : PatLeaf<(i32 2)>;
|
||||
let Namespace = "Mips" in {
|
||||
def sub_fpeven : SubRegIndex { let NumberHack = 1; }
|
||||
def sub_fpodd : SubRegIndex { let NumberHack = 2; }
|
||||
}
|
||||
|
||||
def : SubRegSet<1, [D0, D1, D2, D3, D4, D5, D6, D7,
|
||||
D8, D9, D10, D11, D12, D13, D14, D15],
|
||||
|
Loading…
Reference in New Issue
Block a user