(movti): Split CONST_INTs into 4 moves, and force all other constants to
authorJim Wilson <wilson@gcc.gnu.org>
Fri, 25 Sep 1992 05:33:07 +0000 (22:33 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 25 Sep 1992 05:33:07 +0000 (22:33 -0700)
memory.

From-SVN: r2236

gcc/config/a29k/a29k.md

index 8f73924734139fd797e61941adfff1fb9db63886..06fe6f177eb3296cb6055fbd1d76500527665024 100644 (file)
 {
   if (GET_CODE (operands[0]) == MEM)
     operands[1] = force_reg (TImode, operands[1]);
+
+  /* We can't handle constants in general because there is no rtl to represent
+     128 bit constants.  Splitting happens to work for CONST_INTs so we split
+     them for good code.  Other constants will get forced to memory.  */
+
+  if (GET_CODE (operands[1]) == CONST_INT)
+    {
+     rtx part0, part1, part2, part3;
+
+     part0 = operand_subword (operands[0], 0, 1, TImode);
+     part1 = operand_subword (operands[0], 1, 1, TImode);
+     part2 = operand_subword (operands[0], 2, 1, TImode);
+     part3 = operand_subword (operands[0], 3, 1, TImode);
+
+     emit_move_insn (part0, const0_rtx);
+     emit_move_insn (part1, const0_rtx);
+     emit_move_insn (part2, const0_rtx);
+     emit_move_insn (part3, const0_rtx);
+
+     DONE;
+    }
+  else if (CONSTANT_P (operands[1]))
+    {
+      operands[1] = force_const_mem (TImode, operands[1]);
+      if (! memory_address_p (TImode, XEXP (operands[1], 0))
+         && ! reload_in_progress)
+        operands[1] = change_address (operands[1], TImode,
+                                     XEXP (operands[1], 0));
+    }
 }")
 \f
 ;; For compare operations, we simply store the comparison operands and