diff options
| author | Sirish Pande <spande@codeaurora.org> | 2012-05-10 20:20:25 +0000 | 
|---|---|---|
| committer | Sirish Pande <spande@codeaurora.org> | 2012-05-10 20:20:25 +0000 | 
| commit | 69295b89639a8f319c4c869d3d684acc136e79aa (patch) | |
| tree | 1c634ccd2f20ffd9ea19cca106d41c378f33cf45 /llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp | |
| parent | 11ebc4ed1bcd4c3ba615e720ef8db32bccea8ac9 (diff) | |
| download | bcm5719-llvm-69295b89639a8f319c4c869d3d684acc136e79aa.tar.gz bcm5719-llvm-69295b89639a8f319c4c869d3d684acc136e79aa.zip  | |
Hexagon V5 FP Support.
llvm-svn: 156568
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp')
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp | 24 | 
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp index b50cadd2975..5499134eb98 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp @@ -90,7 +90,9 @@ public:    SDNode *SelectMul(SDNode *N);    SDNode *SelectZeroExtend(SDNode *N);    SDNode *SelectIntrinsicWOChain(SDNode *N); +  SDNode *SelectIntrinsicWChain(SDNode *N);    SDNode *SelectConstant(SDNode *N); +  SDNode *SelectConstantFP(SDNode *N);    SDNode *SelectAdd(SDNode *N);    // Include the pieces autogenerated from the target description. @@ -1158,6 +1160,25 @@ SDNode *HexagonDAGToDAGISel::SelectIntrinsicWOChain(SDNode *N) {    return SelectCode(N);  } +// +// Map floating point constant values. +// +SDNode *HexagonDAGToDAGISel::SelectConstantFP(SDNode *N) { +  DebugLoc dl = N->getDebugLoc(); +  ConstantFPSDNode *CN = dyn_cast<ConstantFPSDNode>(N); +  APFloat APF = CN->getValueAPF(); +  if (N->getValueType(0) == MVT::f32) { +    return CurDAG->getMachineNode(Hexagon::TFRI_f, dl, MVT::f32, +              CurDAG->getTargetConstantFP(APF.convertToFloat(), MVT::f32)); +  } +  else if (N->getValueType(0) == MVT::f64) { +    return CurDAG->getMachineNode(Hexagon::CONST64_Float_Real, dl, MVT::f64, +              CurDAG->getTargetConstantFP(APF.convertToDouble(), MVT::f64)); +  } + +  return SelectCode(N); +} +  //  // Map predicate true (encoded as -1 in LLVM) to a XOR. @@ -1234,6 +1255,9 @@ SDNode *HexagonDAGToDAGISel::Select(SDNode *N) {    case ISD::Constant:      return SelectConstant(N); +  case ISD::ConstantFP: +    return SelectConstantFP(N); +    case ISD::ADD:      return SelectAdd(N);  | 

