Introduce a new FP instruction type to separate the compare cases from the

twoarg cases.

llvm-svn: 14143
This commit is contained in:
Chris Lattner 2004-06-11 04:41:24 +00:00
parent f9117d37fd
commit b050f778ca
3 changed files with 13 additions and 12 deletions

View File

@ -215,12 +215,8 @@ bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) {
case X86II::ZeroArgFP: handleZeroArgFP(I); break;
case X86II::OneArgFP: handleOneArgFP(I); break; // fstp ST(0)
case X86II::OneArgFPRW: handleOneArgFPRW(I); break; // ST(0) = fsqrt(ST(0))
case X86II::TwoArgFP:
if (I->getOpcode() != X86::FpUCOM && I->getOpcode() != X86::FpUCOMI)
handleTwoArgFP(I);
else
handleCompareFP(I);
break;
case X86II::TwoArgFP: handleTwoArgFP(I); break;
case X86II::CompareFP: handleCompareFP(I); break;
case X86II::CondMovFP: handleCondMovFP(I); break;
case X86II::SpecialFP: handleSpecialFP(I); break;
default: assert(0 && "Unknown FP Type!");

View File

@ -155,11 +155,15 @@ namespace X86II {
// argument. For example: fadd, fsub, fmul, etc...
TwoArgFP = 4 << FPTypeShift,
// CompareFP - 2 arg FP instructions which implicitly read ST(0) and an
// explicit argument, but have no destination. Example: fucom, fucomi, ...
CompareFP = 5 << FPTypeShift,
// CondMovFP - "2 operand" floating point conditional move instructions.
CondMovFP = 5 << FPTypeShift,
CondMovFP = 6 << FPTypeShift,
// SpecialFP - Special instruction forms. Dispatch by opcode explicitly.
SpecialFP = 6 << FPTypeShift,
SpecialFP = 7 << FPTypeShift,
// PrintImplUsesAfter - Print out implicit uses in the assembly output after
// the normal operands.

View File

@ -66,8 +66,9 @@ def ZeroArgFP : FPFormat<1>;
def OneArgFP : FPFormat<2>;
def OneArgFPRW : FPFormat<3>;
def TwoArgFP : FPFormat<4>;
def CondMovFP : FPFormat<5>;
def SpecialFP : FPFormat<6>;
def CompareFP : FPFormat<5>;
def CondMovFP : FPFormat<6>;
def SpecialFP : FPFormat<7>;
class X86Inst<string nam, bits<8> opcod, Format f, MemType m, ImmType i> : Instruction {
@ -736,8 +737,8 @@ def FpSUB : FPI<"FSUB", 0, Pseudo, TwoArgFP>; // f1 = fsub f2, f3
def FpMUL : FPI<"FMUL", 0, Pseudo, TwoArgFP>; // f1 = fmul f2, f3
def FpDIV : FPI<"FDIV", 0, Pseudo, TwoArgFP>; // f1 = fdiv f2, f3
def FpUCOM : FPI<"FUCOM", 0, Pseudo, TwoArgFP>; // FPSW = fucom f1, f2
def FpUCOMI : FPI<"FUCOMI", 0, Pseudo, TwoArgFP>; // CC = fucomi f1, f2
def FpUCOM : FPI<"FUCOM", 0, Pseudo, CompareFP>; // FPSW = fucom f1, f2
def FpUCOMI : FPI<"FUCOMI", 0, Pseudo, CompareFP>; // CC = fucomi f1, f2
def FpGETRESULT : FPI<"FGETRESULT",0, Pseudo, SpecialFP>; // FPR = ST(0)
def FpSETRESULT : FPI<"FSETRESULT",0, Pseudo, SpecialFP>; // ST(0) = FPR