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

Unified Diff: src/ppc/builtins-ppc.cc

Issue 2125913004: PPC/s390: [builtins] Fix MathMaxMin on arm and arm64 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 | src/s390/builtins-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/builtins-ppc.cc
diff --git a/src/ppc/builtins-ppc.cc b/src/ppc/builtins-ppc.cc
index b1b012526d28ef09be79f9b27755587b5f489c55..9beda8f6aca52c4fab745d07d9d3c9dd8f2ef1df 100644
--- a/src/ppc/builtins-ppc.cc
+++ b/src/ppc/builtins-ppc.cc
@@ -126,12 +126,12 @@ void Builtins::Generate_ArrayCode(MacroAssembler* masm) {
// static
void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
// ----------- S t a t e -------------
- // -- r3 : number of arguments
- // -- r4 : function
- // -- cp : context
- // -- lr : return address
- // -- sp[(argc - n) * 8] : arg[n] (zero-based)
- // -- sp[(argc + 1) * 8] : receiver
+ // -- r3 : number of arguments
+ // -- r4 : function
+ // -- cp : context
+ // -- lr : return address
+ // -- sp[(argc - n - 1) * 4] : arg[n] (zero based)
+ // -- sp[argc * 4] : receiver
// -----------------------------------
Condition const cond_done = (kind == MathMaxMinKind::kMin) ? lt : gt;
Heap::RootListIndex const root_index =
@@ -150,15 +150,16 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
__ addi(r7, r3, Operand(1));
Label done_loop, loop;
+ __ mr(r7, r3);
__ bind(&loop);
{
// Check if all parameters done.
- __ subi(r3, r3, Operand(1));
- __ cmpi(r3, Operand::Zero());
+ __ subi(r7, r7, Operand(1));
+ __ cmpi(r7, Operand::Zero());
__ blt(&done_loop);
// Load the next parameter tagged value into r5.
- __ ShiftLeftImm(r5, r3, Operand(kPointerSizeLog2));
+ __ ShiftLeftImm(r5, r7, Operand(kPointerSizeLog2));
__ LoadPX(r5, MemOperand(sp, r5));
// Load the double value of the parameter into d2, maybe converting the
@@ -232,8 +233,10 @@ void Builtins::Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind) {
}
__ bind(&done_loop);
+ // Drop all slots, including the receiver.
+ __ addi(r3, r3, Operand(1));
+ __ Drop(r3);
__ mr(r3, r8);
- __ Drop(r7);
__ Ret();
}
« no previous file with comments | « no previous file | src/s390/builtins-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698