diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-07-16 14:27:01 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-07-16 14:27:01 +0000 |
commit | 05a0b8bc661b5a1565c54e021c353ef191fa3f61 (patch) | |
tree | 720a5dc1f38060ce2037eef42b198e3c5b76fe53 | |
parent | b6831cb044a7f3dccd5ad80cd36b98175b9646ad (diff) | |
download | external_llvm-05a0b8bc661b5a1565c54e021c353ef191fa3f61.zip external_llvm-05a0b8bc661b5a1565c54e021c353ef191fa3f61.tar.gz external_llvm-05a0b8bc661b5a1565c54e021c353ef191fa3f61.tar.bz2 |
Handle bitconverts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76042 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/SystemZ/SystemZISelLowering.cpp | 4 | ||||
-rw-r--r-- | lib/Target/SystemZ/SystemZInstrFP.td | 7 | ||||
-rw-r--r-- | lib/Target/SystemZ/SystemZInstrInfo.td | 9 |
3 files changed, 16 insertions, 4 deletions
diff --git a/lib/Target/SystemZ/SystemZISelLowering.cpp b/lib/Target/SystemZ/SystemZISelLowering.cpp index 757255e..05797c8 100644 --- a/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -129,6 +129,10 @@ SystemZTargetLowering::SystemZTargetLowering(SystemZTargetMachine &tm) : setOperationAction(ISD::FCOS, MVT::f32, Expand); setOperationAction(ISD::FCOS, MVT::f64, Expand); + // We have only 64-bit bitconverts + setOperationAction(ISD::BIT_CONVERT, MVT::f32, Promote); + setOperationAction(ISD::BIT_CONVERT, MVT::i32, Promote); + setOperationAction(ISD::UINT_TO_FP, MVT::i32, Expand); setOperationAction(ISD::UINT_TO_FP, MVT::i64, Expand); setOperationAction(ISD::FP_TO_UINT, MVT::i32, Expand); diff --git a/lib/Target/SystemZ/SystemZInstrFP.td b/lib/Target/SystemZ/SystemZInstrFP.td index 9e367fe..5972264 100644 --- a/lib/Target/SystemZ/SystemZInstrFP.td +++ b/lib/Target/SystemZ/SystemZInstrFP.td @@ -295,6 +295,13 @@ def FCONVGR64 : Pseudo<(outs GR64:$dst), (ins FP64:$src), (implicit PSW)]>; } // Defs = [PSW] +def FBCONVG64 : Pseudo<(outs GR64:$dst), (ins FP64:$src), + "lgdr\t{$dst, $src}", + [(set GR64:$dst, (bitconvert FP64:$src))]>; +def FBCONVF64 : Pseudo<(outs FP64:$dst), (ins GR64:$src), + "ldgr\t{$dst, $src}", + [(set FP64:$dst, (bitconvert GR64:$src))]>; + //===----------------------------------------------------------------------===// // Test instructions (like AND but do not produce any result) diff --git a/lib/Target/SystemZ/SystemZInstrInfo.td b/lib/Target/SystemZ/SystemZInstrInfo.td index 5672b04..7bfd8eb 100644 --- a/lib/Target/SystemZ/SystemZInstrInfo.td +++ b/lib/Target/SystemZ/SystemZInstrInfo.td @@ -785,7 +785,11 @@ def : Pat<(SystemZcall (i64 texternalsym:$dst)), (CALLi texternalsym:$dst)>; // FIXME: use add/sub tricks with 32678/-32768 -// Arbitrary immediate support. Implement in terms of LLIHF/OILF. +// Arbitrary immediate support. +def : Pat<(i32 imm:$src), + (EXTRACT_SUBREG (MOV64ri32 (i64 imm:$src)), subreg_32bit)>; + +// Implement in terms of LLIHF/OILF. def : Pat<(i64 imm:$imm), (OR64rilo32 (MOV64rihi32 (HI32 imm:$imm)), (LO32 imm:$imm))>; @@ -821,6 +825,3 @@ def : Pat<(mulhu GR64:$src1, GR64:$src2), GR64:$src1, subreg_odd), GR64:$src2), subreg_even)>; - -def : Pat<(i32 imm:$src), - (EXTRACT_SUBREG (MOV64ri32 (i64 imm:$src)), subreg_32bit)>; |