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

Unified Diff: src/arm/macro-assembler-arm.cc

Issue 4247004: Change the utils WhichPowerOf2 function to use a simpler algorithm. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.cc
===================================================================
--- src/arm/macro-assembler-arm.cc (revision 5768)
+++ src/arm/macro-assembler-arm.cc (working copy)
@@ -220,20 +220,20 @@
void MacroAssembler::And(Register dst, Register src1, const Operand& src2,
Condition cond) {
- if (!CpuFeatures::IsSupported(ARMv7) || src2.is_single_instruction()) {
+ if (!src2.is_reg() &&
+ !src2.must_use_constant_pool() &&
+ src2.immediate() == 0) {
+ mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, cond);
+
+ } else if (!src2.is_single_instruction() &&
+ !src2.must_use_constant_pool() &&
+ CpuFeatures::IsSupported(ARMv7) &&
+ IsPowerOf2(src2.immediate() + 1)) {
+ ubfx(dst, src1, 0, WhichPowerOf2(src2.immediate() + 1), cond);
+
+ } else {
and_(dst, src1, src2, LeaveCC, cond);
- return;
}
- int32_t immediate = src2.immediate();
- if (immediate == 0) {
- mov(dst, Operand(0, RelocInfo::NONE), LeaveCC, cond);
- return;
- }
- if (IsPowerOf2(immediate + 1) && ((immediate & 1) != 0)) {
- ubfx(dst, src1, 0, WhichPowerOf2(immediate + 1), cond);
- return;
- }
- and_(dst, src1, src2, LeaveCC, cond);
}
« no previous file with comments | « src/arm/assembler-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698