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

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

Issue 2892163002: MIPS64: Add optimizations to li macro. (Closed)
Patch Set: Add Subu optimization Created 3 years, 7 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/mips/macro-assembler-mips.cc ('k') | src/mips64/macro-assembler-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 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 #include "src/base/logging.h" 8 #include "src/base/logging.h"
9 #include "src/base/macros.h" 9 #include "src/base/macros.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 const int kLsaSaBits = 2; 266 const int kLsaSaBits = 2;
267 const int kFunctionShift = 0; 267 const int kFunctionShift = 0;
268 const int kFunctionBits = 6; 268 const int kFunctionBits = 6;
269 const int kLuiShift = 16; 269 const int kLuiShift = 16;
270 const int kBp2Shift = 6; 270 const int kBp2Shift = 6;
271 const int kBp2Bits = 2; 271 const int kBp2Bits = 2;
272 const int kBp3Shift = 6; 272 const int kBp3Shift = 6;
273 const int kBp3Bits = 3; 273 const int kBp3Bits = 3;
274 274
275 const int kImm16Shift = 0; 275 const int kImm16Shift = 0;
276 const int kImm16Bits = 16; 276 const int kImm16Bits = 16;
277 const int kImm18Shift = 0; 277 const int kImm18Shift = 0;
278 const int kImm18Bits = 18; 278 const int kImm18Bits = 18;
279 const int kImm19Shift = 0; 279 const int kImm19Shift = 0;
280 const int kImm19Bits = 19; 280 const int kImm19Bits = 19;
281 const int kImm21Shift = 0; 281 const int kImm21Shift = 0;
282 const int kImm21Bits = 21; 282 const int kImm21Bits = 21;
283 const int kImm26Shift = 0; 283 const int kImm26Shift = 0;
284 const int kImm26Bits = 26; 284 const int kImm26Bits = 26;
285 const int kImm28Shift = 0; 285 const int kImm28Shift = 0;
286 const int kImm28Bits = 28; 286 const int kImm28Bits = 28;
287 const int kImm32Shift = 0; 287 const int kImm32Shift = 0;
288 const int kImm32Bits = 32; 288 const int kImm32Bits = 32;
289 const int kMsaImm8Shift = 16; 289 const int kMsaImm8Shift = 16;
290 const int kMsaImm8Bits = 8; 290 const int kMsaImm8Bits = 8;
291 const int kMsaImm5Shift = 16; 291 const int kMsaImm5Shift = 16;
292 const int kMsaImm5Bits = 5; 292 const int kMsaImm5Bits = 5;
293 const int kMsaImm10Shift = 11; 293 const int kMsaImm10Shift = 11;
294 const int kMsaImm10Bits = 10; 294 const int kMsaImm10Bits = 10;
295 const int kMsaImmMI10Shift = 16; 295 const int kMsaImmMI10Shift = 16;
296 const int kMsaImmMI10Bits = 10; 296 const int kMsaImmMI10Bits = 10;
297 297
298 // In branches and jumps immediate fields point to words, not bytes, 298 // In branches and jumps immediate fields point to words, not bytes,
(...skipping 16 matching lines...) Expand all
315 const int kFBtrueBits = 1; 315 const int kFBtrueBits = 1;
316 const int kWtBits = 5; 316 const int kWtBits = 5;
317 const int kWtShift = 16; 317 const int kWtShift = 16;
318 const int kWsBits = 5; 318 const int kWsBits = 5;
319 const int kWsShift = 11; 319 const int kWsShift = 11;
320 const int kWdBits = 5; 320 const int kWdBits = 5;
321 const int kWdShift = 6; 321 const int kWdShift = 6;
322 322
323 // ----- Miscellaneous useful masks. 323 // ----- Miscellaneous useful masks.
324 // Instruction bit masks. 324 // Instruction bit masks.
325 const int kOpcodeMask = ((1 << kOpcodeBits) - 1) << kOpcodeShift; 325 const int kOpcodeMask = ((1 << kOpcodeBits) - 1) << kOpcodeShift;
326 const int kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift; 326 const int kImm16Mask = ((1 << kImm16Bits) - 1) << kImm16Shift;
327 const int kImm18Mask = ((1 << kImm18Bits) - 1) << kImm18Shift; 327 const int kImm18Mask = ((1 << kImm18Bits) - 1) << kImm18Shift;
328 const int kImm19Mask = ((1 << kImm19Bits) - 1) << kImm19Shift; 328 const int kImm19Mask = ((1 << kImm19Bits) - 1) << kImm19Shift;
329 const int kImm21Mask = ((1 << kImm21Bits) - 1) << kImm21Shift; 329 const int kImm21Mask = ((1 << kImm21Bits) - 1) << kImm21Shift;
330 const int kImm26Mask = ((1 << kImm26Bits) - 1) << kImm26Shift; 330 const int kImm26Mask = ((1 << kImm26Bits) - 1) << kImm26Shift;
331 const int kImm28Mask = ((1 << kImm28Bits) - 1) << kImm28Shift; 331 const int kImm28Mask = ((1 << kImm28Bits) - 1) << kImm28Shift;
332 const int kImm5Mask = ((1 << 5) - 1); 332 const int kImm5Mask = ((1 << 5) - 1);
333 const int kImm8Mask = ((1 << 8) - 1); 333 const int kImm8Mask = ((1 << 8) - 1);
334 const int kImm10Mask = ((1 << 10) - 1); 334 const int kImm10Mask = ((1 << 10) - 1);
335 const int kMsaI5I10Mask = ((7U << 23) | ((1 << 6) - 1)); 335 const int kMsaI5I10Mask = ((7U << 23) | ((1 << 6) - 1));
336 const int kRsFieldMask = ((1 << kRsBits) - 1) << kRsShift; 336 const int kRsFieldMask = ((1 << kRsBits) - 1) << kRsShift;
337 const int kRtFieldMask = ((1 << kRtBits) - 1) << kRtShift; 337 const int kRtFieldMask = ((1 << kRtBits) - 1) << kRtShift;
338 const int kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift; 338 const int kRdFieldMask = ((1 << kRdBits) - 1) << kRdShift;
339 const int kSaFieldMask = ((1 << kSaBits) - 1) << kSaShift; 339 const int kSaFieldMask = ((1 << kSaBits) - 1) << kSaShift;
340 const int kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift; 340 const int kFunctionFieldMask = ((1 << kFunctionBits) - 1) << kFunctionShift;
341 // Misc masks. 341 // Misc masks.
342 const int kHiMask = 0xffff << 16; 342 const int kHiMaskOf32 = 0xffff << 16; // Only to be used with 32-bit values
ivica.bogosavljevic 2017/05/19 12:42:39 If you mean by this HiMaskOffset32 than you should
miran.karic 2017/05/19 13:23:53 It is HiMask of 32, not offset. This is analogous
343 const int kLoMask = 0xffff; 343 const int kLoMaskOf32 = 0xffff;
344 const int kSignMask = 0x80000000; 344 const int kSignMaskOf32 = 0x80000000; // Only to be used with 32-bit values
345 const int kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1; 345 const int kJumpAddrMask = (1 << (kImm26Bits + kImmFieldShift)) - 1;
346 const int64_t kHi16MaskOf64 = (int64_t)0xffff << 48; 346 const int64_t kTop16MaskOf64 = (int64_t)0xffff << 48;
347 const int64_t kSe16MaskOf64 = (int64_t)0xffff << 32; 347 const int64_t kHigher16MaskOf64 = (int64_t)0xffff << 32;
348 const int64_t kTh16MaskOf64 = (int64_t)0xffff << 16; 348 const int64_t kUpper16MaskOf64 = (int64_t)0xffff << 16;
349 const int32_t kJalRawMark = 0x00000000; 349 const int32_t kJalRawMark = 0x00000000;
350 const int32_t kJRawMark = 0xf0000000; 350 const int32_t kJRawMark = 0xf0000000;
351 const int32_t kJumpRawMask = 0xf0000000; 351 const int32_t kJumpRawMask = 0xf0000000;
352 352
353 // ----- MIPS Opcodes and Function Fields. 353 // ----- MIPS Opcodes and Function Fields.
354 // We use this presentation to stay close to the table representation in 354 // We use this presentation to stay close to the table representation in
355 // MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set. 355 // MIPS32 Architecture For Programmers, Volume II: The MIPS32 Instruction Set.
356 enum Opcode : uint32_t { 356 enum Opcode : uint32_t {
357 SPECIAL = 0U << kOpcodeShift, 357 SPECIAL = 0U << kOpcodeShift,
358 REGIMM = 1U << kOpcodeShift, 358 REGIMM = 1U << kOpcodeShift,
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1910 } 1910 }
1911 break; 1911 break;
1912 default: 1912 default:
1913 return false; 1913 return false;
1914 } 1914 }
1915 } 1915 }
1916 } // namespace internal 1916 } // namespace internal
1917 } // namespace v8 1917 } // namespace v8
1918 1918
1919 #endif // #ifndef V8_MIPS_CONSTANTS_H_ 1919 #endif // #ifndef V8_MIPS_CONSTANTS_H_
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698