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

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

Issue 1069683002: [ia32] Introduce BMI instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Align with gdb disassembler Created 5 years, 8 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
« no previous file with comments | « src/ia32/disasm-ia32.cc ('k') | test/cctest/test-assembler-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/division-by-constant.h" 10 #include "src/base/division-by-constant.h"
(...skipping 2432 matching lines...) Expand 10 before | Expand all | Expand 10 after
2443 } else { 2443 } else {
2444 DCHECK_EQ(0, imm8); 2444 DCHECK_EQ(0, imm8);
2445 psrlq(dst, 32); 2445 psrlq(dst, 32);
2446 punpckldq(xmm0, dst); 2446 punpckldq(xmm0, dst);
2447 movaps(dst, xmm0); 2447 movaps(dst, xmm0);
2448 } 2448 }
2449 } 2449 }
2450 2450
2451 2451
2452 void MacroAssembler::Lzcnt(Register dst, const Operand& src) { 2452 void MacroAssembler::Lzcnt(Register dst, const Operand& src) {
2453 // TODO(intel): Add support for LZCNT (with ABM/BMI1). 2453 if (CpuFeatures::IsSupported(LZCNT)) {
2454 CpuFeatureScope scope(this, LZCNT);
2455 lzcnt(dst, src);
2456 return;
2457 }
2454 Label not_zero_src; 2458 Label not_zero_src;
2455 bsr(dst, src); 2459 bsr(dst, src);
2456 j(not_zero, &not_zero_src, Label::kNear); 2460 j(not_zero, &not_zero_src, Label::kNear);
2457 Move(dst, Immediate(63)); // 63^31 == 32 2461 Move(dst, Immediate(63)); // 63^31 == 32
2458 bind(&not_zero_src); 2462 bind(&not_zero_src);
2459 xor_(dst, Immediate(31)); // for x in [0..31], 31^x == 31-x. 2463 xor_(dst, Immediate(31)); // for x in [0..31], 31^x == 31-x.
2460 } 2464 }
2461 2465
2462 2466
2463 void MacroAssembler::SetCounter(StatsCounter* counter, int value) { 2467 void MacroAssembler::SetCounter(StatsCounter* counter, int value) {
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
3219 if (mag.shift > 0) sar(edx, mag.shift); 3223 if (mag.shift > 0) sar(edx, mag.shift);
3220 mov(eax, dividend); 3224 mov(eax, dividend);
3221 shr(eax, 31); 3225 shr(eax, 31);
3222 add(edx, eax); 3226 add(edx, eax);
3223 } 3227 }
3224 3228
3225 3229
3226 } } // namespace v8::internal 3230 } } // namespace v8::internal
3227 3231
3228 #endif // V8_TARGET_ARCH_IA32 3232 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/disasm-ia32.cc ('k') | test/cctest/test-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698