OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // Using blx may yield better code, so use it when required or when available | 81 // Using blx may yield better code, so use it when required or when available |
82 #if defined(USE_THUMB_INTERWORK) || defined(CAN_USE_ARMV5_INSTRUCTIONS) | 82 #if defined(USE_THUMB_INTERWORK) || defined(CAN_USE_ARMV5_INSTRUCTIONS) |
83 #define USE_BLX 1 | 83 #define USE_BLX 1 |
84 #endif | 84 #endif |
85 | 85 |
86 namespace v8 { | 86 namespace v8 { |
87 namespace internal { | 87 namespace internal { |
88 | 88 |
89 // Constant pool marker. | 89 // Constant pool marker. |
90 static const int kConstantPoolMarkerMask = 0xffe00000; | 90 const int kConstantPoolMarkerMask = 0xffe00000; |
91 static const int kConstantPoolMarker = 0x0c000000; | 91 const int kConstantPoolMarker = 0x0c000000; |
92 static const int kConstantPoolLengthMask = 0x001ffff; | 92 const int kConstantPoolLengthMask = 0x001ffff; |
93 | 93 |
94 // Number of registers in normal ARM mode. | 94 // Number of registers in normal ARM mode. |
95 static const int kNumRegisters = 16; | 95 const int kNumRegisters = 16; |
96 | 96 |
97 // VFP support. | 97 // VFP support. |
98 static const int kNumVFPSingleRegisters = 32; | 98 const int kNumVFPSingleRegisters = 32; |
99 static const int kNumVFPDoubleRegisters = 16; | 99 const int kNumVFPDoubleRegisters = 16; |
100 static const int kNumVFPRegisters = | 100 const int kNumVFPRegisters = kNumVFPSingleRegisters + kNumVFPDoubleRegisters; |
101 kNumVFPSingleRegisters + kNumVFPDoubleRegisters; | |
102 | 101 |
103 // PC is register 15. | 102 // PC is register 15. |
104 static const int kPCRegister = 15; | 103 const int kPCRegister = 15; |
105 static const int kNoRegister = -1; | 104 const int kNoRegister = -1; |
106 | 105 |
107 // ----------------------------------------------------------------------------- | 106 // ----------------------------------------------------------------------------- |
108 // Conditions. | 107 // Conditions. |
109 | 108 |
110 // Defines constants and accessor classes to assemble, disassemble and | 109 // Defines constants and accessor classes to assemble, disassemble and |
111 // simulate ARM instructions. | 110 // simulate ARM instructions. |
112 // | 111 // |
113 // Section references in the code refer to the "ARM Architecture Reference | 112 // Section references in the code refer to the "ARM Architecture Reference |
114 // Manual" from July 2005 (available at http://www.arm.com/miscPDFs/14128.pdf) | 113 // Manual" from July 2005 (available at http://www.arm.com/miscPDFs/14128.pdf) |
115 // | 114 // |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // svc (formerly swi) provides a 24bit immediate value. Use bits 22:0 for | 363 // svc (formerly swi) provides a 24bit immediate value. Use bits 22:0 for |
365 // standard SoftwareInterrupCode. Bit 23 is reserved for the stop feature. | 364 // standard SoftwareInterrupCode. Bit 23 is reserved for the stop feature. |
366 enum SoftwareInterruptCodes { | 365 enum SoftwareInterruptCodes { |
367 // transition to C code | 366 // transition to C code |
368 kCallRtRedirected= 0x10, | 367 kCallRtRedirected= 0x10, |
369 // break point | 368 // break point |
370 kBreakpoint= 0x20, | 369 kBreakpoint= 0x20, |
371 // stop | 370 // stop |
372 kStopCode = 1 << 23 | 371 kStopCode = 1 << 23 |
373 }; | 372 }; |
374 static const uint32_t kStopCodeMask = kStopCode - 1; | 373 const uint32_t kStopCodeMask = kStopCode - 1; |
375 static const uint32_t kMaxStopCode = kStopCode - 1; | 374 const uint32_t kMaxStopCode = kStopCode - 1; |
376 static const int32_t kDefaultStopCode = -1; | 375 const int32_t kDefaultStopCode = -1; |
377 | 376 |
378 | 377 |
379 // Type of VFP register. Determines register encoding. | 378 // Type of VFP register. Determines register encoding. |
380 enum VFPRegPrecision { | 379 enum VFPRegPrecision { |
381 kSinglePrecision = 0, | 380 kSinglePrecision = 0, |
382 kDoublePrecision = 1 | 381 kDoublePrecision = 1 |
383 }; | 382 }; |
384 | 383 |
385 | 384 |
386 // VFP FPSCR constants. | 385 // VFP FPSCR constants. |
387 enum VFPConversionMode { | 386 enum VFPConversionMode { |
388 kFPSCRRounding = 0, | 387 kFPSCRRounding = 0, |
389 kDefaultRoundToZero = 1 | 388 kDefaultRoundToZero = 1 |
390 }; | 389 }; |
391 | 390 |
392 // This mask does not include the "inexact" or "input denormal" cumulative | 391 // This mask does not include the "inexact" or "input denormal" cumulative |
393 // exceptions flags, because we usually don't want to check for it. | 392 // exceptions flags, because we usually don't want to check for it. |
394 static const uint32_t kVFPExceptionMask = 0xf; | 393 const uint32_t kVFPExceptionMask = 0xf; |
395 static const uint32_t kVFPInvalidOpExceptionBit = 1 << 0; | 394 const uint32_t kVFPInvalidOpExceptionBit = 1 << 0; |
396 static const uint32_t kVFPOverflowExceptionBit = 1 << 2; | 395 const uint32_t kVFPOverflowExceptionBit = 1 << 2; |
397 static const uint32_t kVFPUnderflowExceptionBit = 1 << 3; | 396 const uint32_t kVFPUnderflowExceptionBit = 1 << 3; |
398 static const uint32_t kVFPInexactExceptionBit = 1 << 4; | 397 const uint32_t kVFPInexactExceptionBit = 1 << 4; |
399 static const uint32_t kVFPFlushToZeroMask = 1 << 24; | 398 const uint32_t kVFPFlushToZeroMask = 1 << 24; |
400 | 399 |
401 static const uint32_t kVFPNConditionFlagBit = 1 << 31; | 400 const uint32_t kVFPNConditionFlagBit = 1 << 31; |
402 static const uint32_t kVFPZConditionFlagBit = 1 << 30; | 401 const uint32_t kVFPZConditionFlagBit = 1 << 30; |
403 static const uint32_t kVFPCConditionFlagBit = 1 << 29; | 402 const uint32_t kVFPCConditionFlagBit = 1 << 29; |
404 static const uint32_t kVFPVConditionFlagBit = 1 << 28; | 403 const uint32_t kVFPVConditionFlagBit = 1 << 28; |
405 | 404 |
406 | 405 |
407 // VFP rounding modes. See ARM DDI 0406B Page A2-29. | 406 // VFP rounding modes. See ARM DDI 0406B Page A2-29. |
408 enum VFPRoundingMode { | 407 enum VFPRoundingMode { |
409 RN = 0 << 22, // Round to Nearest. | 408 RN = 0 << 22, // Round to Nearest. |
410 RP = 1 << 22, // Round towards Plus Infinity. | 409 RP = 1 << 22, // Round towards Plus Infinity. |
411 RM = 2 << 22, // Round towards Minus Infinity. | 410 RM = 2 << 22, // Round towards Minus Infinity. |
412 RZ = 3 << 22, // Round towards zero. | 411 RZ = 3 << 22, // Round towards zero. |
413 | 412 |
414 // Aliases. | 413 // Aliases. |
415 kRoundToNearest = RN, | 414 kRoundToNearest = RN, |
416 kRoundToPlusInf = RP, | 415 kRoundToPlusInf = RP, |
417 kRoundToMinusInf = RM, | 416 kRoundToMinusInf = RM, |
418 kRoundToZero = RZ | 417 kRoundToZero = RZ |
419 }; | 418 }; |
420 | 419 |
421 static const uint32_t kVFPRoundingModeMask = 3 << 22; | 420 const uint32_t kVFPRoundingModeMask = 3 << 22; |
422 | 421 |
423 enum CheckForInexactConversion { | 422 enum CheckForInexactConversion { |
424 kCheckForInexactConversion, | 423 kCheckForInexactConversion, |
425 kDontCheckForInexactConversion | 424 kDontCheckForInexactConversion |
426 }; | 425 }; |
427 | 426 |
428 // ----------------------------------------------------------------------------- | 427 // ----------------------------------------------------------------------------- |
429 // Hints. | 428 // Hints. |
430 | 429 |
431 // Branch hints are not used on the ARM. They are defined so that they can | 430 // Branch hints are not used on the ARM. They are defined so that they can |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 static int Number(const char* name, bool* is_double); | 765 static int Number(const char* name, bool* is_double); |
767 | 766 |
768 private: | 767 private: |
769 static const char* names_[kNumVFPRegisters]; | 768 static const char* names_[kNumVFPRegisters]; |
770 }; | 769 }; |
771 | 770 |
772 | 771 |
773 } } // namespace v8::internal | 772 } } // namespace v8::internal |
774 | 773 |
775 #endif // V8_ARM_CONSTANTS_ARM_H_ | 774 #endif // V8_ARM_CONSTANTS_ARM_H_ |
OLD | NEW |