Revision: 10355
Author:   [email protected]
Date:     Mon Jan  9 05:33:59 2012
Log:      Use shift and add instead of mul on ARM for integer hash.
Review URL: http://codereview.chromium.org/9153002
http://code.google.com/p/v8/source/detail?r=10355

Modified:
 /branches/bleeding_edge/src/arm/macro-assembler-arm.cc

=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Fri Jan 6 03:33:20 2012 +++ /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Mon Jan 9 05:33:59 2012
@@ -1456,8 +1456,9 @@
   // hash = hash ^ (hash >> 4);
   eor(t0, t0, Operand(t0, LSR, 4));
   // hash = hash * 2057;
-  mov(t1, Operand(2057));
-  mul(t0, t0, t1);
+  mov(t1, Operand(t0, LSL, 11));
+  add(t0, t0, Operand(t0, LSL, 3));
+  add(t0, t0, t1);
   // hash = hash ^ (hash >> 16);
   eor(t0, t0, Operand(t0, LSR, 16));

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

Reply via email to