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 3313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3324 | 3324 |
3325 #define Generate_Mul32WithOverflowIfCCUnequal(instr) \ | 3325 #define Generate_Mul32WithOverflowIfCCUnequal(instr) \ |
3326 { \ | 3326 { \ |
3327 lgfr(dst, src1); \ | 3327 lgfr(dst, src1); \ |
3328 instr(dst, src2); \ | 3328 instr(dst, src2); \ |
3329 cgfr(dst, dst); \ | 3329 cgfr(dst, dst); \ |
3330 } | 3330 } |
3331 | 3331 |
3332 void MacroAssembler::Mul32WithOverflowIfCCUnequal(Register dst, Register src1, | 3332 void MacroAssembler::Mul32WithOverflowIfCCUnequal(Register dst, Register src1, |
3333 const MemOperand& src2) { | 3333 const MemOperand& src2) { |
| 3334 Register result = dst; |
| 3335 if (src2.rx().is(dst) || src2.rb().is(dst)) dst = r0; |
3334 Generate_Mul32WithOverflowIfCCUnequal(msgf); | 3336 Generate_Mul32WithOverflowIfCCUnequal(msgf); |
| 3337 if (!result.is(dst)) llgfr(result, dst); |
3335 } | 3338 } |
3336 | 3339 |
3337 void MacroAssembler::Mul32WithOverflowIfCCUnequal(Register dst, Register src1, | 3340 void MacroAssembler::Mul32WithOverflowIfCCUnequal(Register dst, Register src1, |
3338 Register src2) { | 3341 Register src2) { |
3339 if (dst.is(src2)) { | 3342 if (dst.is(src2)) { |
3340 std::swap(src1, src2); | 3343 std::swap(src1, src2); |
3341 } | 3344 } |
3342 Generate_Mul32WithOverflowIfCCUnequal(msgfr); | 3345 Generate_Mul32WithOverflowIfCCUnequal(msgfr); |
3343 } | 3346 } |
3344 | 3347 |
(...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5352 } | 5355 } |
5353 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); | 5356 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); |
5354 ExtractBit(r0, dividend, 31); | 5357 ExtractBit(r0, dividend, 31); |
5355 AddP(result, r0); | 5358 AddP(result, r0); |
5356 } | 5359 } |
5357 | 5360 |
5358 } // namespace internal | 5361 } // namespace internal |
5359 } // namespace v8 | 5362 } // namespace v8 |
5360 | 5363 |
5361 #endif // V8_TARGET_ARCH_S390 | 5364 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |