Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/X86/X86InstrFPStack.td
Show All 16 Lines | |||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
def SDTX86Fld : SDTypeProfile<1, 1, [SDTCisFP<0>, | def SDTX86Fld : SDTypeProfile<1, 1, [SDTCisFP<0>, | ||||
SDTCisPtrTy<1>]>; | SDTCisPtrTy<1>]>; | ||||
def SDTX86Fst : SDTypeProfile<0, 2, [SDTCisFP<0>, | def SDTX86Fst : SDTypeProfile<0, 2, [SDTCisFP<0>, | ||||
SDTCisPtrTy<1>]>; | SDTCisPtrTy<1>]>; | ||||
def SDTX86Fild : SDTypeProfile<1, 1, [SDTCisFP<0>, SDTCisPtrTy<1>]>; | def SDTX86Fild : SDTypeProfile<1, 1, [SDTCisFP<0>, SDTCisPtrTy<1>]>; | ||||
def SDTX86Fist : SDTypeProfile<0, 2, [SDTCisFP<0>, SDTCisPtrTy<1>]>; | def SDTX86Fist : SDTypeProfile<0, 2, [SDTCisFP<0>, SDTCisPtrTy<1>]>; | ||||
def SDTX86Fnstsw : SDTypeProfile<1, 1, [SDTCisVT<0, i16>, SDTCisVT<1, i16>]>; | |||||
def SDTX86CwdStore : SDTypeProfile<0, 1, [SDTCisPtrTy<0>]>; | def SDTX86CwdStore : SDTypeProfile<0, 1, [SDTCisPtrTy<0>]>; | ||||
def X86fld : SDNode<"X86ISD::FLD", SDTX86Fld, | def X86fld : SDNode<"X86ISD::FLD", SDTX86Fld, | ||||
[SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; | [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; | ||||
def X86fst : SDNode<"X86ISD::FST", SDTX86Fst, | def X86fst : SDNode<"X86ISD::FST", SDTX86Fst, | ||||
[SDNPHasChain, SDNPMayStore, SDNPMemOperand]>; | [SDNPHasChain, SDNPMayStore, SDNPMemOperand]>; | ||||
def X86fild : SDNode<"X86ISD::FILD", SDTX86Fild, | def X86fild : SDNode<"X86ISD::FILD", SDTX86Fild, | ||||
[SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; | [SDNPHasChain, SDNPMayLoad, SDNPMemOperand]>; | ||||
def X86fist : SDNode<"X86ISD::FIST", SDTX86Fist, | def X86fist : SDNode<"X86ISD::FIST", SDTX86Fist, | ||||
[SDNPHasChain, SDNPMayStore, SDNPMemOperand]>; | [SDNPHasChain, SDNPMayStore, SDNPMemOperand]>; | ||||
def X86fp_stsw : SDNode<"X86ISD::FNSTSW16r", SDTX86Fnstsw>; | |||||
def X86fp_to_mem : SDNode<"X86ISD::FP_TO_INT_IN_MEM", SDTX86Fst, | def X86fp_to_mem : SDNode<"X86ISD::FP_TO_INT_IN_MEM", SDTX86Fst, | ||||
[SDNPHasChain, SDNPMayStore, SDNPMemOperand]>; | [SDNPHasChain, SDNPMayStore, SDNPMemOperand]>; | ||||
def X86fp_cwd_get16 : SDNode<"X86ISD::FNSTCW16m", SDTX86CwdStore, | def X86fp_cwd_get16 : SDNode<"X86ISD::FNSTCW16m", SDTX86CwdStore, | ||||
[SDNPHasChain, SDNPMayStore, SDNPSideEffect, | [SDNPHasChain, SDNPMayStore, SDNPSideEffect, | ||||
SDNPMemOperand]>; | SDNPMemOperand]>; | ||||
def X86fstf32 : PatFrag<(ops node:$val, node:$ptr), | def X86fstf32 : PatFrag<(ops node:$val, node:$ptr), | ||||
(X86fst node:$val, node:$ptr), [{ | (X86fst node:$val, node:$ptr), [{ | ||||
▲ Show 20 Lines • Show All 587 Lines • ▼ Show 20 Lines | |||||
def FLDL2T : I<0xD9, MRM_E9, (outs), (ins), "fldl2t", []>; | def FLDL2T : I<0xD9, MRM_E9, (outs), (ins), "fldl2t", []>; | ||||
def FLDL2E : I<0xD9, MRM_EA, (outs), (ins), "fldl2e", []>; | def FLDL2E : I<0xD9, MRM_EA, (outs), (ins), "fldl2e", []>; | ||||
def FLDPI : I<0xD9, MRM_EB, (outs), (ins), "fldpi", []>; | def FLDPI : I<0xD9, MRM_EB, (outs), (ins), "fldpi", []>; | ||||
def FLDLG2 : I<0xD9, MRM_EC, (outs), (ins), "fldlg2", []>; | def FLDLG2 : I<0xD9, MRM_EC, (outs), (ins), "fldlg2", []>; | ||||
def FLDLN2 : I<0xD9, MRM_ED, (outs), (ins), "fldln2", []>; | def FLDLN2 : I<0xD9, MRM_ED, (outs), (ins), "fldln2", []>; | ||||
} // SchedRW | } // SchedRW | ||||
// Floating point compares. | // Floating point compares. | ||||
let SchedRW = [WriteFCom], Uses = [FPCW] in { | let SchedRW = [WriteFCom], Uses = [FPCW], hasSideEffects = 0 in { | ||||
def UCOM_Fpr32 : FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP, | def UCOM_Fpr32 : FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP, []>; | ||||
[(set FPSW, (trunc (X86any_fcmp RFP32:$lhs, RFP32:$rhs)))]>; | def UCOM_Fpr64 : FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP, []>; | ||||
def UCOM_Fpr64 : FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP, | def UCOM_Fpr80 : FpI_ <(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP, []>; | ||||
[(set FPSW, (trunc (X86any_fcmp RFP64:$lhs, RFP64:$rhs)))]>; | def COM_Fpr32 : FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP, []>; | ||||
def UCOM_Fpr80 : FpI_ <(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP, | def COM_Fpr64 : FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP, []>; | ||||
[(set FPSW, (trunc (X86any_fcmp RFP80:$lhs, RFP80:$rhs)))]>; | def COM_Fpr80 : FpI_ <(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP, []>; | ||||
def COM_Fpr32 : FpIf32<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP, | |||||
[(set FPSW, (trunc (X86strict_fcmps RFP32:$lhs, RFP32:$rhs)))]>; | |||||
def COM_Fpr64 : FpIf64<(outs), (ins RFP64:$lhs, RFP64:$rhs), CompareFP, | |||||
[(set FPSW, (trunc (X86strict_fcmps RFP64:$lhs, RFP64:$rhs)))]>; | |||||
def COM_Fpr80 : FpI_ <(outs), (ins RFP80:$lhs, RFP80:$rhs), CompareFP, | |||||
[(set FPSW, (trunc (X86strict_fcmps RFP80:$lhs, RFP80:$rhs)))]>; | |||||
} // SchedRW | } // SchedRW | ||||
} // mayRaiseFPException = 1 | } // mayRaiseFPException = 1 | ||||
let SchedRW = [WriteFCom], mayRaiseFPException = 1 in { | let SchedRW = [WriteFCom], mayRaiseFPException = 1 in { | ||||
// CC = ST(0) cmp ST(i) | // CC = ST(0) cmp ST(i) | ||||
let Defs = [EFLAGS, FPSW], Uses = [FPCW] in { | let Defs = [EFLAGS, FPSW], Uses = [FPCW] in { | ||||
def UCOM_FpIr32: FpI_<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP, | def UCOM_FpIr32: FpI_<(outs), (ins RFP32:$lhs, RFP32:$rhs), CompareFP, | ||||
[(set EFLAGS, (X86any_fcmp RFP32:$lhs, RFP32:$rhs))]>, | [(set EFLAGS, (X86any_fcmp RFP32:$lhs, RFP32:$rhs))]>, | ||||
Show All 34 Lines | def COM_FIr : FPI<0xDB, MRM6r, (outs), (ins RSTi:$reg), | ||||
"fcomi\t{$reg, %st|st, $reg}">; | "fcomi\t{$reg, %st|st, $reg}">; | ||||
def COM_FIPr : FPI<0xDF, MRM6r, (outs), (ins RSTi:$reg), | def COM_FIPr : FPI<0xDF, MRM6r, (outs), (ins RSTi:$reg), | ||||
"fcompi\t{$reg, %st|st, $reg}">; | "fcompi\t{$reg, %st|st, $reg}">; | ||||
} | } | ||||
} // SchedRW | } // SchedRW | ||||
// Floating point flag ops. | // Floating point flag ops. | ||||
let SchedRW = [WriteALU] in { | let SchedRW = [WriteALU] in { | ||||
let Defs = [AX, FPSW], Uses = [FPSW] in | let Defs = [AX, FPSW], Uses = [FPSW], hasSideEffects = 0 in | ||||
def FNSTSW16r : I<0xDF, MRM_E0, // AX = fp flags | def FNSTSW16r : I<0xDF, MRM_E0, // AX = fp flags | ||||
(outs), (ins), "fnstsw\t{%ax|ax}", | (outs), (ins), "fnstsw\t{%ax|ax}", []>; | ||||
[(set AX, (X86fp_stsw FPSW))]>; | |||||
let Defs = [FPSW], Uses = [FPCW] in | let Defs = [FPSW], Uses = [FPCW] in | ||||
def FNSTCW16m : I<0xD9, MRM7m, // [mem16] = X87 control world | def FNSTCW16m : I<0xD9, MRM7m, // [mem16] = X87 control world | ||||
(outs), (ins i16mem:$dst), "fnstcw\t$dst", | (outs), (ins i16mem:$dst), "fnstcw\t$dst", | ||||
[(X86fp_cwd_get16 addr:$dst)]>; | [(X86fp_cwd_get16 addr:$dst)]>; | ||||
} // SchedRW | } // SchedRW | ||||
let Defs = [FPSW,FPCW], mayLoad = 1 in | let Defs = [FPSW,FPCW], mayLoad = 1 in | ||||
def FLDCW16m : I<0xD9, MRM5m, // X87 control world = [mem16] | def FLDCW16m : I<0xD9, MRM5m, // X87 control world = [mem16] | ||||
(outs), (ins i16mem:$dst), "fldcw\t$dst", []>, | (outs), (ins i16mem:$dst), "fldcw\t$dst", []>, | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |