mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 18:31:04 +00:00
Use the new TB_NOT_REVERSABLE flag instead of special
casing FsMOVAPDrr/FsMOVAPSrr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116016 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
adab850daa
commit
05e27c5786
@ -263,8 +263,8 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
|
|||||||
{ X86::DIV64r, X86::DIV64m, 1, 0 },
|
{ X86::DIV64r, X86::DIV64m, 1, 0 },
|
||||||
{ X86::DIV8r, X86::DIV8m, 1, 0 },
|
{ X86::DIV8r, X86::DIV8m, 1, 0 },
|
||||||
{ X86::EXTRACTPSrr, X86::EXTRACTPSmr, 0, 16 },
|
{ X86::EXTRACTPSrr, X86::EXTRACTPSmr, 0, 16 },
|
||||||
{ X86::FsMOVAPDrr, X86::MOVSDmr, 0, 0 },
|
{ X86::FsMOVAPDrr, X86::MOVSDmr | TB_NOT_REVERSABLE , 0, 0 },
|
||||||
{ X86::FsMOVAPSrr, X86::MOVSSmr, 0, 0 },
|
{ X86::FsMOVAPSrr, X86::MOVSSmr | TB_NOT_REVERSABLE , 0, 0 },
|
||||||
{ X86::IDIV16r, X86::IDIV16m, 1, 0 },
|
{ X86::IDIV16r, X86::IDIV16m, 1, 0 },
|
||||||
{ X86::IDIV32r, X86::IDIV32m, 1, 0 },
|
{ X86::IDIV32r, X86::IDIV32m, 1, 0 },
|
||||||
{ X86::IDIV64r, X86::IDIV64m, 1, 0 },
|
{ X86::IDIV64r, X86::IDIV64m, 1, 0 },
|
||||||
@ -323,18 +323,22 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
|
|||||||
};
|
};
|
||||||
|
|
||||||
for (unsigned i = 0, e = array_lengthof(OpTbl0); i != e; ++i) {
|
for (unsigned i = 0, e = array_lengthof(OpTbl0); i != e; ++i) {
|
||||||
unsigned RegOp = OpTbl0[i][0];
|
unsigned RegOp = OpTbl0[i][0];
|
||||||
unsigned MemOp = OpTbl0[i][1];
|
unsigned MemOp = OpTbl0[i][1] & ~TB_FLAGS;
|
||||||
unsigned Align = OpTbl0[i][3];
|
|
||||||
assert(!RegOp2MemOpTable0.count(RegOp) && "Duplicated entries?");
|
|
||||||
RegOp2MemOpTable0[RegOp] = std::make_pair(MemOp,Align);
|
|
||||||
unsigned FoldedLoad = OpTbl0[i][2];
|
unsigned FoldedLoad = OpTbl0[i][2];
|
||||||
|
unsigned Align = OpTbl0[i][3];
|
||||||
|
assert(!RegOp2MemOpTable0.count(RegOp) && "Duplicated entries?");
|
||||||
|
RegOp2MemOpTable0[RegOp] = std::make_pair(MemOp, Align);
|
||||||
|
|
||||||
|
// If this is not a reversable operation (because there is a many->one)
|
||||||
|
// mapping, don't insert the reverse of the operation into MemOp2RegOpTable.
|
||||||
|
if (OpTbl0[i][1] & TB_NOT_REVERSABLE)
|
||||||
|
continue;
|
||||||
|
|
||||||
// Index 0, folded load or store.
|
// Index 0, folded load or store.
|
||||||
unsigned AuxInfo = 0 | (FoldedLoad << 4) | ((FoldedLoad^1) << 5);
|
unsigned AuxInfo = 0 | (FoldedLoad << 4) | ((FoldedLoad^1) << 5);
|
||||||
if (RegOp != X86::FsMOVAPDrr && RegOp != X86::FsMOVAPSrr) {
|
assert(!MemOp2RegOpTable.count(MemOp) && "Duplicated entries?");
|
||||||
assert(!MemOp2RegOpTable.count(MemOp) && "Duplicated entries?");
|
MemOp2RegOpTable[MemOp] = std::make_pair(RegOp, AuxInfo);
|
||||||
MemOp2RegOpTable[MemOp] = std::make_pair(RegOp, AuxInfo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const unsigned OpTbl1[][3] = {
|
static const unsigned OpTbl1[][3] = {
|
||||||
@ -352,8 +356,8 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
|
|||||||
{ X86::CVTTSD2SIrr, X86::CVTTSD2SIrm, 0 },
|
{ X86::CVTTSD2SIrr, X86::CVTTSD2SIrm, 0 },
|
||||||
{ X86::CVTTSS2SI64rr, X86::CVTTSS2SI64rm, 0 },
|
{ X86::CVTTSS2SI64rr, X86::CVTTSS2SI64rm, 0 },
|
||||||
{ X86::CVTTSS2SIrr, X86::CVTTSS2SIrm, 0 },
|
{ X86::CVTTSS2SIrr, X86::CVTTSS2SIrm, 0 },
|
||||||
{ X86::FsMOVAPDrr, X86::MOVSDrm, 0 },
|
{ X86::FsMOVAPDrr, X86::MOVSDrm | TB_NOT_REVERSABLE , 0 },
|
||||||
{ X86::FsMOVAPSrr, X86::MOVSSrm, 0 },
|
{ X86::FsMOVAPSrr, X86::MOVSSrm | TB_NOT_REVERSABLE , 0 },
|
||||||
{ X86::IMUL16rri, X86::IMUL16rmi, 0 },
|
{ X86::IMUL16rri, X86::IMUL16rmi, 0 },
|
||||||
{ X86::IMUL16rri8, X86::IMUL16rmi8, 0 },
|
{ X86::IMUL16rri8, X86::IMUL16rmi8, 0 },
|
||||||
{ X86::IMUL32rri, X86::IMUL32rmi, 0 },
|
{ X86::IMUL32rri, X86::IMUL32rmi, 0 },
|
||||||
@ -449,17 +453,20 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
|
|||||||
|
|
||||||
for (unsigned i = 0, e = array_lengthof(OpTbl1); i != e; ++i) {
|
for (unsigned i = 0, e = array_lengthof(OpTbl1); i != e; ++i) {
|
||||||
unsigned RegOp = OpTbl1[i][0];
|
unsigned RegOp = OpTbl1[i][0];
|
||||||
unsigned MemOp = OpTbl1[i][1];
|
unsigned MemOp = OpTbl1[i][1] & ~TB_FLAGS;
|
||||||
unsigned Align = OpTbl1[i][2];
|
unsigned Align = OpTbl1[i][2];
|
||||||
assert(!RegOp2MemOpTable1.count(RegOp) && "Duplicate entries");
|
assert(!RegOp2MemOpTable1.count(RegOp) && "Duplicate entries");
|
||||||
RegOp2MemOpTable1[RegOp] = std::make_pair(MemOp,Align);
|
RegOp2MemOpTable1[RegOp] = std::make_pair(MemOp, Align);
|
||||||
|
|
||||||
|
// If this is not a reversable operation (because there is a many->one)
|
||||||
|
// mapping, don't insert the reverse of the operation into MemOp2RegOpTable.
|
||||||
|
if (OpTbl1[i][1] & TB_NOT_REVERSABLE)
|
||||||
|
continue;
|
||||||
|
|
||||||
// Index 1, folded load
|
// Index 1, folded load
|
||||||
unsigned AuxInfo = 1 | (1 << 4);
|
unsigned AuxInfo = 1 | (1 << 4);
|
||||||
if (RegOp != X86::FsMOVAPDrr && RegOp != X86::FsMOVAPSrr) {
|
assert(!MemOp2RegOpTable.count(MemOp) && "Duplicate entries");
|
||||||
assert(!MemOp2RegOpTable.count(MemOp) && "Duplicate entries");
|
MemOp2RegOpTable[MemOp] = std::make_pair(RegOp, AuxInfo);
|
||||||
MemOp2RegOpTable[MemOp] = std::make_pair(RegOp, AuxInfo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const unsigned OpTbl2[][3] = {
|
static const unsigned OpTbl2[][3] = {
|
||||||
@ -671,7 +678,6 @@ X86InstrInfo::X86InstrInfo(X86TargetMachine &tm)
|
|||||||
assert(!RegOp2MemOpTable2.count(RegOp) && "Duplicate entry!");
|
assert(!RegOp2MemOpTable2.count(RegOp) && "Duplicate entry!");
|
||||||
RegOp2MemOpTable2[RegOp] = std::make_pair(MemOp, Align);
|
RegOp2MemOpTable2[RegOp] = std::make_pair(MemOp, Align);
|
||||||
|
|
||||||
|
|
||||||
// If this is not a reversable operation (because there is a many->one)
|
// If this is not a reversable operation (because there is a many->one)
|
||||||
// mapping, don't insert the reverse of the operation into MemOp2RegOpTable.
|
// mapping, don't insert the reverse of the operation into MemOp2RegOpTable.
|
||||||
if (OpTbl2[i][1] & TB_NOT_REVERSABLE)
|
if (OpTbl2[i][1] & TB_NOT_REVERSABLE)
|
||||||
|
Loading…
Reference in New Issue
Block a user