OLD | NEW |
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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2320 void MacroAssembler::Tzcnt(Register dst, const Operand& src) { | 2320 void MacroAssembler::Tzcnt(Register dst, const Operand& src) { |
2321 // TODO(intel): Add support for TZCNT (with ABM/BMI1). | 2321 // TODO(intel): Add support for TZCNT (with ABM/BMI1). |
2322 Label not_zero_src; | 2322 Label not_zero_src; |
2323 bsf(dst, src); | 2323 bsf(dst, src); |
2324 j(not_zero, ¬_zero_src, Label::kNear); | 2324 j(not_zero, ¬_zero_src, Label::kNear); |
2325 Move(dst, Immediate(32)); // The result of tzcnt is 32 if src = 0. | 2325 Move(dst, Immediate(32)); // The result of tzcnt is 32 if src = 0. |
2326 bind(¬_zero_src); | 2326 bind(¬_zero_src); |
2327 } | 2327 } |
2328 | 2328 |
2329 | 2329 |
| 2330 void MacroAssembler::Popcnt(Register dst, const Operand& src) { |
| 2331 // TODO(intel): Add support for POPCNT (with POPCNT) |
| 2332 // if (CpuFeatures::IsSupported(POPCNT)) { |
| 2333 // CpuFeatureScope scope(this, POPCNT); |
| 2334 // popcnt(dst, src); |
| 2335 // return; |
| 2336 // } |
| 2337 UNREACHABLE(); |
| 2338 } |
| 2339 |
| 2340 |
2330 void MacroAssembler::SetCounter(StatsCounter* counter, int value) { | 2341 void MacroAssembler::SetCounter(StatsCounter* counter, int value) { |
2331 if (FLAG_native_code_counters && counter->Enabled()) { | 2342 if (FLAG_native_code_counters && counter->Enabled()) { |
2332 mov(Operand::StaticVariable(ExternalReference(counter)), Immediate(value)); | 2343 mov(Operand::StaticVariable(ExternalReference(counter)), Immediate(value)); |
2333 } | 2344 } |
2334 } | 2345 } |
2335 | 2346 |
2336 | 2347 |
2337 void MacroAssembler::IncrementCounter(StatsCounter* counter, int value) { | 2348 void MacroAssembler::IncrementCounter(StatsCounter* counter, int value) { |
2338 DCHECK(value > 0); | 2349 DCHECK(value > 0); |
2339 if (FLAG_native_code_counters && counter->Enabled()) { | 2350 if (FLAG_native_code_counters && counter->Enabled()) { |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3011 mov(eax, dividend); | 3022 mov(eax, dividend); |
3012 shr(eax, 31); | 3023 shr(eax, 31); |
3013 add(edx, eax); | 3024 add(edx, eax); |
3014 } | 3025 } |
3015 | 3026 |
3016 | 3027 |
3017 } // namespace internal | 3028 } // namespace internal |
3018 } // namespace v8 | 3029 } // namespace v8 |
3019 | 3030 |
3020 #endif // V8_TARGET_ARCH_X87 | 3031 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |