| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
| 6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 7 | 7 |
| 8 #if V8_TARGET_ARCH_S390 | 8 #if V8_TARGET_ARCH_S390 |
| 9 | 9 |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 5342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5353 | 5353 |
| 5354 void MacroAssembler::Popcnt32(Register dst, Register src) { | 5354 void MacroAssembler::Popcnt32(Register dst, Register src) { |
| 5355 DCHECK(!src.is(r0)); | 5355 DCHECK(!src.is(r0)); |
| 5356 DCHECK(!dst.is(r0)); | 5356 DCHECK(!dst.is(r0)); |
| 5357 | 5357 |
| 5358 popcnt(dst, src); | 5358 popcnt(dst, src); |
| 5359 ShiftRight(r0, dst, Operand(16)); | 5359 ShiftRight(r0, dst, Operand(16)); |
| 5360 ar(dst, r0); | 5360 ar(dst, r0); |
| 5361 ShiftRight(r0, dst, Operand(8)); | 5361 ShiftRight(r0, dst, Operand(8)); |
| 5362 ar(dst, r0); | 5362 ar(dst, r0); |
| 5363 LoadlB(dst, dst); | 5363 llgcr(dst, dst); |
| 5364 } | 5364 } |
| 5365 | 5365 |
| 5366 #ifdef V8_TARGET_ARCH_S390X | 5366 #ifdef V8_TARGET_ARCH_S390X |
| 5367 void MacroAssembler::Popcnt64(Register dst, Register src) { | 5367 void MacroAssembler::Popcnt64(Register dst, Register src) { |
| 5368 DCHECK(!src.is(r0)); | 5368 DCHECK(!src.is(r0)); |
| 5369 DCHECK(!dst.is(r0)); | 5369 DCHECK(!dst.is(r0)); |
| 5370 | 5370 |
| 5371 popcnt(dst, src); | 5371 popcnt(dst, src); |
| 5372 ShiftRightP(r0, dst, Operand(32)); | 5372 ShiftRightP(r0, dst, Operand(32)); |
| 5373 AddP(dst, r0); | 5373 AddP(dst, r0); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5460 } | 5460 } |
| 5461 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); | 5461 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); |
| 5462 ExtractBit(r0, dividend, 31); | 5462 ExtractBit(r0, dividend, 31); |
| 5463 AddP(result, r0); | 5463 AddP(result, r0); |
| 5464 } | 5464 } |
| 5465 | 5465 |
| 5466 } // namespace internal | 5466 } // namespace internal |
| 5467 } // namespace v8 | 5467 } // namespace v8 |
| 5468 | 5468 |
| 5469 #endif // V8_TARGET_ARCH_S390 | 5469 #endif // V8_TARGET_ARCH_S390 |
| OLD | NEW |