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

Side by Side Diff: src/mips64/constants-mips64.h

Issue 1144373003: MIPS: Implemented PC-relative instructions for R6. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
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_CONSTANTS_H_ 5 #ifndef V8_MIPS_CONSTANTS_H_
6 #define V8_MIPS_CONSTANTS_H_ 6 #define V8_MIPS_CONSTANTS_H_
7 7
8 // UNIMPLEMENTED_ macro for MIPS. 8 // UNIMPLEMENTED_ macro for MIPS.
9 #ifdef DEBUG 9 #ifdef DEBUG
10 #define UNIMPLEMENTED_MIPS() \ 10 #define UNIMPLEMENTED_MIPS() \
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 // On MIPS Simulator breakpoints can have different codes: 198 // On MIPS Simulator breakpoints can have different codes:
199 // - Breaks between 0 and kMaxWatchpointCode are treated as simple watchpoints, 199 // - Breaks between 0 and kMaxWatchpointCode are treated as simple watchpoints,
200 // the simulator will run through them and print the registers. 200 // the simulator will run through them and print the registers.
201 // - Breaks between kMaxWatchpointCode and kMaxStopCode are treated as stop() 201 // - Breaks between kMaxWatchpointCode and kMaxStopCode are treated as stop()
202 // instructions (see Assembler::stop()). 202 // instructions (see Assembler::stop()).
203 // - Breaks larger than kMaxStopCode are simple breaks, dropping you into the 203 // - Breaks larger than kMaxStopCode are simple breaks, dropping you into the
204 // debugger. 204 // debugger.
205 const uint32_t kMaxWatchpointCode = 31; 205 const uint32_t kMaxWatchpointCode = 31;
206 const uint32_t kMaxStopCode = 127; 206 const uint32_t kMaxStopCode = 127;
207 const int32_t kMaxInt18 = 131071;
208 const int32_t kMinInt18 = -131072;
209 const int32_t kMaxInt19 = 262143;
210 const int32_t kMinInt19 = -262144;
207 STATIC_ASSERT(kMaxWatchpointCode < kMaxStopCode); 211 STATIC_ASSERT(kMaxWatchpointCode < kMaxStopCode);
208 212
209 213
210 // ----- Fields offset and length. 214 // ----- Fields offset and length.
211 const int kOpcodeShift = 26; 215 const int kOpcodeShift = 26;
212 const int kOpcodeBits = 6; 216 const int kOpcodeBits = 6;
213 const int kRsShift = 21; 217 const int kRsShift = 21;
214 const int kRsBits = 5; 218 const int kRsBits = 5;
215 const int kRtShift = 16; 219 const int kRtShift = 16;
216 const int kRtBits = 5; 220 const int kRtBits = 5;
217 const int kRdShift = 11; 221 const int kRdShift = 11;
218 const int kRdBits = 5; 222 const int kRdBits = 5;
219 const int kSaShift = 6; 223 const int kSaShift = 6;
220 const int kSaBits = 5; 224 const int kSaBits = 5;
221 const int kFunctionShift = 0; 225 const int kFunctionShift = 0;
222 const int kFunctionBits = 6; 226 const int kFunctionBits = 6;
223 const int kLuiShift = 16; 227 const int kLuiShift = 16;
228 const int kBp2Shift = 6;
229 const int kBp2Bits = 2;
230 const int kBp3Shift = 6;
231 const int kBp3Bits = 3;
224 232
225 const int kImm16Shift = 0; 233 const int kImm16Shift = 0;
226 const int kImm16Bits = 16; 234 const int kImm16Bits = 16;
235 const int kImm18Shift = 0;
236 const int kImm18Bits = 18;
237 const int kImm19Shift = 0;
238 const int kImm19Bits = 19;
227 const int kImm21Shift = 0; 239 const int kImm21Shift = 0;
228 const int kImm21Bits = 21; 240 const int kImm21Bits = 21;
229 const int kImm26Shift = 0; 241 const int kImm26Shift = 0;
230 const int kImm26Bits = 26; 242 const int kImm26Bits = 26;
231 const int kImm28Shift = 0; 243 const int kImm28Shift = 0;
232 const int kImm28Bits = 28; 244 const int kImm28Bits = 28;
233 const int kImm32Shift = 0; 245 const int kImm32Shift = 0;
234 const int kImm32Bits = 32; 246 const int kImm32Bits = 32;
235 247
236 // In branches and jumps immediate fields point to words, not bytes, 248 // In branches and jumps immediate fields point to words, not bytes,
(...skipping 12 matching lines...) Expand all
249 const int kFCccBits = 3; 261 const int kFCccBits = 3;
250 const int kFBccShift = 18; 262 const int kFBccShift = 18;
251 const int kFBccBits = 3; 263 const int kFBccBits = 3;
252 const int kFBtrueShift = 16; 264 const int kFBtrueShift = 16;
253 const int kFBtrueBits = 1; 265 const int kFBtrueBits = 1;
254 266
255 // ----- Miscellaneous useful masks. 267 // ----- Miscellaneous useful masks.
256 // Instruction bit masks. 268 // Instruction bit masks.
257 const int kOpcodeMask = ((1 << kOpcodeBits) - 1) << kOpcodeShift; 269 const int kOpcodeMask = ((1 << kOpcodeBits) - 1) << kOpcodeShift;
258 const int kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift; 270 const int kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift;
271 const int kImm18Mask = ((1 << kImm18Bits) - 1) << kImm18Shift;
272 const int kImm19Mask = ((1 << kImm19Bits) - 1) << kImm19Shift;
273 const int kImm21Mask = ((1 << kImm21Bits) - 1) << kImm21Shift;
259 const int kImm26Mask = ((1 << kImm26Bits) - 1) << kImm26Shift; 274 const int kImm26Mask = ((1 << kImm26Bits) - 1) << kImm26Shift;
260 const int kImm28Mask = ((1 << kImm28Bits) - 1) << kImm28Shift; 275 const int kImm28Mask = ((1 << kImm28Bits) - 1) << kImm28Shift;
261 const int kRsFieldMask = ((1 << kRsBits) - 1) << kRsShift; 276 const int kRsFieldMask = ((1 << kRsBits) - 1) << kRsShift;
262 const int kRtFieldMask = ((1 << kRtBits) - 1) << kRtShift; 277 const int kRtFieldMask = ((1 << kRtBits) - 1) << kRtShift;
263 const int kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift; 278 const int kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift;
264 const int kSaFieldMask = ((1 << kSaBits) - 1) << kSaShift; 279 const int kSaFieldMask = ((1 << kSaBits) - 1) << kSaShift;
265 const int kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift; 280 const int kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift;
266 // Misc masks. 281 // Misc masks.
267 const int kHiMask = 0xffff << 16; 282 const int kHiMask = 0xffff << 16;
268 const int kLoMask = 0xffff; 283 const int kLoMask = 0xffff;
269 const int kSignMask = 0x80000000; 284 const int kSignMask = 0x80000000;
270 const int kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1; 285 const int kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1;
271 const int64_t kHi16MaskOf64 = (int64_t)0xffff << 48; 286 const int64_t kHi16MaskOf64 = (int64_t)0xffff << 48;
272 const int64_t kSe16MaskOf64 = (int64_t)0xffff << 32; 287 const int64_t kSe16MaskOf64 = (int64_t)0xffff << 32;
273 const int64_t kTh16MaskOf64 = (int64_t)0xffff << 16; 288 const int64_t kTh16MaskOf64 = (int64_t)0xffff << 16;
274 289
275 // ----- MIPS Opcodes and Function Fields. 290 // ----- MIPS Opcodes and Function Fields.
276 // We use this presentation to stay close to the table representation in 291 // We use this presentation to stay close to the table representation in
277 // MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set. 292 // MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set.
278 enum Opcode { 293 enum Opcode {
279 SPECIAL = 0 << kOpcodeShift, 294 SPECIAL = 0 << kOpcodeShift,
280 REGIMM = 1 << kOpcodeShift, 295 REGIMM = 1 << kOpcodeShift,
281 296
282 J = ((0 << 3) + 2) << kOpcodeShift, 297 J = ((0 << 3) + 2) << kOpcodeShift,
283 JAL = ((0 << 3) + 3) << kOpcodeShift, 298 JAL = ((0 << 3) + 3) << kOpcodeShift,
284 BEQ = ((0 << 3) + 4) << kOpcodeShift, 299 BEQ = ((0 << 3) + 4) << kOpcodeShift,
285 BNE = ((0 << 3) + 5) << kOpcodeShift, 300 BNE = ((0 << 3) + 5) << kOpcodeShift,
286 BLEZ = ((0 << 3) + 6) << kOpcodeShift, 301 BLEZ = ((0 << 3) + 6) << kOpcodeShift,
287 BGTZ = ((0 << 3) + 7) << kOpcodeShift, 302 BGTZ = ((0 << 3) + 7) << kOpcodeShift,
288 303
289 ADDI = ((1 << 3) + 0) << kOpcodeShift, 304 ADDI = ((1 << 3) + 0) << kOpcodeShift,
290 ADDIU = ((1 << 3) + 1) << kOpcodeShift, 305 ADDIU = ((1 << 3) + 1) << kOpcodeShift,
291 SLTI = ((1 << 3) + 2) << kOpcodeShift, 306 SLTI = ((1 << 3) + 2) << kOpcodeShift,
292 SLTIU = ((1 << 3) + 3) << kOpcodeShift, 307 SLTIU = ((1 << 3) + 3) << kOpcodeShift,
293 ANDI = ((1 << 3) + 4) << kOpcodeShift, 308 ANDI = ((1 << 3) + 4) << kOpcodeShift,
294 ORI = ((1 << 3) + 5) << kOpcodeShift, 309 ORI = ((1 << 3) + 5) << kOpcodeShift,
295 XORI = ((1 << 3) + 6) << kOpcodeShift, 310 XORI = ((1 << 3) + 6) << kOpcodeShift,
296 LUI = ((1 << 3) + 7) << kOpcodeShift, // LUI/AUI family. 311 LUI = ((1 << 3) + 7) << kOpcodeShift, // LUI/AUI family.
297 DAUI = ((3 << 3) + 5) << kOpcodeShift, 312 DAUI = ((3 << 3) + 5) << kOpcodeShift,
298 313
299 BEQC = ((2 << 3) + 0) << kOpcodeShift, 314 BEQC = ((2 << 3) + 0) << kOpcodeShift,
300 COP1 = ((2 << 3) + 1) << kOpcodeShift, // Coprocessor 1 class. 315 COP1 = ((2 << 3) + 1) << kOpcodeShift, // Coprocessor 1 class.
301 BEQL = ((2 << 3) + 4) << kOpcodeShift, 316 BEQL = ((2 << 3) + 4) << kOpcodeShift,
302 BNEL = ((2 << 3) + 5) << kOpcodeShift, 317 BNEL = ((2 << 3) + 5) << kOpcodeShift,
303 BLEZL = ((2 << 3) + 6) << kOpcodeShift, 318 BLEZL = ((2 << 3) + 6) << kOpcodeShift,
304 BGTZL = ((2 << 3) + 7) << kOpcodeShift, 319 BGTZL = ((2 << 3) + 7) << kOpcodeShift,
305 320
306 DADDI = ((3 << 3) + 0) << kOpcodeShift, // This is also BNEC. 321 DADDI = ((3 << 3) + 0) << kOpcodeShift, // This is also BNEC.
307 DADDIU = ((3 << 3) + 1) << kOpcodeShift, 322 DADDIU = ((3 << 3) + 1) << kOpcodeShift,
308 LDL = ((3 << 3) + 2) << kOpcodeShift, 323 LDL = ((3 << 3) + 2) << kOpcodeShift,
309 LDR = ((3 << 3) + 3) << kOpcodeShift, 324 LDR = ((3 << 3) + 3) << kOpcodeShift,
310 SPECIAL2 = ((3 << 3) + 4) << kOpcodeShift, 325 SPECIAL2 = ((3 << 3) + 4) << kOpcodeShift,
311 SPECIAL3 = ((3 << 3) + 7) << kOpcodeShift, 326 SPECIAL3 = ((3 << 3) + 7) << kOpcodeShift,
312 327
313 LB = ((4 << 3) + 0) << kOpcodeShift, 328 LB = ((4 << 3) + 0) << kOpcodeShift,
314 LH = ((4 << 3) + 1) << kOpcodeShift, 329 LH = ((4 << 3) + 1) << kOpcodeShift,
315 LWL = ((4 << 3) + 2) << kOpcodeShift, 330 LWL = ((4 << 3) + 2) << kOpcodeShift,
316 LW = ((4 << 3) + 3) << kOpcodeShift, 331 LW = ((4 << 3) + 3) << kOpcodeShift,
317 LBU = ((4 << 3) + 4) << kOpcodeShift, 332 LBU = ((4 << 3) + 4) << kOpcodeShift,
318 LHU = ((4 << 3) + 5) << kOpcodeShift, 333 LHU = ((4 << 3) + 5) << kOpcodeShift,
319 LWR = ((4 << 3) + 6) << kOpcodeShift, 334 LWR = ((4 << 3) + 6) << kOpcodeShift,
320 LWU = ((4 << 3) + 7) << kOpcodeShift, 335 LWU = ((4 << 3) + 7) << kOpcodeShift,
321 336
322 SB = ((5 << 3) + 0) << kOpcodeShift, 337 SB = ((5 << 3) + 0) << kOpcodeShift,
323 SH = ((5 << 3) + 1) << kOpcodeShift, 338 SH = ((5 << 3) + 1) << kOpcodeShift,
324 SWL = ((5 << 3) + 2) << kOpcodeShift, 339 SWL = ((5 << 3) + 2) << kOpcodeShift,
325 SW = ((5 << 3) + 3) << kOpcodeShift, 340 SW = ((5 << 3) + 3) << kOpcodeShift,
326 SDL = ((5 << 3) + 4) << kOpcodeShift, 341 SDL = ((5 << 3) + 4) << kOpcodeShift,
327 SDR = ((5 << 3) + 5) << kOpcodeShift, 342 SDR = ((5 << 3) + 5) << kOpcodeShift,
328 SWR = ((5 << 3) + 6) << kOpcodeShift, 343 SWR = ((5 << 3) + 6) << kOpcodeShift,
329 344
330 LWC1 = ((6 << 3) + 1) << kOpcodeShift, 345 LWC1 = ((6 << 3) + 1) << kOpcodeShift,
331 LLD = ((6 << 3) + 4) << kOpcodeShift, 346 LLD = ((6 << 3) + 4) << kOpcodeShift,
332 LDC1 = ((6 << 3) + 5) << kOpcodeShift, 347 LDC1 = ((6 << 3) + 5) << kOpcodeShift,
333 BEQZC = ((6 << 3) + 6) << kOpcodeShift, 348 POP66 = ((6 << 3) + 6) << kOpcodeShift,
334 LD = ((6 << 3) + 7) << kOpcodeShift, 349 LD = ((6 << 3) + 7) << kOpcodeShift,
335 350
336 PREF = ((6 << 3) + 3) << kOpcodeShift, 351 PREF = ((6 << 3) + 3) << kOpcodeShift,
337 352
338 SWC1 = ((7 << 3) + 1) << kOpcodeShift, 353 SWC1 = ((7 << 3) + 1) << kOpcodeShift,
339 SCD = ((7 << 3) + 4) << kOpcodeShift, 354 PCREL = ((7 << 3) + 3) << kOpcodeShift,
340 SDC1 = ((7 << 3) + 5) << kOpcodeShift, 355 SCD = ((7 << 3) + 4) << kOpcodeShift,
341 BNEZC = ((7 << 3) + 6) << kOpcodeShift, 356 SDC1 = ((7 << 3) + 5) << kOpcodeShift,
342 SD = ((7 << 3) + 7) << kOpcodeShift, 357 POP76 = ((7 << 3) + 6) << kOpcodeShift,
358 SD = ((7 << 3) + 7) << kOpcodeShift,
343 359
344 COP1X = ((1 << 4) + 3) << kOpcodeShift 360 COP1X = ((1 << 4) + 3) << kOpcodeShift
345 }; 361 };
346 362
347 enum SecondaryField { 363 enum SecondaryField {
348 // SPECIAL Encoding of Function Field. 364 // SPECIAL Encoding of Function Field.
349 SLL = ((0 << 3) + 0), 365 SLL = ((0 << 3) + 0),
350 MOVCI = ((0 << 3) + 1), 366 MOVCI = ((0 << 3) + 1),
351 SRL = ((0 << 3) + 2), 367 SRL = ((0 << 3) + 2),
352 SRA = ((0 << 3) + 3), 368 SRA = ((0 << 3) + 3),
353 SLLV = ((0 << 3) + 4), 369 SLLV = ((0 << 3) + 4),
354 SRLV = ((0 << 3) + 6), 370 SRLV = ((0 << 3) + 6),
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 // SPECIAL3 Encoding of Function Field. 452 // SPECIAL3 Encoding of Function Field.
437 EXT = ((0 << 3) + 0), 453 EXT = ((0 << 3) + 0),
438 DEXTM = ((0 << 3) + 1), 454 DEXTM = ((0 << 3) + 1),
439 DEXTU = ((0 << 3) + 2), 455 DEXTU = ((0 << 3) + 2),
440 DEXT = ((0 << 3) + 3), 456 DEXT = ((0 << 3) + 3),
441 INS = ((0 << 3) + 4), 457 INS = ((0 << 3) + 4),
442 DINSM = ((0 << 3) + 5), 458 DINSM = ((0 << 3) + 5),
443 DINSU = ((0 << 3) + 6), 459 DINSU = ((0 << 3) + 6),
444 DINS = ((0 << 3) + 7), 460 DINS = ((0 << 3) + 7),
445 461
446 BITSWAP = ((4 << 3) + 0), 462 BSHFL = ((4 << 3) + 0),
447 DBITSWAP = ((4 << 3) + 4), 463 DBSHFL = ((4 << 3) + 4),
448 DSBH = ((4 << 3) + 4),
449 464
450 // SPECIAL3 Encoding of sa Field. 465 // SPECIAL3 Encoding of sa Field
466 BITSWAP = ((0 << 3) + 0),
467 ALIGN = ((0 << 3) + 2),
468 WSBH = ((0 << 3) + 2),
469 SEB = ((2 << 3) + 0),
470 SEH = ((3 << 3) + 0),
471
472 DBITSWAP = ((0 << 3) + 0),
473 DALIGN = ((0 << 3) + 1),
451 DBITSWAP_SA = ((0 << 3) + 0) << kSaShift, 474 DBITSWAP_SA = ((0 << 3) + 0) << kSaShift,
475 DSBH = ((0 << 3) + 2),
476 DSHD = ((0 << 3) + 5),
452 477
453 // REGIMM encoding of rt Field. 478 // REGIMM encoding of rt Field.
454 BLTZ = ((0 << 3) + 0) << 16, 479 BLTZ = ((0 << 3) + 0) << 16,
455 BGEZ = ((0 << 3) + 1) << 16, 480 BGEZ = ((0 << 3) + 1) << 16,
456 BLTZAL = ((2 << 3) + 0) << 16, 481 BLTZAL = ((2 << 3) + 0) << 16,
457 BGEZAL = ((2 << 3) + 1) << 16, 482 BGEZAL = ((2 << 3) + 1) << 16,
458 BGEZALL = ((2 << 3) + 3) << 16, 483 BGEZALL = ((2 << 3) + 3) << 16,
459 DAHI = ((0 << 3) + 6) << 16, 484 DAHI = ((0 << 3) + 6) << 16,
460 DATI = ((3 << 3) + 6) << 16, 485 DATI = ((3 << 3) + 6) << 16,
461 486
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 MOVF = ((2 << 3) + 1), // Function field for MOVT.fmt and MOVF.fmt 606 MOVF = ((2 << 3) + 1), // Function field for MOVT.fmt and MOVF.fmt
582 MOVZ_C = ((2 << 3) + 2), // COP1 on FPR registers. 607 MOVZ_C = ((2 << 3) + 2), // COP1 on FPR registers.
583 MOVN_C = ((2 << 3) + 3), // COP1 on FPR registers. 608 MOVN_C = ((2 << 3) + 3), // COP1 on FPR registers.
584 SELEQZ_C = ((2 << 3) + 4), // COP1 on FPR registers. 609 SELEQZ_C = ((2 << 3) + 4), // COP1 on FPR registers.
585 SELNEZ_C = ((2 << 3) + 7), // COP1 on FPR registers. 610 SELNEZ_C = ((2 << 3) + 7), // COP1 on FPR registers.
586 611
587 // COP1 Encoding of Function Field When rs=PS. 612 // COP1 Encoding of Function Field When rs=PS.
588 // COP1X Encoding of Function Field. 613 // COP1X Encoding of Function Field.
589 MADD_D = ((4 << 3) + 1), 614 MADD_D = ((4 << 3) + 1),
590 615
616 // PCREL Encoding of rt field
617 ADDIUPC = ((0 << 2) + 0),
618 LWPC = ((0 << 2) + 1),
619 LWUPC = ((0 << 2) + 2),
620 LDPC = ((0 << 3) + 6),
621 // reserved ((1 << 3) + 6),
622 AUIPC = ((3 << 3) + 6),
623 ALUIPC = ((3 << 3) + 7),
624
625 // POP66 Encoding of rs field
626 JIC = ((0 << 5) + 0),
627
628 // POP76 Encoding of rs field
629 JIALC = ((0 << 5) + 0),
630
591 NULLSF = 0 631 NULLSF = 0
592 }; 632 };
593 633
594 634
595 // ----- Emulated conditions. 635 // ----- Emulated conditions.
596 // On MIPS we use this enum to abstract from conditional branch instructions. 636 // On MIPS we use this enum to abstract from conditional branch instructions.
597 // The 'U' prefix is used to specify unsigned comparisons. 637 // The 'U' prefix is used to specify unsigned comparisons.
598 // Opposite conditions must be paired as odd/even numbers 638 // Opposite conditions must be paired as odd/even numbers
599 // because 'NegateCondition' function flips LSB to negate condition. 639 // because 'NegateCondition' function flips LSB to negate condition.
600 enum Condition { 640 enum Condition {
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 } 931 }
892 932
893 inline int FtValue() const { 933 inline int FtValue() const {
894 return Bits(kFtShift + kFtBits - 1, kFtShift); 934 return Bits(kFtShift + kFtBits - 1, kFtShift);
895 } 935 }
896 936
897 inline int FrValue() const { 937 inline int FrValue() const {
898 return Bits(kFrShift + kFrBits -1, kFrShift); 938 return Bits(kFrShift + kFrBits -1, kFrShift);
899 } 939 }
900 940
941 inline int Bp2Value() const {
942 DCHECK(InstructionType() == kRegisterType);
943 return Bits(kBp2Shift + kBp2Bits - 1, kBp2Shift);
944 }
945
946 inline int Bp3Value() const {
947 DCHECK(InstructionType() == kRegisterType);
948 return Bits(kBp3Shift + kBp3Bits - 1, kBp3Shift);
949 }
950
901 // Float Compare condition code instruction bits. 951 // Float Compare condition code instruction bits.
902 inline int FCccValue() const { 952 inline int FCccValue() const {
903 return Bits(kFCccShift + kFCccBits - 1, kFCccShift); 953 return Bits(kFCccShift + kFCccBits - 1, kFCccShift);
904 } 954 }
905 955
906 // Float Branch condition code instruction bits. 956 // Float Branch condition code instruction bits.
907 inline int FBccValue() const { 957 inline int FBccValue() const {
908 return Bits(kFBccShift + kFBccBits - 1, kFBccShift); 958 return Bits(kFBccShift + kFBccBits - 1, kFBccShift);
909 } 959 }
910 960
(...skipping 23 matching lines...) Expand all
934 InstructionType() == kImmediateType); 984 InstructionType() == kImmediateType);
935 return InstructionBits() & kRtFieldMask; 985 return InstructionBits() & kRtFieldMask;
936 } 986 }
937 987
938 inline int RdFieldRaw() const { 988 inline int RdFieldRaw() const {
939 DCHECK(InstructionType() == kRegisterType); 989 DCHECK(InstructionType() == kRegisterType);
940 return InstructionBits() & kRdFieldMask; 990 return InstructionBits() & kRdFieldMask;
941 } 991 }
942 992
943 inline int SaFieldRaw() const { 993 inline int SaFieldRaw() const {
944 DCHECK(InstructionType() == kRegisterType); 994 // DCHECK(InstructionType() == kRegisterType);
945 return InstructionBits() & kSaFieldMask; 995 return InstructionBits() & kSaFieldMask;
946 } 996 }
947 997
948 inline int FunctionFieldRaw() const { 998 inline int FunctionFieldRaw() const {
949 return InstructionBits() & kFunctionFieldMask; 999 return InstructionBits() & kFunctionFieldMask;
950 } 1000 }
951 1001
952 // Get the secondary field according to the opcode. 1002 // Get the secondary field according to the opcode.
953 inline int SecondaryValue() const { 1003 inline int SecondaryValue() const {
954 Opcode op = OpcodeFieldRaw(); 1004 Opcode op = OpcodeFieldRaw();
955 switch (op) { 1005 switch (op) {
956 case SPECIAL: 1006 case SPECIAL:
957 case SPECIAL2: 1007 case SPECIAL2:
958 return FunctionValue(); 1008 return FunctionValue();
959 case COP1: 1009 case COP1:
960 return RsValue(); 1010 return RsValue();
961 case REGIMM: 1011 case REGIMM:
962 return RtValue(); 1012 return RtValue();
963 default: 1013 default:
964 return NULLSF; 1014 return NULLSF;
965 } 1015 }
966 } 1016 }
967 1017
968 inline int32_t Imm16Value() const { 1018 inline int32_t Imm16Value() const {
969 DCHECK(InstructionType() == kImmediateType); 1019 DCHECK(InstructionType() == kImmediateType);
970 return Bits(kImm16Shift + kImm16Bits - 1, kImm16Shift); 1020 return Bits(kImm16Shift + kImm16Bits - 1, kImm16Shift);
971 } 1021 }
972 1022
1023 inline int32_t Imm18Value() const {
1024 DCHECK(InstructionType() == kImmediateType);
1025 return Bits(kImm18Shift + kImm18Bits - 1, kImm18Shift);
1026 }
1027
1028 inline int32_t Imm19Value() const {
1029 DCHECK(InstructionType() == kImmediateType);
1030 return Bits(kImm19Shift + kImm19Bits - 1, kImm19Shift);
1031 }
1032
973 inline int32_t Imm21Value() const { 1033 inline int32_t Imm21Value() const {
974 DCHECK(InstructionType() == kImmediateType); 1034 DCHECK(InstructionType() == kImmediateType);
975 return Bits(kImm21Shift + kImm21Bits - 1, kImm21Shift); 1035 return Bits(kImm21Shift + kImm21Bits - 1, kImm21Shift);
976 } 1036 }
977 1037
978 inline int32_t Imm26Value() const { 1038 inline int32_t Imm26Value() const {
979 DCHECK(InstructionType() == kJumpType); 1039 DCHECK(InstructionType() == kJumpType);
980 return Bits(kImm26Shift + kImm26Bits - 1, kImm26Shift); 1040 return Bits(kImm26Shift + kImm26Bits - 1, kImm26Shift);
981 } 1041 }
982 1042
(...skipping 27 matching lines...) Expand all
1010 // TODO(plind): below should be based on kPointerSize 1070 // TODO(plind): below should be based on kPointerSize
1011 // TODO(plind): find all usages and remove the needless instructions for n64. 1071 // TODO(plind): find all usages and remove the needless instructions for n64.
1012 const int kCArgsSlotsSize = kCArgSlotCount * Instruction::kInstrSize * 2; 1072 const int kCArgsSlotsSize = kCArgSlotCount * Instruction::kInstrSize * 2;
1013 1073
1014 const int kInvalidStackOffset = -1; 1074 const int kInvalidStackOffset = -1;
1015 const int kBranchReturnOffset = 2 * Instruction::kInstrSize; 1075 const int kBranchReturnOffset = 2 * Instruction::kInstrSize;
1016 1076
1017 } } // namespace v8::internal 1077 } } // namespace v8::internal
1018 1078
1019 #endif // #ifndef V8_MIPS_CONSTANTS_H_ 1079 #endif // #ifndef V8_MIPS_CONSTANTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698