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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 2876011: Do integer mod via sum-of-digits technique. This benefits the date (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 scratch2, 1679 scratch2,
1680 gc_required, 1680 gc_required,
1681 TAG_OBJECT); 1681 TAG_OBJECT);
1682 1682
1683 // Store heap number map in the allocated object. 1683 // Store heap number map in the allocated object.
1684 AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); 1684 AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
1685 str(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset)); 1685 str(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset));
1686 } 1686 }
1687 1687
1688 1688
1689 void MacroAssembler::CountLeadingZeros(Register source, 1689 void MacroAssembler::CountLeadingZeros(Register zeros, // Answer.
1690 Register scratch, 1690 Register source, // Input.
1691 Register zeros) { 1691 Register scratch) {
1692 ASSERT(!zeros.is(source) || !source.is(zeros));
1693 ASSERT(!zeros.is(scratch));
1694 ASSERT(!scratch.is(ip));
1695 ASSERT(!source.is(ip));
1696 ASSERT(!zeros.is(ip));
1692 #ifdef CAN_USE_ARMV5_INSTRUCTIONS 1697 #ifdef CAN_USE_ARMV5_INSTRUCTIONS
1693 clz(zeros, source); // This instruction is only supported after ARM5. 1698 clz(zeros, source); // This instruction is only supported after ARM5.
1694 #else 1699 #else
1695 mov(zeros, Operand(0)); 1700 mov(zeros, Operand(0));
1696 mov(scratch, source); 1701 Move(scratch, source);
1697 // Top 16. 1702 // Top 16.
1698 tst(scratch, Operand(0xffff0000)); 1703 tst(scratch, Operand(0xffff0000));
1699 add(zeros, zeros, Operand(16), LeaveCC, eq); 1704 add(zeros, zeros, Operand(16), LeaveCC, eq);
1700 mov(scratch, Operand(scratch, LSL, 16), LeaveCC, eq); 1705 mov(scratch, Operand(scratch, LSL, 16), LeaveCC, eq);
1701 // Top 8. 1706 // Top 8.
1702 tst(scratch, Operand(0xff000000)); 1707 tst(scratch, Operand(0xff000000));
1703 add(zeros, zeros, Operand(8), LeaveCC, eq); 1708 add(zeros, zeros, Operand(8), LeaveCC, eq);
1704 mov(scratch, Operand(scratch, LSL, 8), LeaveCC, eq); 1709 mov(scratch, Operand(scratch, LSL, 8), LeaveCC, eq);
1705 // Top 4. 1710 // Top 4.
1706 tst(scratch, Operand(0xf0000000)); 1711 tst(scratch, Operand(0xf0000000));
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1836 1841
1837 void CodePatcher::Emit(Address addr) { 1842 void CodePatcher::Emit(Address addr) {
1838 masm()->emit(reinterpret_cast<Instr>(addr)); 1843 masm()->emit(reinterpret_cast<Instr>(addr));
1839 } 1844 }
1840 #endif // ENABLE_DEBUGGER_SUPPORT 1845 #endif // ENABLE_DEBUGGER_SUPPORT
1841 1846
1842 1847
1843 } } // namespace v8::internal 1848 } } // namespace v8::internal
1844 1849
1845 #endif // V8_TARGET_ARCH_ARM 1850 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698