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

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

Issue 9309077: MIPS: Don't allow large immediates for certain instructions. (Closed)
Patch Set: rebased on r10618. Created 8 years, 10 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 | « no previous file | src/mips/macro-assembler-mips.cc » ('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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 1238
1239 1239
1240 // Logical. 1240 // Logical.
1241 1241
1242 void Assembler::and_(Register rd, Register rs, Register rt) { 1242 void Assembler::and_(Register rd, Register rs, Register rt) {
1243 GenInstrRegister(SPECIAL, rs, rt, rd, 0, AND); 1243 GenInstrRegister(SPECIAL, rs, rt, rd, 0, AND);
1244 } 1244 }
1245 1245
1246 1246
1247 void Assembler::andi(Register rt, Register rs, int32_t j) { 1247 void Assembler::andi(Register rt, Register rs, int32_t j) {
1248 ASSERT(is_uint16(j));
1248 GenInstrImmediate(ANDI, rs, rt, j); 1249 GenInstrImmediate(ANDI, rs, rt, j);
1249 } 1250 }
1250 1251
1251 1252
1252 void Assembler::or_(Register rd, Register rs, Register rt) { 1253 void Assembler::or_(Register rd, Register rs, Register rt) {
1253 GenInstrRegister(SPECIAL, rs, rt, rd, 0, OR); 1254 GenInstrRegister(SPECIAL, rs, rt, rd, 0, OR);
1254 } 1255 }
1255 1256
1256 1257
1257 void Assembler::ori(Register rt, Register rs, int32_t j) { 1258 void Assembler::ori(Register rt, Register rs, int32_t j) {
1259 ASSERT(is_uint16(j));
1258 GenInstrImmediate(ORI, rs, rt, j); 1260 GenInstrImmediate(ORI, rs, rt, j);
1259 } 1261 }
1260 1262
1261 1263
1262 void Assembler::xor_(Register rd, Register rs, Register rt) { 1264 void Assembler::xor_(Register rd, Register rs, Register rt) {
1263 GenInstrRegister(SPECIAL, rs, rt, rd, 0, XOR); 1265 GenInstrRegister(SPECIAL, rs, rt, rd, 0, XOR);
1264 } 1266 }
1265 1267
1266 1268
1267 void Assembler::xori(Register rt, Register rs, int32_t j) { 1269 void Assembler::xori(Register rt, Register rs, int32_t j) {
1270 ASSERT(is_uint16(j));
1268 GenInstrImmediate(XORI, rs, rt, j); 1271 GenInstrImmediate(XORI, rs, rt, j);
1269 } 1272 }
1270 1273
1271 1274
1272 void Assembler::nor(Register rd, Register rs, Register rt) { 1275 void Assembler::nor(Register rd, Register rs, Register rt) {
1273 GenInstrRegister(SPECIAL, rs, rt, rd, 0, NOR); 1276 GenInstrRegister(SPECIAL, rs, rt, rd, 0, NOR);
1274 } 1277 }
1275 1278
1276 1279
1277 // Shifts. 1280 // Shifts.
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 GenInstrImmediate(SWL, rs.rm(), rd, rs.offset_); 1441 GenInstrImmediate(SWL, rs.rm(), rd, rs.offset_);
1439 } 1442 }
1440 1443
1441 1444
1442 void Assembler::swr(Register rd, const MemOperand& rs) { 1445 void Assembler::swr(Register rd, const MemOperand& rs) {
1443 GenInstrImmediate(SWR, rs.rm(), rd, rs.offset_); 1446 GenInstrImmediate(SWR, rs.rm(), rd, rs.offset_);
1444 } 1447 }
1445 1448
1446 1449
1447 void Assembler::lui(Register rd, int32_t j) { 1450 void Assembler::lui(Register rd, int32_t j) {
1451 ASSERT(is_uint16(j));
1448 GenInstrImmediate(LUI, zero_reg, rd, j); 1452 GenInstrImmediate(LUI, zero_reg, rd, j);
1449 } 1453 }
1450 1454
1451 1455
1452 //-------------Misc-instructions-------------- 1456 //-------------Misc-instructions--------------
1453 1457
1454 // Break / Trap instructions. 1458 // Break / Trap instructions.
1455 void Assembler::break_(uint32_t code, bool break_as_stop) { 1459 void Assembler::break_(uint32_t code, bool break_as_stop) {
1456 ASSERT((code & ~0xfffff) == 0); 1460 ASSERT((code & ~0xfffff) == 0);
1457 // We need to invalidate breaks that could be stops as well because the 1461 // We need to invalidate breaks that could be stops as well because the
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
2267 } 2271 }
2268 2272
2269 if (patched) { 2273 if (patched) {
2270 CPU::FlushICache(pc+2, sizeof(Address)); 2274 CPU::FlushICache(pc+2, sizeof(Address));
2271 } 2275 }
2272 } 2276 }
2273 2277
2274 } } // namespace v8::internal 2278 } } // namespace v8::internal
2275 2279
2276 #endif // V8_TARGET_ARCH_MIPS 2280 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698