Revision: 6599
Author: [email protected]
Date: Thu Feb  3 00:59:14 2011
Log: 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

http://code.google.com/p/v8/source/detail?r=6599

Modified:
 /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc

=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Wed Feb 2 05:55:29 2011 +++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Thu Feb 3 00:59:14 2011
@@ -1398,7 +1398,18 @@
       __ 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:

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to