(movxf): Add pattern for soft-float moves.
authorRichard Stallman <rms@gnu.org>
Thu, 29 Apr 1993 16:59:21 +0000 (16:59 +0000)
committerRichard Stallman <rms@gnu.org>
Thu, 29 Apr 1993 16:59:21 +0000 (16:59 +0000)
From-SVN: r4275

gcc/config/m68k/m68k.md

index ef98e562560927343bdd08c41cc9629922067ef2..77daee4a74668091028356935437e522e7bcd3c9 100644 (file)
 (define_expand "movxf"
   [(set (match_operand:XF 0 "nonimmediate_operand" "")
        (match_operand:XF 1 "general_operand" ""))]
-  "TARGET_68881"
+  ""
   "
 {
   if (CONSTANT_P (operands[1]))
 }
 ")
 
+(define_insn ""
+  [(set (match_operand:XF 0 "nonimmediate_operand" "=rm,&rf,&rof<>")
+       (match_operand:XF 1 "nonimmediate_operand" "rf,m,rof<>"))]
+  "! TARGET_68881"
+  "*
+{
+  if (FP_REG_P (operands[0]))
+    {
+      if (FP_REG_P (operands[1]))
+       return \"fmove%.x %1,%0\";
+      if (REG_P (operands[1]))
+       {
+         rtx xoperands[2];
+         xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 2);
+         output_asm_insn (\"move%.l %1,%-\", xoperands);
+         xoperands[1] = gen_rtx (REG, SImode, REGNO (operands[1]) + 1);
+         output_asm_insn (\"move%.l %1,%-\", xoperands);
+         output_asm_insn (\"move%.l %1,%-\", operands);
+         return \"fmove%.x %+,%0\";
+       }
+      if (GET_CODE (operands[1]) == CONST_DOUBLE)
+        return \"fmove%.x %1,%0\";
+      return \"fmove%.x %f1,%0\";
+    }
+  if (FP_REG_P (operands[1]))
+    {
+      if (REG_P (operands[0]))
+        {
+          output_asm_insn (\"fmove%.x %f1,%-\;move%.l %+,%0\", operands);
+          operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+          output_asm_insn (\"move%.l %+,%0\", operands);
+          operands[0] = gen_rtx (REG, SImode, REGNO (operands[0]) + 1);
+          return \"move%.l %+,%0\";
+        }
+      else
+        return \"fmove%.x %f1,%0\";
+    }
+  return output_move_double (operands);
+}
+")
+
 ;; movdi can apply to fp regs in some cases
 (define_insn "movdi"
   ;; Let's see if it really still needs to handle fp regs, and, if so, why.