diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-02-04 02:20:30 +0000 | 
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-02-04 02:20:30 +0000 | 
| commit | 11613a5219155b13f8282d4203fcbb09291557c6 (patch) | |
| tree | 59ec6b7ebdbf5daf762eb7cf03550a01aa3dd2fd | |
| parent | 65ad53feb337a521e5a546e3a3b8ec06042dc2a9 (diff) | |
| download | bcm5719-llvm-11613a5219155b13f8282d4203fcbb09291557c6.tar.gz bcm5719-llvm-11613a5219155b13f8282d4203fcbb09291557c6.zip  | |
Separate FILD and FILD_FLAG, the later is only used for SSE2. It produces a
flag so it can be flagged to a FST.
llvm-svn: 25953
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.h | 10 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.td | 5 | 
3 files changed, 15 insertions, 8 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 1015f5e7af6..def4f570170 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -1476,18 +1476,19 @@ SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) {      std::vector<MVT::ValueType> Tys;      Tys.push_back(MVT::f64);      Tys.push_back(MVT::Other); -    Tys.push_back(MVT::Flag); +    if (X86ScalarSSE) Tys.push_back(MVT::Flag);      std::vector<SDOperand> Ops;      Ops.push_back(Chain);      Ops.push_back(StackSlot);      Ops.push_back(DAG.getValueType(SrcVT)); -    Result = DAG.getNode(X86ISD::FILD, Tys, Ops); +    Result = DAG.getNode(X86ScalarSSE ? X86ISD::FILD_FLAG :X86ISD::FILD, +                         Tys, Ops);      if (X86ScalarSSE) {        Chain = Result.getValue(1);        SDOperand InFlag = Result.getValue(2); -      // FIXME: Currently the FST is flagged to the FILD. This +      // FIXME: Currently the FST is flagged to the FILD_FLAG. This        // shouldn't be necessary except that RFP cannot be live across        // multiple blocks. When stackifier is fixed, they can be uncoupled.        MachineFunction &MF = DAG.getMachineFunction(); @@ -1974,6 +1975,7 @@ const char *X86TargetLowering::getTargetNodeName(unsigned Opcode) const {    case X86ISD::FAND:               return "X86ISD::FAND";    case X86ISD::FXOR:               return "X86ISD::FXOR";    case X86ISD::FILD:               return "X86ISD::FILD"; +  case X86ISD::FILD_FLAG:          return "X86ISD::FILD_FLAG";    case X86ISD::FP_TO_INT16_IN_MEM: return "X86ISD::FP_TO_INT16_IN_MEM";    case X86ISD::FP_TO_INT32_IN_MEM: return "X86ISD::FP_TO_INT32_IN_MEM";    case X86ISD::FP_TO_INT64_IN_MEM: return "X86ISD::FP_TO_INT64_IN_MEM"; diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h index bccd10b3d97..88d8e6ca3fb 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.h +++ b/llvm/lib/Target/X86/X86ISelLowering.h @@ -49,11 +49,13 @@ namespace llvm {        /// to X86::XORPS or X86::XORPD.        FXOR, -      /// FILD - This instruction implements SINT_TO_FP with the integer source -      /// in memory and FP reg result.  This corresponds to the X86::FILD*m -      /// instructions. It has three inputs (token chain, address, and source -      /// type) and three outputs (FP value, token chain, and a flag). +      /// FILD, FILD_FLAG - This instruction implements SINT_TO_FP with the +      /// integer source in memory and FP reg result.  This corresponds to the +      /// X86::FILD*m instructions. It has three inputs (token chain, address, +      /// and source type) and two outputs (FP value and token chain). FILD_FLAG +      /// also produces a flag).        FILD, +      FILD_FLAG,        /// FP_TO_INT*_IN_MEM - This instruction implements FP_TO_SINT with the        /// integer destination in memory and a FP reg source.  This corresponds diff --git a/llvm/lib/Target/X86/X86InstrInfo.td b/llvm/lib/Target/X86/X86InstrInfo.td index 7e228d30238..3e8cc09f4bf 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.td +++ b/llvm/lib/Target/X86/X86InstrInfo.td @@ -108,6 +108,8 @@ def X86fld     : SDNode<"X86ISD::FLD",      SDTX86Fld,  def X86fst     : SDNode<"X86ISD::FST",      SDTX86Fst,                          [SDNPHasChain, SDNPInFlag]>;  def X86fild    : SDNode<"X86ISD::FILD",     SDTX86Fild, +                        [SDNPHasChain]>; +def X86fildflag: SDNode<"X86ISD::FILD_FLAG",SDTX86Fild,                          [SDNPHasChain, SDNPOutFlag]>;  def X86fp_to_i16mem : SDNode<"X86ISD::FP_TO_INT16_IN_MEM", SDTX86FpToIMem,                          [SDNPHasChain]>; @@ -3121,7 +3123,8 @@ def : Pat<(f64 fp64immneg0), (FpCHS (FpLD0))>, Requires<[FPStack]>;  def : Pat<(f64 fp64immneg1), (FpCHS (FpLD1))>, Requires<[FPStack]>;  // Used to conv. i64 to f64 since there isn't a SSE version. -def : Pat<(X86fild addr:$src, i64), (FpILD64m addr:$src)>, Requires<[HasSSE2]>; +def : Pat<(X86fildflag addr:$src, i64), (FpILD64m addr:$src)>, +      Requires<[HasSSE2]>;  //===----------------------------------------------------------------------===//  // Some peepholes  | 

