Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: src/a64/macro-assembler-a64.cc

Issue 140893009: A64: Add support for --optimize-for-size in PushMultipleTimes (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/macro-assembler-a64.cc
diff --git a/src/a64/macro-assembler-a64.cc b/src/a64/macro-assembler-a64.cc
index 3d2d24e9e9277c2be15b3099de9e7cdca94e53df..9b600bc195be0d9d8505565db5ba36ad02003afb 100644
--- a/src/a64/macro-assembler-a64.cc
+++ b/src/a64/macro-assembler-a64.cc
@@ -672,10 +672,18 @@ void MacroAssembler::PopCPURegList(CPURegList registers) {
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 > 4) {
Rodolph Perfetta (ARM) 2014/02/06 15:14:36 The code below is 4 instructions long, PushMultipl
+ Label loop;
+ __ Mov(Tmp0(), count);
+ __ Bind(&loop);
+ PushHelper(1, size, src, NoReg, NoReg, NoReg);
ulan 2014/02/06 14:53:12 Optimization: push 4 values at once (count / 4) ti
Rodolph Perfetta (ARM) 2014/02/06 15:14:36 if count is even you can push two at a time with n
Rodolph Perfetta (ARM) 2014/02/06 15:14:36 4 at a time will be faster but bigger, is that wha
+ __ Subs(Tmp0(), Tmp0(), 1);
+ __ B(ne, &loop);
+ return;
+ }
+
// 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698