| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ |
| 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ |
| 9 | 9 |
| 10 #include "native_client/src/trusted/validator_arm/inst_classes.h" | 10 #include "native_client/src/trusted/validator_arm/inst_classes.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 // Defines a based memory load with writeback. | 445 // Defines a based memory load with writeback. |
| 446 class LoadBasedMemoryWithWriteBack : public LoadBasedMemory { | 446 class LoadBasedMemoryWithWriteBack : public LoadBasedMemory { |
| 447 public: | 447 public: |
| 448 // Interfaces for components defining writeback. | 448 // Interfaces for components defining writeback. |
| 449 static const WritesBit21Interface writes; | 449 static const WritesBit21Interface writes; |
| 450 static const PrePostIndexingBit24Interface indexing; | 450 static const PrePostIndexingBit24Interface indexing; |
| 451 bool HasWriteBack(const Instruction i) const { | 451 bool HasWriteBack(const Instruction i) const { |
| 452 return indexing.IsPostIndexing(i) || writes.IsDefined(i); | 452 return indexing.IsPostIndexing(i) || writes.IsDefined(i); |
| 453 } | 453 } |
| 454 | 454 |
| 455 LoadBasedMemoryWithWriteBack() {} | |
| 456 virtual SafetyLevel safety(Instruction i) const; | 455 virtual SafetyLevel safety(Instruction i) const; |
| 457 virtual RegisterList defs(Instruction i) const; | 456 virtual RegisterList defs(Instruction i) const; |
| 458 | 457 |
| 458 protected: |
| 459 LoadBasedMemoryWithWriteBack() {} |
| 460 |
| 459 private: | 461 private: |
| 460 NACL_DISALLOW_COPY_AND_ASSIGN(LoadBasedMemoryWithWriteBack); | 462 NACL_DISALLOW_COPY_AND_ASSIGN(LoadBasedMemoryWithWriteBack); |
| 461 }; | 463 }; |
| 462 | 464 |
| 463 // Defines a based memory load on register Rn, assuming it can | 465 // Defines a based memory load on register Rn, assuming it can |
| 464 // be modified by a small literal offset, and optionally, the | 466 // be modified by a small literal offset, and optionally, the |
| 465 // value defined in register Rm. | 467 // value defined in register Rm. |
| 466 class LoadBasedOffsetMemory : public LoadBasedMemoryWithWriteBack { | 468 class LoadBasedOffsetMemory : public LoadBasedMemoryWithWriteBack { |
| 467 public: | 469 public: |
| 468 // The offset register. | 470 // The offset register. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 // Defines a based memory store from register Rt(15, 12), with writeback. | 545 // Defines a based memory store from register Rt(15, 12), with writeback. |
| 544 class StoreBasedMemoryWithWriteBack : public BasedAddressUsingRn { | 546 class StoreBasedMemoryWithWriteBack : public BasedAddressUsingRn { |
| 545 public: | 547 public: |
| 546 static const RegBits12To15Interface t; | 548 static const RegBits12To15Interface t; |
| 547 static const WritesBit21Interface writes; | 549 static const WritesBit21Interface writes; |
| 548 static const PrePostIndexingBit24Interface indexing; | 550 static const PrePostIndexingBit24Interface indexing; |
| 549 bool HasWriteBack(const Instruction i) const { | 551 bool HasWriteBack(const Instruction i) const { |
| 550 return indexing.IsPostIndexing(i) || writes.IsDefined(i); | 552 return indexing.IsPostIndexing(i) || writes.IsDefined(i); |
| 551 } | 553 } |
| 552 | 554 |
| 553 StoreBasedMemoryWithWriteBack() {} | |
| 554 virtual SafetyLevel safety(Instruction i) const; | 555 virtual SafetyLevel safety(Instruction i) const; |
| 555 virtual RegisterList defs(Instruction i) const; | 556 virtual RegisterList defs(Instruction i) const; |
| 556 | 557 |
| 558 protected: |
| 559 StoreBasedMemoryWithWriteBack() {} |
| 560 |
| 557 private: | 561 private: |
| 558 NACL_DISALLOW_COPY_AND_ASSIGN(StoreBasedMemoryWithWriteBack); | 562 NACL_DISALLOW_COPY_AND_ASSIGN(StoreBasedMemoryWithWriteBack); |
| 559 }; | 563 }; |
| 560 | 564 |
| 561 // Defines a based memory store using register Rn, assuming it can | 565 // Defines a based memory store using register Rn, assuming it can |
| 562 // be modified by a small literal offset, and optionally, the value | 566 // be modified by a small literal offset, and optionally, the value |
| 563 // defined in register Rm. | 567 // defined in register Rm. |
| 564 class StoreBasedOffsetMemory : public StoreBasedMemoryWithWriteBack { | 568 class StoreBasedOffsetMemory : public StoreBasedMemoryWithWriteBack { |
| 565 public: | 569 public: |
| 566 static const RegBits0To3Interface m; | 570 static const RegBits0To3Interface m; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 NACL_DISALLOW_COPY_AND_ASSIGN(Roadblock); | 700 NACL_DISALLOW_COPY_AND_ASSIGN(Roadblock); |
| 697 }; | 701 }; |
| 698 | 702 |
| 699 // BKPT | 703 // BKPT |
| 700 // We model this mostly so we can use it to recognize literal pools -- untrusted | 704 // We model this mostly so we can use it to recognize literal pools -- untrusted |
| 701 // code isn't expected to use it, but it's not unsafe, and there are cases where | 705 // code isn't expected to use it, but it's not unsafe, and there are cases where |
| 702 // we may generate it. | 706 // we may generate it. |
| 703 class Breakpoint : public Roadblock { | 707 class Breakpoint : public Roadblock { |
| 704 public: | 708 public: |
| 705 Breakpoint() {} | 709 Breakpoint() {} |
| 710 virtual SafetyLevel safety(Instruction i) const; |
| 706 virtual bool is_literal_pool_head(Instruction i) const; | 711 virtual bool is_literal_pool_head(Instruction i) const; |
| 707 | 712 |
| 708 private: | 713 private: |
| 709 NACL_DISALLOW_COPY_AND_ASSIGN(Breakpoint); | 714 NACL_DISALLOW_COPY_AND_ASSIGN(Breakpoint); |
| 710 }; | 715 }; |
| 711 | 716 |
| 712 // Models the Pack/Saturate/Reverse instructions, which | 717 // Models the Pack/Saturate/Reverse instructions, which |
| 713 // - Write a register identified by 15:12, | 718 // - Write a register identified by 15:12, |
| 714 // - Are not permitted to affect r15, | 719 // - Are not permitted to affect r15, |
| 715 // - Always set flags. | 720 // - Always set flags. |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 virtual RegisterList defs(Instruction i) const; | 1134 virtual RegisterList defs(Instruction i) const; |
| 1130 virtual bool clears_bits(Instruction i, uint32_t mask) const; | 1135 virtual bool clears_bits(Instruction i, uint32_t mask) const; |
| 1131 | 1136 |
| 1132 private: | 1137 private: |
| 1133 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterBitRange); | 1138 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterBitRange); |
| 1134 }; | 1139 }; |
| 1135 | 1140 |
| 1136 } // namespace nacl_arm_dec | 1141 } // namespace nacl_arm_dec |
| 1137 | 1142 |
| 1138 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ | 1143 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ |
| OLD | NEW |