| 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 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 5 #ifndef V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
| 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 6 #define V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/mips64/assembler-mips64.h" | 10 #include "src/mips64/assembler-mips64.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 void Move(FPURegister dst, float imm); | 331 void Move(FPURegister dst, float imm); |
| 332 void Move(FPURegister dst, double imm); | 332 void Move(FPURegister dst, double imm); |
| 333 | 333 |
| 334 // Conditional move. | 334 // Conditional move. |
| 335 void Movz(Register rd, Register rs, Register rt); | 335 void Movz(Register rd, Register rs, Register rt); |
| 336 void Movn(Register rd, Register rs, Register rt); | 336 void Movn(Register rd, Register rs, Register rt); |
| 337 void Movt(Register rd, Register rs, uint16_t cc = 0); | 337 void Movt(Register rd, Register rs, uint16_t cc = 0); |
| 338 void Movf(Register rd, Register rs, uint16_t cc = 0); | 338 void Movf(Register rd, Register rs, uint16_t cc = 0); |
| 339 | 339 |
| 340 // Min, Max macros. | |
| 341 // On pre-r6 these functions may modify at and t8 registers. | |
| 342 void MinNaNCheck_d(FPURegister dst, FPURegister src1, FPURegister src2, | |
| 343 Label* nan = nullptr); | |
| 344 void MaxNaNCheck_d(FPURegister dst, FPURegister src1, FPURegister src2, | |
| 345 Label* nan = nullptr); | |
| 346 void MinNaNCheck_s(FPURegister dst, FPURegister src1, FPURegister src2, | |
| 347 Label* nan = nullptr); | |
| 348 void MaxNaNCheck_s(FPURegister dst, FPURegister src1, FPURegister src2, | |
| 349 Label* nan = nullptr); | |
| 350 | |
| 351 void Clz(Register rd, Register rs); | 340 void Clz(Register rd, Register rs); |
| 352 | 341 |
| 353 // Jump unconditionally to given label. | 342 // Jump unconditionally to given label. |
| 354 // We NEED a nop in the branch delay slot, as it used by v8, for example in | 343 // We NEED a nop in the branch delay slot, as it used by v8, for example in |
| 355 // CodeGenerator::ProcessDeferred(). | 344 // CodeGenerator::ProcessDeferred(). |
| 356 // Currently the branch delay slot is filled by the MacroAssembler. | 345 // Currently the branch delay slot is filled by the MacroAssembler. |
| 357 // Use rather b(Label) for code generation. | 346 // Use rather b(Label) for code generation. |
| 358 void jmp(Label* L) { | 347 void jmp(Label* L) { |
| 359 Branch(L); | 348 Branch(L); |
| 360 } | 349 } |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 } | 1393 } |
| 1405 | 1394 |
| 1406 void RetOnOverflow(Register overflow_check, BranchDelaySlot bd = PROTECT) { | 1395 void RetOnOverflow(Register overflow_check, BranchDelaySlot bd = PROTECT) { |
| 1407 Ret(lt, overflow_check, Operand(zero_reg), bd); | 1396 Ret(lt, overflow_check, Operand(zero_reg), bd); |
| 1408 } | 1397 } |
| 1409 | 1398 |
| 1410 void RetOnNoOverflow(Register overflow_check, BranchDelaySlot bd = PROTECT) { | 1399 void RetOnNoOverflow(Register overflow_check, BranchDelaySlot bd = PROTECT) { |
| 1411 Ret(ge, overflow_check, Operand(zero_reg), bd); | 1400 Ret(ge, overflow_check, Operand(zero_reg), bd); |
| 1412 } | 1401 } |
| 1413 | 1402 |
| 1403 // Perform a floating-point min or max operation with the |
| 1404 // (IEEE-754-compatible) semantics of MIPS32's Release 6 MIN.fmt/MAX.fmt. |
| 1405 // Some cases, typically NaNs or +/-0.0, are expected to be rare and are |
| 1406 // handled in out-of-line code. The specific behaviour depends on supported |
| 1407 // instructions. |
| 1408 // |
| 1409 // These functions assume (and assert) that !src1.is(src2). It is permitted |
| 1410 // for the result to alias either input register. |
| 1411 void Float32Max(FPURegister dst, FPURegister src1, FPURegister src2, |
| 1412 Label* out_of_line); |
| 1413 void Float32Min(FPURegister dst, FPURegister src1, FPURegister src2, |
| 1414 Label* out_of_line); |
| 1415 void Float64Max(FPURegister dst, FPURegister src1, FPURegister src2, |
| 1416 Label* out_of_line); |
| 1417 void Float64Min(FPURegister dst, FPURegister src1, FPURegister src2, |
| 1418 Label* out_of_line); |
| 1419 |
| 1420 // Generate out-of-line cases for the macros above. |
| 1421 void Float32MaxOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2); |
| 1422 void Float32MinOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2); |
| 1423 void Float64MaxOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2); |
| 1424 void Float64MinOutOfLine(FPURegister dst, FPURegister src1, FPURegister src2); |
| 1425 |
| 1414 // ------------------------------------------------------------------------- | 1426 // ------------------------------------------------------------------------- |
| 1415 // Runtime calls. | 1427 // Runtime calls. |
| 1416 | 1428 |
| 1417 // See comments at the beginning of CEntryStub::Generate. | 1429 // See comments at the beginning of CEntryStub::Generate. |
| 1418 inline void PrepareCEntryArgs(int num_args) { li(a0, num_args); } | 1430 inline void PrepareCEntryArgs(int num_args) { li(a0, num_args); } |
| 1419 | 1431 |
| 1420 inline void PrepareCEntryFunction(const ExternalReference& ref) { | 1432 inline void PrepareCEntryFunction(const ExternalReference& ref) { |
| 1421 li(a1, Operand(ref)); | 1433 li(a1, Operand(ref)); |
| 1422 } | 1434 } |
| 1423 | 1435 |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1988 dd(GetLabelFunction(index)); | 2000 dd(GetLabelFunction(index)); |
| 1989 } | 2001 } |
| 1990 } | 2002 } |
| 1991 | 2003 |
| 1992 #define ACCESS_MASM(masm) masm-> | 2004 #define ACCESS_MASM(masm) masm-> |
| 1993 | 2005 |
| 1994 } // namespace internal | 2006 } // namespace internal |
| 1995 } // namespace v8 | 2007 } // namespace v8 |
| 1996 | 2008 |
| 1997 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ | 2009 #endif // V8_MIPS_MACRO_ASSEMBLER_MIPS_H_ |
| OLD | NEW |