From: sgjesse@chromium.org Date: Thu, 3 Feb 2011 08:59:14 +0000 (+0000) Subject: Implements Modulo operation on ARM for DoArithmeticD. X-Git-Tag: upstream/4.7.83~20358 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d86e430630a163214893e0a1b6f3673b600f9c20;p=platform%2Fupstream%2Fv8.git Implements Modulo operation on ARM for DoArithmeticD. BUG=none TEST=none Patch by Rodolph Perfetta from ARM Ltd. Review URL: http://codereview.chromium.org/6248004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6599 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index a1adae3..408f822 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -1398,7 +1398,18 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) { __ vdiv(left, left, right); break; case Token::MOD: { - Abort("DoArithmeticD unimplemented for MOD."); + // Save r0-r3 on the stack. + __ stm(db_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit()); + + __ PrepareCallCFunction(4, scratch0()); + __ vmov(r0, r1, left); + __ vmov(r2, r3, right); + __ CallCFunction(ExternalReference::double_fp_operation(Token::MOD), 4); + // Move the result in the double result register. + __ vmov(ToDoubleRegister(instr->result()), r0, r1); + + // Restore r0-r3. + __ ldm(ia_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit()); break; } default: