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

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: updates 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..28b56dd47417b988c67ef3f0837a9f787ffe8b61 100644
--- a/src/a64/macro-assembler-a64.cc
+++ b/src/a64/macro-assembler-a64.cc
@@ -672,10 +672,19 @@ 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 > 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;
+ }
+
// 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