OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_ARM_CONSTANTS_ARM_H_ | 5 #ifndef V8_ARM_CONSTANTS_ARM_H_ |
6 #define V8_ARM_CONSTANTS_ARM_H_ | 6 #define V8_ARM_CONSTANTS_ARM_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 kStopCode = 1 << 23 | 367 kStopCode = 1 << 23 |
368 }; | 368 }; |
369 const uint32_t kStopCodeMask = kStopCode - 1; | 369 const uint32_t kStopCodeMask = kStopCode - 1; |
370 const uint32_t kMaxStopCode = kStopCode - 1; | 370 const uint32_t kMaxStopCode = kStopCode - 1; |
371 const int32_t kDefaultStopCode = -1; | 371 const int32_t kDefaultStopCode = -1; |
372 | 372 |
373 | 373 |
374 // Type of VFP register. Determines register encoding. | 374 // Type of VFP register. Determines register encoding. |
375 enum VFPRegPrecision { | 375 enum VFPRegPrecision { |
376 kSinglePrecision = 0, | 376 kSinglePrecision = 0, |
377 kDoublePrecision = 1 | 377 kDoublePrecision = 1, |
| 378 kSimd128Precision = 2 |
378 }; | 379 }; |
379 | 380 |
380 | |
381 // VFP FPSCR constants. | 381 // VFP FPSCR constants. |
382 enum VFPConversionMode { | 382 enum VFPConversionMode { |
383 kFPSCRRounding = 0, | 383 kFPSCRRounding = 0, |
384 kDefaultRoundToZero = 1 | 384 kDefaultRoundToZero = 1 |
385 }; | 385 }; |
386 | 386 |
387 // This mask does not include the "inexact" or "input denormal" cumulative | 387 // This mask does not include the "inexact" or "input denormal" cumulative |
388 // exceptions flags, because we usually don't want to check for it. | 388 // exceptions flags, because we usually don't want to check for it. |
389 const uint32_t kVFPExceptionMask = 0xf; | 389 const uint32_t kVFPExceptionMask = 0xf; |
390 const uint32_t kVFPInvalidOpExceptionBit = 1 << 0; | 390 const uint32_t kVFPInvalidOpExceptionBit = 1 << 0; |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 667 |
668 | 668 |
669 private: | 669 private: |
670 // Join split register codes, depending on single or double precision. | 670 // Join split register codes, depending on single or double precision. |
671 // four_bit is the position of the least-significant bit of the four | 671 // four_bit is the position of the least-significant bit of the four |
672 // bit specifier. one_bit is the position of the additional single bit | 672 // bit specifier. one_bit is the position of the additional single bit |
673 // specifier. | 673 // specifier. |
674 inline int VFPGlueRegValue(VFPRegPrecision pre, int four_bit, int one_bit) { | 674 inline int VFPGlueRegValue(VFPRegPrecision pre, int four_bit, int one_bit) { |
675 if (pre == kSinglePrecision) { | 675 if (pre == kSinglePrecision) { |
676 return (Bits(four_bit + 3, four_bit) << 1) | Bit(one_bit); | 676 return (Bits(four_bit + 3, four_bit) << 1) | Bit(one_bit); |
| 677 } else { |
| 678 int reg_num = (Bit(one_bit) << 4) | Bits(four_bit + 3, four_bit); |
| 679 if (pre == kDoublePrecision) { |
| 680 return reg_num; |
| 681 } |
| 682 DCHECK_EQ(kSimd128Precision, pre); |
| 683 DCHECK_EQ(reg_num & 1, 0); |
| 684 return reg_num / 2; |
677 } | 685 } |
678 return (Bit(one_bit) << 4) | Bits(four_bit + 3, four_bit); | |
679 } | 686 } |
680 | 687 |
681 // We need to prevent the creation of instances of class Instruction. | 688 // We need to prevent the creation of instances of class Instruction. |
682 DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction); | 689 DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction); |
683 }; | 690 }; |
684 | 691 |
685 | 692 |
686 // Helper functions for converting between register numbers and names. | 693 // Helper functions for converting between register numbers and names. |
687 class Registers { | 694 class Registers { |
688 public: | 695 public: |
(...skipping 26 matching lines...) Expand all Loading... |
715 | 722 |
716 private: | 723 private: |
717 static const char* names_[kNumVFPRegisters]; | 724 static const char* names_[kNumVFPRegisters]; |
718 }; | 725 }; |
719 | 726 |
720 | 727 |
721 } // namespace internal | 728 } // namespace internal |
722 } // namespace v8 | 729 } // namespace v8 |
723 | 730 |
724 #endif // V8_ARM_CONSTANTS_ARM_H_ | 731 #endif // V8_ARM_CONSTANTS_ARM_H_ |
OLD | NEW |