diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-03-26 19:13:54 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-03-26 19:13:54 +0000 |
commit | 7279f4b00d06238fa2faa378a526eae4704560c0 (patch) | |
tree | 50c612451294aab97293732957f1ab11748fb4cf /llvm/lib | |
parent | 6fc2ec96b83925dc9cf87100aed179d7548792fe (diff) | |
download | bcm5719-llvm-7279f4b00d06238fa2faa378a526eae4704560c0.tar.gz bcm5719-llvm-7279f4b00d06238fa2faa378a526eae4704560c0.zip |
[PowerPC] Use v2f64 <-> v2i64 VSX conversion instructions
llvm-svn: 204843
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrVSX.td | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 0aa76774c6d..e09725d59d2 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -584,6 +584,11 @@ PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM) setOperationAction(ISD::STORE, MVT::v2i64, Promote); AddPromotedToType (ISD::STORE, MVT::v2i64, MVT::v2f64); + setOperationAction(ISD::SINT_TO_FP, MVT::v2i64, Legal); + setOperationAction(ISD::UINT_TO_FP, MVT::v2i64, Legal); + setOperationAction(ISD::FP_TO_SINT, MVT::v2i64, Legal); + setOperationAction(ISD::FP_TO_UINT, MVT::v2i64, Legal); + addRegisterClass(MVT::v2i64, &PPC::VSRCRegClass); } } diff --git a/llvm/lib/Target/PowerPC/PPCInstrVSX.td b/llvm/lib/Target/PowerPC/PPCInstrVSX.td index bc0d180998d..8410912c20a 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrVSX.td +++ b/llvm/lib/Target/PowerPC/PPCInstrVSX.td @@ -512,13 +512,15 @@ let Uses = [RM] in { "xvcvdpsp $XT, $XB", IIC_VecFP, []>; def XVCVDPSXDS : XX2Form<60, 472, (outs vsrc:$XT), (ins vsrc:$XB), - "xvcvdpsxds $XT, $XB", IIC_VecFP, []>; + "xvcvdpsxds $XT, $XB", IIC_VecFP, + [(set v2i64:$XT, (fp_to_sint v2f64:$XB))]>; def XVCVDPSXWS : XX2Form<60, 216, (outs vsrc:$XT), (ins vsrc:$XB), "xvcvdpsxws $XT, $XB", IIC_VecFP, []>; def XVCVDPUXDS : XX2Form<60, 456, (outs vsrc:$XT), (ins vsrc:$XB), - "xvcvdpuxds $XT, $XB", IIC_VecFP, []>; + "xvcvdpuxds $XT, $XB", IIC_VecFP, + [(set v2i64:$XT, (fp_to_uint v2f64:$XB))]>; def XVCVDPUXWS : XX2Form<60, 200, (outs vsrc:$XT), (ins vsrc:$XB), "xvcvdpuxws $XT, $XB", IIC_VecFP, []>; @@ -540,7 +542,8 @@ let Uses = [RM] in { "xvcvspuxws $XT, $XB", IIC_VecFP, []>; def XVCVSXDDP : XX2Form<60, 504, (outs vsrc:$XT), (ins vsrc:$XB), - "xvcvsxddp $XT, $XB", IIC_VecFP, []>; + "xvcvsxddp $XT, $XB", IIC_VecFP, + [(set v2f64:$XT, (sint_to_fp v2i64:$XB))]>; def XVCVSXDSP : XX2Form<60, 440, (outs vsrc:$XT), (ins vsrc:$XB), "xvcvsxdsp $XT, $XB", IIC_VecFP, []>; @@ -552,7 +555,8 @@ let Uses = [RM] in { "xvcvsxwsp $XT, $XB", IIC_VecFP, []>; def XVCVUXDDP : XX2Form<60, 488, (outs vsrc:$XT), (ins vsrc:$XB), - "xvcvuxddp $XT, $XB", IIC_VecFP, []>; + "xvcvuxddp $XT, $XB", IIC_VecFP, + [(set v2f64:$XT, (uint_to_fp v2i64:$XB))]>; def XVCVUXDSP : XX2Form<60, 424, (outs vsrc:$XT), (ins vsrc:$XB), "xvcvuxdsp $XT, $XB", IIC_VecFP, []>; |