Newer
Older
// Binary arithmetic operations...
Chris Lattner
committed
class FPST0rInst<bits<8> o, dag ops, string asm> : I<o, AddRegFrm, ops, asm>, D8 {
list<Register> Uses = [ST0];
list<Register> Defs = [ST0];
}
Chris Lattner
committed
class FPrST0Inst<bits<8> o, dag ops, string asm> : I<o, AddRegFrm, ops, asm>, DC {
list<Register> Uses = [ST0];
}
Chris Lattner
committed
class FPrST0PInst<bits<8> o, dag ops, string asm> : I<o, AddRegFrm, ops, asm>, DE {
list<Register> Uses = [ST0];
}
Chris Lattner
committed
def FADDST0r : FPST0rInst <0xC0, (ops RST:$op), "fadd $op">;
def FADDrST0 : FPrST0Inst <0xC0, (ops RST:$op), "fadd $op, %ST(0)">;
def FADDPrST0 : FPrST0PInst<0xC0, (ops RST:$op), "faddp $op">;
Chris Lattner
committed
def FSUBRST0r : FPST0rInst <0xE8, (ops RST:$op), "fsubr $op">;
def FSUBrST0 : FPrST0Inst <0xE8, (ops RST:$op), "fsub $op, %ST(0)">;
def FSUBPrST0 : FPrST0PInst<0xE8, (ops RST:$op), "fsubp $op">;
Chris Lattner
committed
def FSUBST0r : FPST0rInst <0xE0, (ops RST:$op), "fsub $op">;
def FSUBRrST0 : FPrST0Inst <0xE0, (ops RST:$op), "fsubr $op, %ST(0)">;
def FSUBRPrST0 : FPrST0PInst<0xE0, (ops RST:$op), "fsubrp $op">;
Chris Lattner
committed
def FMULST0r : FPST0rInst <0xC8, (ops RST:$op), "fmul $op">;
def FMULrST0 : FPrST0Inst <0xC8, (ops RST:$op), "fmul $op, %ST(0)">;
def FMULPrST0 : FPrST0PInst<0xC8, (ops RST:$op), "fmulp $op">;
Chris Lattner
committed
def FDIVRST0r : FPST0rInst <0xF8, (ops RST:$op), "fdivr $op">;
def FDIVrST0 : FPrST0Inst <0xF8, (ops RST:$op), "fdiv $op, %ST(0)">;
def FDIVPrST0 : FPrST0PInst<0xF8, (ops RST:$op), "fdivp $op">;
Chris Lattner
committed
def FDIVST0r : FPST0rInst <0xF0, (ops RST:$op), "fdiv $op">; // ST(0) = ST(0) / ST(i)
def FDIVRrST0 : FPrST0Inst <0xF0, (ops RST:$op), "fdivr $op, %ST(0)">; // ST(i) = ST(0) / ST(i)
def FDIVRPrST0 : FPrST0PInst<0xF0, (ops RST:$op), "fdivrp $op">; // ST(i) = ST(0) / ST(i), pop
// Floating point compares
def FUCOMr : FPI<0xE0, AddRegFrm, CompareFP, (ops RST:$reg),
"fucom $reg">, DD, Imp<[ST0],[]>; // FPSW = compare ST(0) with ST(i)
Chris Lattner
committed
def FUCOMPr : I<0xE8, AddRegFrm, (ops RST:$reg),
"fucomp $reg">, DD, Imp<[ST0],[]>; // FPSW = compare ST(0) with ST(i), pop
def FUCOMPPr : I<0xE9, RawFrm, (ops),
"fucompp">, DA, Imp<[ST0],[]>; // compare ST(0) with ST(1), pop, pop
def FUCOMIr : FPI<0xE8, AddRegFrm, CompareFP, (ops RST:$reg),
"fucomi %ST(0), $reg">, DB, Imp<[ST0],[]>; // CC = compare ST(0) with ST(i)
Chris Lattner
committed
def FUCOMIPr : I<0xE8, AddRegFrm, (ops RST:$reg),
"fucomip %ST(0), $reg">, DF, Imp<[ST0],[]>; // CC = compare ST(0) with ST(i), pop
Chris Lattner
committed
def FNSTSW8r : I<0xE0, RawFrm, (ops), "fnstsw">, DF, Imp<[],[AX]>; // AX = fp flags
Chris Lattner
committed
def FNSTCW16m : I<0xD9, MRM7m, (ops i16mem:$dst), "fnstcw $dst">; // [mem16] = X87 control world
def FLDCW16m : I<0xD9, MRM5m, (ops i16mem:$dst), "fldcw $dst">; // X87 control world = [mem16]