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

Unified Diff: src/a64/code-stubs-a64.cc

Issue 149153003: Implement a code stub for floating point modulo operation (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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/code-stubs-a64.cc
diff --git a/src/a64/code-stubs-a64.cc b/src/a64/code-stubs-a64.cc
index 959958e4c520344acd4ed7ed081be12e2bb3078f..6e7593aad3fb4c041303cc60717167ba471a8e5d 100644
--- a/src/a64/code-stubs-a64.cc
+++ b/src/a64/code-stubs-a64.cc
@@ -1327,7 +1327,7 @@ void BinaryOpStub_GenerateFPOperation(MacroAssembler* masm,
FPRegister result_d = d0;
Register right = x0;
Register left = x1;
- Register heap_result = x3;
+ Register heap_result = x19;
ASSERT(smi_operands || (not_numbers != NULL));
if (smi_operands) {
@@ -1350,8 +1350,8 @@ void BinaryOpStub_GenerateFPOperation(MacroAssembler* masm,
case Token::MUL:
case Token::DIV:
case Token::MOD: {
- FPRegister right_d = d0;
- FPRegister left_d = d1;
+ FPRegister left_d = d0;
+ FPRegister right_d = d1;
Label do_operation;
__ SmiUntagToDouble(left_d, left, kSpeculativeUntag);
@@ -1383,21 +1383,28 @@ void BinaryOpStub_GenerateFPOperation(MacroAssembler* masm,
// Left and right are doubles in left_d and right_d. Calculate the result.
__ Bind(&do_operation);
+
+ BinaryOpStub_GenerateHeapResultAllocation(
+ masm, heap_result, heap_number_map, x10, x11, gc_required, mode);
+
switch (op) {
case Token::ADD: __ Fadd(result_d, left_d, right_d); break;
case Token::SUB: __ Fsub(result_d, left_d, right_d); break;
case Token::MUL: __ Fmul(result_d, left_d, right_d); break;
case Token::DIV: __ Fdiv(result_d, left_d, right_d); break;
- case Token::MOD:
- ASM_UNIMPLEMENTED("Implement HeapNumber modulo");
- __ B(miss);
+ case Token::MOD: {
+ Register saved_lr = x20;
+ __ Mov(saved_lr, lr);
+ AllowExternalCallThatCantCauseGC scope(masm);
+ __ CallCFunction(
+ ExternalReference::double_fp_operation(op, masm->isolate()),
+ 0, 2);
+ __ Mov(lr, saved_lr);
break;
+ }
default: UNREACHABLE();
}
- BinaryOpStub_GenerateHeapResultAllocation(
- masm, heap_result, heap_number_map, x10, x11, gc_required, mode);
-
__ Str(result_d, FieldMemOperand(heap_result, HeapNumber::kValueOffset));
__ Mov(result, heap_result);
__ Ret();
« 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