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 15 matching lines...) Expand all Loading... |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_ARM_CONSTANTS_ARM_H_ | 28 #ifndef V8_ARM_CONSTANTS_ARM_H_ |
29 #define V8_ARM_CONSTANTS_ARM_H_ | 29 #define V8_ARM_CONSTANTS_ARM_H_ |
30 | 30 |
31 // ARM EABI is required. | 31 // ARM EABI is required. |
32 #if defined(__arm__) && !defined(__ARM_EABI__) | 32 #if defined(__arm__) && !defined(__ARM_EABI__) |
33 #error ARM EABI support is required. | 33 #error ARM EABI support is required. |
34 #endif | 34 #endif |
35 | 35 |
36 #if defined(__ARM_ARCH_7A__) || \ | |
37 defined(__ARM_ARCH_7R__) || \ | |
38 defined(__ARM_ARCH_7__) | |
39 # define CAN_USE_ARMV7_INSTRUCTIONS 1 | |
40 #ifndef CAN_USE_VFP3_INSTRUCTIONS | |
41 # define CAN_USE_VFP3_INSTRUCTIONS | |
42 #endif | |
43 #endif | |
44 | |
45 // Simulator should support unaligned access by default. | |
46 #if !defined(__arm__) | |
47 # ifndef CAN_USE_UNALIGNED_ACCESSES | |
48 # define CAN_USE_UNALIGNED_ACCESSES 1 | |
49 # endif | |
50 #endif | |
51 | |
52 namespace v8 { | 36 namespace v8 { |
53 namespace internal { | 37 namespace internal { |
54 | 38 |
55 // Constant pool marker. | 39 // Constant pool marker. |
56 // Use UDF, the permanently undefined instruction. | 40 // Use UDF, the permanently undefined instruction. |
57 const int kConstantPoolMarkerMask = 0xfff000f0; | 41 const int kConstantPoolMarkerMask = 0xfff000f0; |
58 const int kConstantPoolMarker = 0xe7f000f0; | 42 const int kConstantPoolMarker = 0xe7f000f0; |
59 const int kConstantPoolLengthMaxMask = 0xffff; | 43 const int kConstantPoolLengthMaxMask = 0xffff; |
60 inline int EncodeConstantPoolLength(int length) { | 44 inline int EncodeConstantPoolLength(int length) { |
61 ASSERT((length & kConstantPoolLengthMaxMask) == length); | 45 ASSERT((length & kConstantPoolLengthMaxMask) == length); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 }; | 308 }; |
325 | 309 |
326 | 310 |
327 // Coprocessor load/store operand size. | 311 // Coprocessor load/store operand size. |
328 enum LFlag { | 312 enum LFlag { |
329 Long = 1 << 22, // Long load/store coprocessor. | 313 Long = 1 << 22, // Long load/store coprocessor. |
330 Short = 0 << 22 // Short load/store coprocessor. | 314 Short = 0 << 22 // Short load/store coprocessor. |
331 }; | 315 }; |
332 | 316 |
333 | 317 |
| 318 // NEON data type |
| 319 enum NeonDataType { |
| 320 NeonS8 = 0x1, // U = 0, imm3 = 0b001 |
| 321 NeonS16 = 0x2, // U = 0, imm3 = 0b010 |
| 322 NeonS32 = 0x4, // U = 0, imm3 = 0b100 |
| 323 NeonU8 = 1 << 24 | 0x1, // U = 1, imm3 = 0b001 |
| 324 NeonU16 = 1 << 24 | 0x2, // U = 1, imm3 = 0b010 |
| 325 NeonU32 = 1 << 24 | 0x4, // U = 1, imm3 = 0b100 |
| 326 NeonDataTypeSizeMask = 0x7, |
| 327 NeonDataTypeUMask = 1 << 24 |
| 328 }; |
| 329 |
| 330 enum NeonListType { |
| 331 nlt_1 = 0x7, |
| 332 nlt_2 = 0xA, |
| 333 nlt_3 = 0x6, |
| 334 nlt_4 = 0x2 |
| 335 }; |
| 336 |
| 337 enum NeonSize { |
| 338 Neon8 = 0x0, |
| 339 Neon16 = 0x1, |
| 340 Neon32 = 0x2, |
| 341 Neon64 = 0x4 |
| 342 }; |
| 343 |
334 // ----------------------------------------------------------------------------- | 344 // ----------------------------------------------------------------------------- |
335 // Supervisor Call (svc) specific support. | 345 // Supervisor Call (svc) specific support. |
336 | 346 |
337 // Special Software Interrupt codes when used in the presence of the ARM | 347 // Special Software Interrupt codes when used in the presence of the ARM |
338 // simulator. | 348 // simulator. |
339 // svc (formerly swi) provides a 24bit immediate value. Use bits 22:0 for | 349 // svc (formerly swi) provides a 24bit immediate value. Use bits 22:0 for |
340 // standard SoftwareInterrupCode. Bit 23 is reserved for the stop feature. | 350 // standard SoftwareInterrupCode. Bit 23 is reserved for the stop feature. |
341 enum SoftwareInterruptCodes { | 351 enum SoftwareInterruptCodes { |
342 // transition to C code | 352 // transition to C code |
343 kCallRtRedirected= 0x10, | 353 kCallRtRedirected= 0x10, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 inline Condition ConditionValue() const { | 576 inline Condition ConditionValue() const { |
567 return static_cast<Condition>(Bits(31, 28)); | 577 return static_cast<Condition>(Bits(31, 28)); |
568 } | 578 } |
569 inline Condition ConditionField() const { | 579 inline Condition ConditionField() const { |
570 return static_cast<Condition>(BitField(31, 28)); | 580 return static_cast<Condition>(BitField(31, 28)); |
571 } | 581 } |
572 DECLARE_STATIC_TYPED_ACCESSOR(Condition, ConditionValue); | 582 DECLARE_STATIC_TYPED_ACCESSOR(Condition, ConditionValue); |
573 DECLARE_STATIC_TYPED_ACCESSOR(Condition, ConditionField); | 583 DECLARE_STATIC_TYPED_ACCESSOR(Condition, ConditionField); |
574 | 584 |
575 inline int TypeValue() const { return Bits(27, 25); } | 585 inline int TypeValue() const { return Bits(27, 25); } |
| 586 inline int SpecialValue() const { return Bits(27, 23); } |
576 | 587 |
577 inline int RnValue() const { return Bits(19, 16); } | 588 inline int RnValue() const { return Bits(19, 16); } |
578 DECLARE_STATIC_ACCESSOR(RnValue); | 589 DECLARE_STATIC_ACCESSOR(RnValue); |
579 inline int RdValue() const { return Bits(15, 12); } | 590 inline int RdValue() const { return Bits(15, 12); } |
580 DECLARE_STATIC_ACCESSOR(RdValue); | 591 DECLARE_STATIC_ACCESSOR(RdValue); |
581 | 592 |
582 inline int CoprocessorValue() const { return Bits(11, 8); } | 593 inline int CoprocessorValue() const { return Bits(11, 8); } |
583 // Support for VFP. | 594 // Support for VFP. |
584 // Vn(19-16) | Vd(15-12) | Vm(3-0) | 595 // Vn(19-16) | Vd(15-12) | Vm(3-0) |
585 inline int VnValue() const { return Bits(19, 16); } | 596 inline int VnValue() const { return Bits(19, 16); } |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 static int Number(const char* name, bool* is_double); | 759 static int Number(const char* name, bool* is_double); |
749 | 760 |
750 private: | 761 private: |
751 static const char* names_[kNumVFPRegisters]; | 762 static const char* names_[kNumVFPRegisters]; |
752 }; | 763 }; |
753 | 764 |
754 | 765 |
755 } } // namespace v8::internal | 766 } } // namespace v8::internal |
756 | 767 |
757 #endif // V8_ARM_CONSTANTS_ARM_H_ | 768 #endif // V8_ARM_CONSTANTS_ARM_H_ |
OLD | NEW |