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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 // but if we keep it matching StackPointer, the simulator can detect memory 665 // but if we keep it matching StackPointer, the simulator can detect memory
666 // accesses in the now-free part of the stack. 666 // accesses in the now-free part of the stack.
667 Mov(csp, StackPointer()); 667 Mov(csp, StackPointer());
668 } 668 }
669 } 669 }
670 670
671 671
672 void MacroAssembler::PushMultipleTimes(int count, Register src) { 672 void MacroAssembler::PushMultipleTimes(int count, Register src) {
673 int size = src.SizeInBytes(); 673 int size = src.SizeInBytes();
674 674
675 // TODO(all): Use a loop when optimizing for size. 675 PrepareForPush(count, size);
676 TODO_UNIMPLEMENTED("PushMultipleTimes: Support --optimize-for-size.");
677 676
678 PrepareForPush(count, size); 677 if (FLAG_optimize_for_size && count > 8) {
678 Label loop;
679 __ Mov(Tmp0(), count / 2);
680 __ Bind(&loop);
681 PushHelper(2, size, src, src, NoReg, NoReg);
682 __ Subs(Tmp0(), Tmp0(), 1);
683 __ B(ne, &loop);
684
685 count %= 2;
686 }
687
679 // Push up to four registers at a time if possible because if the current 688 // Push up to four registers at a time if possible because if the current
680 // stack pointer is csp and the register size is 32, registers must be pushed 689 // stack pointer is csp and the register size is 32, registers must be pushed
681 // in blocks of four in order to maintain the 16-byte alignment for csp. 690 // in blocks of four in order to maintain the 16-byte alignment for csp.
682 while (count >= 4) { 691 while (count >= 4) {
683 PushHelper(4, size, src, src, src, src); 692 PushHelper(4, size, src, src, src, src);
684 count -= 4; 693 count -= 4;
685 } 694 }
686 if (count >= 2) { 695 if (count >= 2) {
687 PushHelper(2, size, src, src, NoReg, NoReg); 696 PushHelper(2, size, src, src, NoReg, NoReg);
688 count -= 2; 697 count -= 2;
(...skipping 4141 matching lines...) Expand 10 before | Expand all | Expand 10 after
4830 } 4839 }
4831 } 4840 }
4832 4841
4833 4842
4834 #undef __ 4843 #undef __
4835 4844
4836 4845
4837 } } // namespace v8::internal 4846 } } // namespace v8::internal
4838 4847
4839 #endif // V8_TARGET_ARCH_A64 4848 #endif // V8_TARGET_ARCH_A64
OLDNEW
« 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