Commit 34741907 authored by vegorov@chromium.org's avatar vegorov@chromium.org

Fix CountLeadingZeros on non-ARMv5 hardware.

R=erik.corry@gmail.com

Review URL: http://codereview.chromium.org/8361030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9736 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent af876ee4
...@@ -3151,8 +3151,10 @@ void MacroAssembler::CountLeadingZeros(Register zeros, // Answer. ...@@ -3151,8 +3151,10 @@ void MacroAssembler::CountLeadingZeros(Register zeros, // Answer.
#ifdef CAN_USE_ARMV5_INSTRUCTIONS #ifdef CAN_USE_ARMV5_INSTRUCTIONS
clz(zeros, source); // This instruction is only supported after ARM5. clz(zeros, source); // This instruction is only supported after ARM5.
#else #else
mov(zeros, Operand(0, RelocInfo::NONE)); // Order of the next two lines is important: zeros register
// can be the same as source register.
Move(scratch, source); Move(scratch, source);
mov(zeros, Operand(0, RelocInfo::NONE));
// Top 16. // Top 16.
tst(scratch, Operand(0xffff0000)); tst(scratch, Operand(0xffff0000));
add(zeros, zeros, Operand(16), LeaveCC, eq); add(zeros, zeros, Operand(16), LeaveCC, eq);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment