| 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 // Defines decoder testers for decoder classes. | 7 // Defines decoder testers for decoder classes. |
| 8 | 8 |
| 9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_INST_CLASSES_TESTERS_H_ | 9 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_INST_CLASSES_TESTERS_H_ |
| 10 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_INST_CLASSES_TESTERS_H_ | 10 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_INST_CLASSES_TESTERS_H_ |
| 11 | 11 |
| 12 #ifndef NACL_TRUSTED_BUT_NOT_TCB |
| 13 #error This file is not meant for use in the TCB |
| 14 #endif |
| 15 |
| 16 #include "native_client/src/trusted/validator_arm/gen/arm32_decode_named_classes
.h" |
| 12 #include "native_client/src/trusted/validator_arm/decoder_tester.h" | 17 #include "native_client/src/trusted/validator_arm/decoder_tester.h" |
| 13 | 18 |
| 14 namespace nacl_arm_test { | 19 namespace nacl_arm_test { |
| 15 | 20 |
| 16 // Implements a decoder tester for decoder Binary4RegisterShiftedOp. | 21 // Implements a decoder tester for decoder Binary4RegisterShiftedOp. |
| 17 // Op(S)<c> <Rd>, <Rn>, <Rm>, <type> <Rs> | 22 // Op(S)<c> <Rd>, <Rn>, <Rm>, <type> <Rs> |
| 18 // +--------+--------------+--+--------+--------+--------+--+----+--+--------+ | 23 // +--------+--------------+--+--------+--------+--------+--+----+--+--------+ |
| 19 // |31302928|27262524232221|20|19181716|15141312|1110 9 8| 7| 6 5| 4| 3 2 1 0| | 24 // |31302928|27262524232221|20|19181716|15141312|1110 9 8| 7| 6 5| 4| 3 2 1 0| |
| 20 // +--------+--------------+--+--------+--------+--------+--+----+--+--------+ | 25 // +--------+--------------+--+--------+--------+--------+--+----+--+--------+ |
| 21 // | cond | | S| Rn | Rd | Rs | |type| | Rm | | 26 // | cond | | S| Rn | Rd | Rs | |type| | Rm | |
| 22 // +--------+--------------+--+--------+--------+--------+--+----+--+--------+ | 27 // +--------+--------------+--+--------+--------+--------+--+----+--+--------+ |
| 23 // Note: if Rn, Rd, Rs, or Rm is R15, the instruction is unpredictable. | |
| 24 // Definitions: | 28 // Definitions: |
| 25 // Rd - The destination register. | 29 // Rd - The destination register. |
| 26 // Rn - The first operand register. | 30 // Rn - The first operand register. |
| 27 // Rm - The register that is shifted and used as the second operand. | 31 // Rm - The register that is shifted and used as the second operand. |
| 28 // Rs - The regsiter whose bottom byte contains the amount to shift by. | 32 // Rs - The regsiter whose bottom byte contains the amount to shift by. |
| 29 // type - The type of shift to apply (not modeled). | 33 // type - The type of shift to apply (not modeled). |
| 30 // S - Defines if the flags regsiter is updated. | 34 // S - Defines if the flags regsiter is updated. |
| 31 class Binary4RegisterShiftedOpTester : public Arm32DecoderTester { | 35 class Binary4RegisterShiftedOpTester : public Arm32DecoderTester { |
| 32 public: | 36 public: |
| 33 explicit Binary4RegisterShiftedOpTester(); | 37 explicit Binary4RegisterShiftedOpTester(); |
| 34 virtual void ApplySanityChecks(nacl_arm_dec::Instruction inst, | 38 virtual void ApplySanityChecks( |
| 35 const nacl_arm_dec::ClassDecoder& decoder); | 39 nacl_arm_dec::Instruction inst, |
| 40 const NamedClassDecoder& decoder); |
| 41 protected: |
| 42 explicit Binary4RegisterShiftedOpTester( |
| 43 const NamedBinary4RegisterShiftedOp &decoder); |
| 44 }; |
| 45 |
| 46 // Implements a decoder tester for decoder Binary4RegisterShiftedOp |
| 47 // with the constraint that if Rn, Rd, Rs, or Rm is R15, the instruction |
| 48 // is unpredictable. |
| 49 class Binary4RegisterShiftedOpTesterRegsNotPc |
| 50 : public Binary4RegisterShiftedOpTester { |
| 51 public: |
| 52 explicit Binary4RegisterShiftedOpTesterRegsNotPc(); |
| 53 virtual void ApplySanityChecks( |
| 54 nacl_arm_dec::Instruction inst, |
| 55 const NamedClassDecoder& decoder); |
| 56 protected: |
| 57 explicit Binary4RegisterShiftedOpTesterRegsNotPc( |
| 58 const NamedBinary4RegisterShiftedOp &decoder); |
| 36 }; | 59 }; |
| 37 | 60 |
| 38 } // namespace | 61 } // namespace |
| 39 | 62 |
| 40 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_INST_CLASSES_TESTERS_H_ | 63 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_INST_CLASSES_TESTERS_H_ |
| OLD | NEW |