Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Side by Side Diff: src/mips64/assembler-mips64.cc

Issue 1545013002: Add assembler test. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips64/assembler-mips64.h ('k') | src/mips64/constants-mips64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 DCHECK(rd.is_valid() && rt.is_valid() && is_uint5(sa)); 1750 DCHECK(rd.is_valid() && rt.is_valid() && is_uint5(sa));
1751 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6); 1751 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
1752 Instr instr = SPECIAL | (1 << kRsShift) | (rt.code() << kRtShift) 1752 Instr instr = SPECIAL | (1 << kRsShift) | (rt.code() << kRtShift)
1753 | (rd.code() << kRdShift) | (sa << kSaShift) | SRL; 1753 | (rd.code() << kRdShift) | (sa << kSaShift) | SRL;
1754 emit(instr); 1754 emit(instr);
1755 } 1755 }
1756 1756
1757 1757
1758 void Assembler::rotrv(Register rd, Register rt, Register rs) { 1758 void Assembler::rotrv(Register rd, Register rt, Register rs) {
1759 // Should be called via MacroAssembler::Ror. 1759 // Should be called via MacroAssembler::Ror.
1760 DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid() ); 1760 DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid());
1761 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6); 1761 DCHECK(kArchVariant == kMips64r2 || kArchVariant == kMips64r6);
1762 Instr instr = SPECIAL | (rs.code() << kRsShift) | (rt.code() << kRtShift) 1762 Instr instr = SPECIAL | (rs.code() << kRsShift) | (rt.code() << kRtShift)
1763 | (rd.code() << kRdShift) | (1 << kSaShift) | SRLV; 1763 | (rd.code() << kRdShift) | (1 << kSaShift) | SRLV;
1764 emit(instr); 1764 emit(instr);
1765 } 1765 }
1766 1766
1767 1767
1768 void Assembler::dsll(Register rd, Register rt, uint16_t sa) { 1768 void Assembler::dsll(Register rd, Register rt, uint16_t sa) {
1769 GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSLL); 1769 GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSLL);
1770 } 1770 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 void Assembler::dsrl32(Register rd, Register rt, uint16_t sa) { 1819 void Assembler::dsrl32(Register rd, Register rt, uint16_t sa) {
1820 GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSRL32); 1820 GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSRL32);
1821 } 1821 }
1822 1822
1823 1823
1824 void Assembler::dsra32(Register rd, Register rt, uint16_t sa) { 1824 void Assembler::dsra32(Register rd, Register rt, uint16_t sa) {
1825 GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSRA32); 1825 GenInstrRegister(SPECIAL, zero_reg, rt, rd, sa & 0x1F, DSRA32);
1826 } 1826 }
1827 1827
1828 1828
1829 void Assembler::lsa(Register rd, Register rt, Register rs, uint8_t sa) {
1830 DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid());
1831 DCHECK(sa < 5 && sa > 0);
1832 DCHECK(kArchVariant == kMips64r6);
1833 Instr instr = SPECIAL | (rs.code() << kRsShift) | (rt.code() << kRtShift) |
1834 (rd.code() << kRdShift) | (sa - 1) << kSaShift | LSA;
1835 emit(instr);
1836 }
1837
1838
1839 void Assembler::dlsa(Register rd, Register rt, Register rs, uint8_t sa) {
1840 DCHECK(rd.is_valid() && rt.is_valid() && rs.is_valid());
1841 DCHECK(sa < 5 && sa > 0);
1842 DCHECK(kArchVariant == kMips64r6);
1843 Instr instr = SPECIAL | (rs.code() << kRsShift) | (rt.code() << kRtShift) |
1844 (rd.code() << kRdShift) | (sa - 1) << kSaShift | DLSA;
1845 emit(instr);
1846 }
1847
1848
1829 // ------------Memory-instructions------------- 1849 // ------------Memory-instructions-------------
1830 1850
1831 // Helper for base-reg + offset, when offset is larger than int16. 1851 // Helper for base-reg + offset, when offset is larger than int16.
1832 void Assembler::LoadRegPlusOffsetToAt(const MemOperand& src) { 1852 void Assembler::LoadRegPlusOffsetToAt(const MemOperand& src) {
1833 DCHECK(!src.rm().is(at)); 1853 DCHECK(!src.rm().is(at));
1834 DCHECK(is_int32(src.offset_)); 1854 DCHECK(is_int32(src.offset_));
1835 daddiu(at, zero_reg, (src.offset_ >> kLuiShift) & kImm16Mask); 1855 daddiu(at, zero_reg, (src.offset_ >> kLuiShift) & kImm16Mask);
1836 dsll(at, at, kLuiShift); 1856 dsll(at, at, kLuiShift);
1837 ori(at, at, src.offset_ & kImm16Mask); // Load 32-bit offset. 1857 ori(at, at, src.offset_ & kImm16Mask); // Load 32-bit offset.
1838 daddu(at, at, src.rm()); // Add base register. 1858 daddu(at, at, src.rm()); // Add base register.
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
3283 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 3303 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
3284 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); 3304 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize);
3285 } 3305 }
3286 } 3306 }
3287 3307
3288 3308
3289 } // namespace internal 3309 } // namespace internal
3290 } // namespace v8 3310 } // namespace v8
3291 3311
3292 #endif // V8_TARGET_ARCH_MIPS64 3312 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/assembler-mips64.h ('k') | src/mips64/constants-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698