Revision: 19164
Author:   [email protected]
Date:     Thu Feb  6 15:38:09 2014 UTC
Log:      A64: Add support for --optimize-for-size in PushMultipleTimes

BUG=none
[email protected], [email protected]
LOG=n

Review URL: https://codereview.chromium.org/140893009
http://code.google.com/p/v8/source/detail?r=19164

Modified:
 /branches/experimental/a64/src/a64/macro-assembler-a64.cc

=======================================
--- /branches/experimental/a64/src/a64/macro-assembler-a64.cc Thu Feb 6 14:30:18 2014 UTC +++ /branches/experimental/a64/src/a64/macro-assembler-a64.cc Thu Feb 6 15:38:09 2014 UTC
@@ -672,10 +672,19 @@
 void MacroAssembler::PushMultipleTimes(int count, Register src) {
   int size = src.SizeInBytes();

-  // TODO(all): Use a loop when optimizing for size.
-  TODO_UNIMPLEMENTED("PushMultipleTimes: Support --optimize-for-size.");
+  PrepareForPush(count, size);
+
+  if (FLAG_optimize_for_size && count > 8) {
+    Label loop;
+    __ Mov(Tmp0(), count / 2);
+    __ Bind(&loop);
+    PushHelper(2, size, src, src, NoReg, NoReg);
+    __ Subs(Tmp0(), Tmp0(), 1);
+    __ B(ne, &loop);
+
+    count %= 2;
+  }

-  PrepareForPush(count, size);
   // Push up to four registers at a time if possible because if the current
// stack pointer is csp and the register size is 32, registers must be pushed
   // in blocks of four in order to maintain the 16-byte alignment for csp.

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to