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 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 const Condition cond) { | 997 const Condition cond) { |
998 // Compare and load FPSCR. | 998 // Compare and load FPSCR. |
999 vcmp(src1, src2, cond); | 999 vcmp(src1, src2, cond); |
1000 vmrs(fpscr_flags, cond); | 1000 vmrs(fpscr_flags, cond); |
1001 } | 1001 } |
1002 | 1002 |
1003 | 1003 |
1004 void MacroAssembler::Vmov(const DwVfpRegister dst, | 1004 void MacroAssembler::Vmov(const DwVfpRegister dst, |
1005 const double imm, | 1005 const double imm, |
1006 const Register scratch) { | 1006 const Register scratch) { |
1007 static const DoubleRepresentation minus_zero(-0.0); | 1007 int64_t imm_bits = bit_cast<int64_t>(imm); |
1008 static const DoubleRepresentation zero(0.0); | |
1009 DoubleRepresentation value_rep(imm); | |
1010 // Handle special values first. | 1008 // Handle special values first. |
1011 if (value_rep == zero) { | 1009 if (imm_bits == bit_cast<int64_t>(0.0)) { |
1012 vmov(dst, kDoubleRegZero); | 1010 vmov(dst, kDoubleRegZero); |
1013 } else if (value_rep == minus_zero) { | 1011 } else if (imm_bits == bit_cast<int64_t>(-0.0)) { |
1014 vneg(dst, kDoubleRegZero); | 1012 vneg(dst, kDoubleRegZero); |
1015 } else { | 1013 } else { |
1016 vmov(dst, imm, scratch); | 1014 vmov(dst, imm, scratch); |
1017 } | 1015 } |
1018 } | 1016 } |
1019 | 1017 |
1020 | 1018 |
1021 void MacroAssembler::VmovHigh(Register dst, DwVfpRegister src) { | 1019 void MacroAssembler::VmovHigh(Register dst, DwVfpRegister src) { |
1022 if (src.code() < 16) { | 1020 if (src.code() < 16) { |
1023 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(src.code()); | 1021 const LowDwVfpRegister loc = LowDwVfpRegister::from_code(src.code()); |
(...skipping 2998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4022 } | 4020 } |
4023 } | 4021 } |
4024 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 4022 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
4025 add(result, result, Operand(dividend, LSR, 31)); | 4023 add(result, result, Operand(dividend, LSR, 31)); |
4026 } | 4024 } |
4027 | 4025 |
4028 } // namespace internal | 4026 } // namespace internal |
4029 } // namespace v8 | 4027 } // namespace v8 |
4030 | 4028 |
4031 #endif // V8_TARGET_ARCH_ARM | 4029 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |