diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-07-10 23:46:13 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-07-10 23:46:13 +0000 |
| commit | 87909d0629355a12d3cdaee5afde8529dd4188fd (patch) | |
| tree | bb207eb8e57d45cfb9449db12924559fee69ca0f /llvm/lib/CodeGen | |
| parent | 17b234cf9b84f428ed4eab01bcf6766981fc3e6e (diff) | |
| download | bcm5719-llvm-87909d0629355a12d3cdaee5afde8529dd4188fd.tar.gz bcm5719-llvm-87909d0629355a12d3cdaee5afde8529dd4188fd.zip | |
Fix a bug in the soft-float handling of FCOPYSIGN that Duncan noticed
when working on legalizetypes. Both legalizetypes and legalizeops now
produce hte same code for CodeGen/ARM/fcopysign.ll.
llvm-svn: 53435
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 80502cfe698..4b4c02bd8d8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -547,8 +547,11 @@ SDOperand ExpandFCOPYSIGNToBitwiseOps(SDNode *Node, MVT NVT, SignBit = DAG.getNode(ISD::SRL, SrcNVT, SignBit, DAG.getConstant(SizeDiff, TLI.getShiftAmountTy())); SignBit = DAG.getNode(ISD::TRUNCATE, NVT, SignBit); - } else if (SizeDiff < 0) - SignBit = DAG.getNode(ISD::SIGN_EXTEND, NVT, SignBit); + } else if (SizeDiff < 0) { + SignBit = DAG.getNode(ISD::ZERO_EXTEND, NVT, SignBit); + SignBit = DAG.getNode(ISD::SHL, NVT, SignBit, + DAG.getConstant(-SizeDiff, TLI.getShiftAmountTy())); + } // Clear the sign bit of first operand. SDOperand Mask2 = (VT == MVT::f64) |

