Also expand 64-bit bitcasts.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 20 May 2013 01:01:43 +0000 (01:01 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 20 May 2013 01:01:43 +0000 (01:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182229 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcISelLowering.cpp
test/CodeGen/SPARC/64bit.ll

index d470fb312dc58a483029fe74cf67e8ed01421a60..695cb5106b1384e2dbb84c7bcaddd3714d86935c 100644 (file)
@@ -1300,6 +1300,8 @@ SparcTargetLowering::SparcTargetLowering(TargetMachine &TM)
   setOperationAction(ISD::SELECT_CC, MVT::f64, Custom);
 
   if (Subtarget->is64Bit()) {
+    setOperationAction(ISD::BITCAST, MVT::f64, Expand);
+    setOperationAction(ISD::BITCAST, MVT::i64, Expand);
     setOperationAction(ISD::SELECT, MVT::i64, Expand);
     setOperationAction(ISD::SETCC, MVT::i64, Expand);
     setOperationAction(ISD::BR_CC, MVT::i64, Custom);
index c9413b73524b100d4022fe96880b99e051c13ec7..8e7abe83ebe5b4d8af35c4944672f88fedd4c34a 100644 (file)
@@ -209,3 +209,19 @@ define i64 @spill_i64(i64 %x) {
   call void asm sideeffect "", "~{i0},~{i1},~{i2},~{i3},~{i4},~{i5},~{o0},~{o1},~{o2},~{o3},~{o4},~{o5},~{o7},~{l0},~{l1},~{l2},~{l3},~{l4},~{l5},~{l6},~{l7},~{g1},~{g2},~{g3},~{g4},~{g5},~{g6},~{g7}"()
   ret i64 %x
 }
+
+; CHECK: bitcast_i64_f64
+; CHECK: std
+; CHECK: ldx
+define i64 @bitcast_i64_f64(double %x) {
+  %y = bitcast double %x to i64
+  ret i64 %y
+}
+
+; CHECK: bitcast_f64_i64
+; CHECK: stx
+; CHECK: ldd
+define double @bitcast_f64_i64(i64 %x) {
+  %y = bitcast i64 %x to double
+  ret double %y
+}