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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 } | 257 } |
258 } | 258 } |
259 | 259 |
260 void MacroAssembler::Move(DwVfpRegister dst, DwVfpRegister src, | 260 void MacroAssembler::Move(DwVfpRegister dst, DwVfpRegister src, |
261 Condition cond) { | 261 Condition cond) { |
262 if (!dst.is(src)) { | 262 if (!dst.is(src)) { |
263 vmov(dst, src, cond); | 263 vmov(dst, src, cond); |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
| 267 void MacroAssembler::Move(QwNeonRegister dst, QwNeonRegister src) { |
| 268 if (dst.is(src)) return; // Moving aliased registers emits nothing. |
| 269 |
| 270 if (CpuFeatures::IsSupported(NEON)) { |
| 271 vmov(dst, src); |
| 272 } else { |
| 273 vmov(dst.low(), src.low()); |
| 274 vmov(dst.high(), src.high()); |
| 275 } |
| 276 } |
| 277 |
| 278 void MacroAssembler::Swap(DwVfpRegister srcdst0, DwVfpRegister srcdst1) { |
| 279 if (srcdst0.is(srcdst1)) return; // Swapping aliased registers emits nothing. |
| 280 |
| 281 DCHECK(VfpRegisterIsAvailable(srcdst0)); |
| 282 DCHECK(VfpRegisterIsAvailable(srcdst1)); |
| 283 |
| 284 if (CpuFeatures::IsSupported(NEON)) { |
| 285 vswp(srcdst0, srcdst1); |
| 286 } else { |
| 287 DCHECK(!srcdst0.is(kScratchDoubleReg)); |
| 288 DCHECK(!srcdst1.is(kScratchDoubleReg)); |
| 289 vmov(kScratchDoubleReg, srcdst0); |
| 290 vmov(srcdst0, srcdst1); |
| 291 vmov(srcdst1, kScratchDoubleReg); |
| 292 } |
| 293 } |
| 294 |
| 295 void MacroAssembler::Swap(QwNeonRegister srcdst0, QwNeonRegister srcdst1) { |
| 296 if (srcdst0.is(srcdst1)) return; // Swapping aliased registers emits nothing. |
| 297 |
| 298 if (CpuFeatures::IsSupported(NEON)) { |
| 299 vswp(srcdst0, srcdst1); |
| 300 } else { |
| 301 Swap(srcdst0.low(), srcdst1.low()); |
| 302 Swap(srcdst0.high(), srcdst1.high()); |
| 303 } |
| 304 } |
| 305 |
267 void MacroAssembler::Mls(Register dst, Register src1, Register src2, | 306 void MacroAssembler::Mls(Register dst, Register src1, Register src2, |
268 Register srcA, Condition cond) { | 307 Register srcA, Condition cond) { |
269 if (CpuFeatures::IsSupported(ARMv7)) { | 308 if (CpuFeatures::IsSupported(ARMv7)) { |
270 CpuFeatureScope scope(this, ARMv7); | 309 CpuFeatureScope scope(this, ARMv7); |
271 mls(dst, src1, src2, srcA, cond); | 310 mls(dst, src1, src2, srcA, cond); |
272 } else { | 311 } else { |
273 DCHECK(!srcA.is(ip)); | 312 DCHECK(!srcA.is(ip)); |
274 mul(ip, src1, src2, LeaveCC, cond); | 313 mul(ip, src1, src2, LeaveCC, cond); |
275 sub(dst, srcA, ip, LeaveCC, cond); | 314 sub(dst, srcA, ip, LeaveCC, cond); |
276 } | 315 } |
(...skipping 3717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3994 } | 4033 } |
3995 } | 4034 } |
3996 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 4035 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
3997 add(result, result, Operand(dividend, LSR, 31)); | 4036 add(result, result, Operand(dividend, LSR, 31)); |
3998 } | 4037 } |
3999 | 4038 |
4000 } // namespace internal | 4039 } // namespace internal |
4001 } // namespace v8 | 4040 } // namespace v8 |
4002 | 4041 |
4003 #endif // V8_TARGET_ARCH_ARM | 4042 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |