public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386]: Simplify allocate_stack expander
@ 2012-03-19 22:18 Uros Bizjak
  0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2012-03-19 22:18 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

Hello!

No functional change.

2012-03-19  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/i386.md (allocate_stack): Simplify.

Tested on x86_64-pc-linux-gnu, committed to mainline SVN.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 1450 bytes --]

Index: i386/i386.md
===================================================================
--- i386/i386.md	(revision 185541)
+++ i386/i386.md	(working copy)
@@ -16729,25 +16729,26 @@
 
   if (CHECK_STACK_LIMIT && CONST_INT_P (operands[1])
       && INTVAL (operands[1]) < CHECK_STACK_LIMIT)
-    {
-      x = expand_simple_binop (Pmode, MINUS, stack_pointer_rtx, operands[1],
-			       stack_pointer_rtx, 0, OPTAB_DIRECT);
-      if (x != stack_pointer_rtx)
-	emit_move_insn (stack_pointer_rtx, x);
-    }
+    x = operands[1];
   else
     {
-      x = copy_addr_to_reg (operands[1]);
-      if (TARGET_64BIT)
-        emit_insn (gen_allocate_stack_worker_probe_di (x, x));
-      else
-        emit_insn (gen_allocate_stack_worker_probe_si (x, x));
-      x = expand_simple_binop (Pmode, MINUS, stack_pointer_rtx, x,
-			       stack_pointer_rtx, 0, OPTAB_DIRECT);
-      if (x != stack_pointer_rtx)
-	emit_move_insn (stack_pointer_rtx, x);
+      rtx (*insn) (rtx, rtx);
+
+      x = copy_to_mode_reg (Pmode, operands[1]);
+
+      insn = (TARGET_64BIT
+	      ? gen_allocate_stack_worker_probe_di
+	      : gen_allocate_stack_worker_probe_si);
+
+      emit_insn (insn (x, x));
     }
 
+  x = expand_simple_binop (Pmode, MINUS, stack_pointer_rtx, x,
+			   stack_pointer_rtx, 0, OPTAB_DIRECT);
+
+  if (x != stack_pointer_rtx)
+    emit_move_insn (stack_pointer_rtx, x);
+
   emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
   DONE;
 })

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-03-19 22:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-19 22:18 [PATCH, i386]: Simplify allocate_stack expander Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).