OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 | 1929 |
1930 | 1930 |
1931 void Assembler::ext_(Register rt, Register rs, uint16_t pos, uint16_t size) { | 1931 void Assembler::ext_(Register rt, Register rs, uint16_t pos, uint16_t size) { |
1932 // Should be called via MacroAssembler::Ext. | 1932 // Should be called via MacroAssembler::Ext. |
1933 // Ext instr has 'rt' field as dest, and two uint5: msb, lsb. | 1933 // Ext instr has 'rt' field as dest, and two uint5: msb, lsb. |
1934 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); | 1934 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); |
1935 GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos, EXT); | 1935 GenInstrRegister(SPECIAL3, rs, rt, size - 1, pos, EXT); |
1936 } | 1936 } |
1937 | 1937 |
1938 | 1938 |
| 1939 void Assembler::bitswap(Register rd, Register rt) { |
| 1940 DCHECK(kArchVariant == kMips32r6); |
| 1941 GenInstrRegister(SPECIAL3, zero_reg, rt, rd, 0, BITSWAP); |
| 1942 } |
| 1943 |
| 1944 |
1939 void Assembler::pref(int32_t hint, const MemOperand& rs) { | 1945 void Assembler::pref(int32_t hint, const MemOperand& rs) { |
1940 DCHECK(!IsMipsArchVariant(kLoongson)); | 1946 DCHECK(!IsMipsArchVariant(kLoongson)); |
1941 DCHECK(is_uint5(hint) && is_uint16(rs.offset_)); | 1947 DCHECK(is_uint5(hint) && is_uint16(rs.offset_)); |
1942 Instr instr = PREF | (rs.rm().code() << kRsShift) | (hint << kRtShift) | 1948 Instr instr = PREF | (rs.rm().code() << kRsShift) | (hint << kRtShift) |
1943 | (rs.offset_); | 1949 | (rs.offset_); |
1944 emit(instr); | 1950 emit(instr); |
1945 } | 1951 } |
1946 | 1952 |
1947 | 1953 |
1948 // --------Coprocessor-instructions---------------- | 1954 // --------Coprocessor-instructions---------------- |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2415 void Assembler::ceil_l_s(FPURegister fd, FPURegister fs) { | 2421 void Assembler::ceil_l_s(FPURegister fd, FPURegister fs) { |
2416 GenInstrRegister(COP1, S, f0, fs, fd, CEIL_L_S); | 2422 GenInstrRegister(COP1, S, f0, fs, fd, CEIL_L_S); |
2417 } | 2423 } |
2418 | 2424 |
2419 | 2425 |
2420 void Assembler::ceil_l_d(FPURegister fd, FPURegister fs) { | 2426 void Assembler::ceil_l_d(FPURegister fd, FPURegister fs) { |
2421 GenInstrRegister(COP1, D, f0, fs, fd, CEIL_L_D); | 2427 GenInstrRegister(COP1, D, f0, fs, fd, CEIL_L_D); |
2422 } | 2428 } |
2423 | 2429 |
2424 | 2430 |
| 2431 void Assembler::class_s(FPURegister fd, FPURegister fs) { |
| 2432 DCHECK(IsMipsArchVariant(kMips32r6)); |
| 2433 GenInstrRegister(COP1, S, f0, fs, fd, CLASS_S); |
| 2434 } |
| 2435 |
| 2436 |
| 2437 void Assembler::class_d(FPURegister fd, FPURegister fs) { |
| 2438 DCHECK(IsMipsArchVariant(kMips32r6)); |
| 2439 GenInstrRegister(COP1, D, f0, fs, fd, CLASS_D); |
| 2440 } |
| 2441 |
| 2442 |
2425 void Assembler::min(SecondaryField fmt, FPURegister fd, FPURegister fs, | 2443 void Assembler::min(SecondaryField fmt, FPURegister fd, FPURegister fs, |
2426 FPURegister ft) { | 2444 FPURegister ft) { |
2427 DCHECK(IsMipsArchVariant(kMips32r6)); | 2445 DCHECK(IsMipsArchVariant(kMips32r6)); |
2428 DCHECK((fmt == D) || (fmt == S)); | 2446 DCHECK((fmt == D) || (fmt == S)); |
2429 GenInstrRegister(COP1, fmt, ft, fs, fd, MIN); | 2447 GenInstrRegister(COP1, fmt, ft, fs, fd, MIN); |
2430 } | 2448 } |
2431 | 2449 |
2432 | 2450 |
2433 void Assembler::mina(SecondaryField fmt, FPURegister fd, FPURegister fs, | 2451 void Assembler::mina(SecondaryField fmt, FPURegister fd, FPURegister fs, |
2434 FPURegister ft) { | 2452 FPURegister ft) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2493 maxa(D, fd, fs, ft); | 2511 maxa(D, fd, fs, ft); |
2494 } | 2512 } |
2495 | 2513 |
2496 | 2514 |
2497 void Assembler::cvt_s_w(FPURegister fd, FPURegister fs) { | 2515 void Assembler::cvt_s_w(FPURegister fd, FPURegister fs) { |
2498 GenInstrRegister(COP1, W, f0, fs, fd, CVT_S_W); | 2516 GenInstrRegister(COP1, W, f0, fs, fd, CVT_S_W); |
2499 } | 2517 } |
2500 | 2518 |
2501 | 2519 |
2502 void Assembler::cvt_s_l(FPURegister fd, FPURegister fs) { | 2520 void Assembler::cvt_s_l(FPURegister fd, FPURegister fs) { |
2503 DCHECK(IsMipsArchVariant(kMips32r2)); | 2521 DCHECK(IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)); |
2504 GenInstrRegister(COP1, L, f0, fs, fd, CVT_S_L); | 2522 GenInstrRegister(COP1, L, f0, fs, fd, CVT_S_L); |
2505 } | 2523 } |
2506 | 2524 |
2507 | 2525 |
2508 void Assembler::cvt_s_d(FPURegister fd, FPURegister fs) { | 2526 void Assembler::cvt_s_d(FPURegister fd, FPURegister fs) { |
2509 GenInstrRegister(COP1, D, f0, fs, fd, CVT_S_D); | 2527 GenInstrRegister(COP1, D, f0, fs, fd, CVT_S_D); |
2510 } | 2528 } |
2511 | 2529 |
2512 | 2530 |
2513 void Assembler::cvt_d_w(FPURegister fd, FPURegister fs) { | 2531 void Assembler::cvt_d_w(FPURegister fd, FPURegister fs) { |
(...skipping 16 matching lines...) Expand all Loading... |
2530 void Assembler::cmp(FPUCondition cond, SecondaryField fmt, | 2548 void Assembler::cmp(FPUCondition cond, SecondaryField fmt, |
2531 FPURegister fd, FPURegister fs, FPURegister ft) { | 2549 FPURegister fd, FPURegister fs, FPURegister ft) { |
2532 DCHECK(IsMipsArchVariant(kMips32r6)); | 2550 DCHECK(IsMipsArchVariant(kMips32r6)); |
2533 DCHECK((fmt & ~(31 << kRsShift)) == 0); | 2551 DCHECK((fmt & ~(31 << kRsShift)) == 0); |
2534 Instr instr = COP1 | fmt | ft.code() << kFtShift | | 2552 Instr instr = COP1 | fmt | ft.code() << kFtShift | |
2535 fs.code() << kFsShift | fd.code() << kFdShift | (0 << 5) | cond; | 2553 fs.code() << kFsShift | fd.code() << kFdShift | (0 << 5) | cond; |
2536 emit(instr); | 2554 emit(instr); |
2537 } | 2555 } |
2538 | 2556 |
2539 | 2557 |
| 2558 void Assembler::cmp_s(FPUCondition cond, FPURegister fd, FPURegister fs, |
| 2559 FPURegister ft) { |
| 2560 cmp(cond, W, fd, fs, ft); |
| 2561 } |
| 2562 |
| 2563 void Assembler::cmp_d(FPUCondition cond, FPURegister fd, FPURegister fs, |
| 2564 FPURegister ft) { |
| 2565 cmp(cond, L, fd, fs, ft); |
| 2566 } |
| 2567 |
| 2568 |
2540 void Assembler::bc1eqz(int16_t offset, FPURegister ft) { | 2569 void Assembler::bc1eqz(int16_t offset, FPURegister ft) { |
2541 DCHECK(IsMipsArchVariant(kMips32r6)); | 2570 DCHECK(IsMipsArchVariant(kMips32r6)); |
2542 Instr instr = COP1 | BC1EQZ | ft.code() << kFtShift | (offset & kImm16Mask); | 2571 Instr instr = COP1 | BC1EQZ | ft.code() << kFtShift | (offset & kImm16Mask); |
2543 emit(instr); | 2572 emit(instr); |
2544 } | 2573 } |
2545 | 2574 |
2546 | 2575 |
2547 void Assembler::bc1nez(int16_t offset, FPURegister ft) { | 2576 void Assembler::bc1nez(int16_t offset, FPURegister ft) { |
2548 DCHECK(IsMipsArchVariant(kMips32r6)); | 2577 DCHECK(IsMipsArchVariant(kMips32r6)); |
2549 Instr instr = COP1 | BC1NEZ | ft.code() << kFtShift | (offset & kImm16Mask); | 2578 Instr instr = COP1 | BC1NEZ | ft.code() << kFtShift | (offset & kImm16Mask); |
2550 emit(instr); | 2579 emit(instr); |
2551 } | 2580 } |
2552 | 2581 |
2553 | 2582 |
2554 // Conditions for < MIPSr6. | 2583 // Conditions for < MIPSr6. |
2555 void Assembler::c(FPUCondition cond, SecondaryField fmt, | 2584 void Assembler::c(FPUCondition cond, SecondaryField fmt, |
2556 FPURegister fs, FPURegister ft, uint16_t cc) { | 2585 FPURegister fs, FPURegister ft, uint16_t cc) { |
2557 DCHECK(is_uint3(cc)); | 2586 DCHECK(is_uint3(cc)); |
| 2587 DCHECK(fmt == S || fmt == D); |
2558 DCHECK((fmt & ~(31 << kRsShift)) == 0); | 2588 DCHECK((fmt & ~(31 << kRsShift)) == 0); |
2559 Instr instr = COP1 | fmt | ft.code() << 16 | fs.code() << kFsShift | 2589 Instr instr = COP1 | fmt | ft.code() << 16 | fs.code() << kFsShift |
2560 | cc << 8 | 3 << 4 | cond; | 2590 | cc << 8 | 3 << 4 | cond; |
2561 emit(instr); | 2591 emit(instr); |
2562 } | 2592 } |
2563 | 2593 |
2564 | 2594 |
| 2595 void Assembler::c_s(FPUCondition cond, FPURegister fs, FPURegister ft, |
| 2596 uint16_t cc) { |
| 2597 c(cond, S, fs, ft, cc); |
| 2598 } |
| 2599 |
| 2600 |
| 2601 void Assembler::c_d(FPUCondition cond, FPURegister fs, FPURegister ft, |
| 2602 uint16_t cc) { |
| 2603 c(cond, D, fs, ft, cc); |
| 2604 } |
| 2605 |
| 2606 |
2565 void Assembler::fcmp(FPURegister src1, const double src2, | 2607 void Assembler::fcmp(FPURegister src1, const double src2, |
2566 FPUCondition cond) { | 2608 FPUCondition cond) { |
2567 DCHECK(src2 == 0.0); | 2609 DCHECK(src2 == 0.0); |
2568 mtc1(zero_reg, f14); | 2610 mtc1(zero_reg, f14); |
2569 cvt_d_w(f14, f14); | 2611 cvt_d_w(f14, f14); |
2570 c(cond, D, src1, f14, 0); | 2612 c(cond, D, src1, f14, 0); |
2571 } | 2613 } |
2572 | 2614 |
2573 | 2615 |
2574 void Assembler::bc1f(int16_t offset, uint16_t cc) { | 2616 void Assembler::bc1f(int16_t offset, uint16_t cc) { |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2993 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { | 3035 void Assembler::PopulateConstantPool(ConstantPoolArray* constant_pool) { |
2994 // No out-of-line constant pool support. | 3036 // No out-of-line constant pool support. |
2995 DCHECK(!FLAG_enable_ool_constant_pool); | 3037 DCHECK(!FLAG_enable_ool_constant_pool); |
2996 return; | 3038 return; |
2997 } | 3039 } |
2998 | 3040 |
2999 | 3041 |
3000 } } // namespace v8::internal | 3042 } } // namespace v8::internal |
3001 | 3043 |
3002 #endif // V8_TARGET_ARCH_MIPS | 3044 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |