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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
665 return reinterpret_cast<Instruction*>(pc); | 665 return reinterpret_cast<Instruction*>(pc); |
666 } | 666 } |
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 == kDoublePrecision) { |
martyn.capewell
2016/11/23 20:08:46
As Q is encoded in the same way as D, but as Q*2,
bbudge
2016/11/24 02:22:53
Done.
| |
676 return (Bit(one_bit) << 4) | Bits(four_bit + 3, four_bit); | |
677 } else if (pre == kSinglePrecision) { | |
676 return (Bits(four_bit + 3, four_bit) << 1) | Bit(one_bit); | 678 return (Bits(four_bit + 3, four_bit) << 1) | Bit(one_bit); |
677 } | 679 } |
678 return (Bit(one_bit) << 4) | Bits(four_bit + 3, four_bit); | 680 DCHECK_EQ(kSimd128Precision, pre); |
681 return (Bit(one_bit) << 3) | Bits(four_bit + 3, four_bit) >> 1; | |
679 } | 682 } |
680 | 683 |
681 // We need to prevent the creation of instances of class Instruction. | 684 // We need to prevent the creation of instances of class Instruction. |
682 DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction); | 685 DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction); |
683 }; | 686 }; |
684 | 687 |
685 | 688 |
686 // Helper functions for converting between register numbers and names. | 689 // Helper functions for converting between register numbers and names. |
687 class Registers { | 690 class Registers { |
688 public: | 691 public: |
(...skipping 26 matching lines...) Expand all Loading... | |
715 | 718 |
716 private: | 719 private: |
717 static const char* names_[kNumVFPRegisters]; | 720 static const char* names_[kNumVFPRegisters]; |
718 }; | 721 }; |
719 | 722 |
720 | 723 |
721 } // namespace internal | 724 } // namespace internal |
722 } // namespace v8 | 725 } // namespace v8 |
723 | 726 |
724 #endif // V8_ARM_CONSTANTS_ARM_H_ | 727 #endif // V8_ARM_CONSTANTS_ARM_H_ |
OLD | NEW |