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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 // Methods for class. | 1096 // Methods for class. |
1097 Unary1RegisterUse() {} | 1097 Unary1RegisterUse() {} |
1098 virtual SafetyLevel safety(Instruction i) const; | 1098 virtual SafetyLevel safety(Instruction i) const; |
1099 virtual RegisterList defs(Instruction i) const; | 1099 virtual RegisterList defs(Instruction i) const; |
1100 virtual RegisterList uses(Instruction i) const; | 1100 virtual RegisterList uses(Instruction i) const; |
1101 | 1101 |
1102 private: | 1102 private: |
1103 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterUse); | 1103 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterUse); |
1104 }; | 1104 }; |
1105 | 1105 |
1106 // Models a 1-register unary operation with two immediate 5 values | |
1107 // defining a bit range. | |
1108 // Op<c> Rd, #lsb, #width | |
1109 // +--------+--------------+----------+--------+----------+--------------+ | |
1110 // |31302928|27262524232221|2019181716|15141312|1110 9 8 7| 6 5 4 3 2 1 0| | |
1111 // +--------+--------------+----------+--------+----------+--------------+ | |
1112 // | cond | | msb | Rd | lsb | | | |
1113 // +--------+--------------+----------+--------+----------+--------------+ | |
1114 // Definitions | |
1115 // Rd = The destination register. | |
1116 // lsb = The least significant bit to be modified. | |
1117 // msb = lsb + width - 1 - The most significant bit to be modified | |
1118 // width = msb - lsb + 1 - The number of bits to be modified. | |
1119 // | |
1120 // If Rd is R15 or msbit < lsbit, the instruction is unpredictable. | |
1121 // NaCl disallows writing to PC to cause a jump. | |
1122 // Note: Currently, only implements bfc. | |
1123 class Unary1RegisterBitRangeMsbGeLsb : public ClassDecoder { | |
1124 public: | |
1125 // Interface for components of the instruction. | |
1126 static const Imm5Bits7To11Interface lsb; | |
1127 static const RegBits12To15Interface d; | |
1128 static const Imm5Bits16To20Interface msb; | |
1129 static const ConditionBits28To31Interface cond; | |
1130 | |
1131 // Methods for class. | |
1132 Unary1RegisterBitRangeMsbGeLsb() : ClassDecoder() {} | |
1133 virtual SafetyLevel safety(Instruction i) const; | |
1134 virtual RegisterList defs(Instruction i) const; | |
1135 | |
1136 private: | |
1137 NACL_DISALLOW_COPY_AND_ASSIGN(Unary1RegisterBitRangeMsbGeLsb); | |
1138 }; | |
1139 | |
1140 } // namespace nacl_arm_dec | 1106 } // namespace nacl_arm_dec |
1141 | 1107 |
1142 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ | 1108 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_CLASSES_H_ |
OLD | NEW |