Chromium Code Reviews| 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. |