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_VS_BASELINE_H_ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_VS_BASELINE_H_ |
8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_VS_BASELINE_H_ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_VS_BASELINE_H_ |
9 | 9 |
10 #include "native_client/src/trusted/validator_arm/decoder_tester.h" | 10 #include "native_client/src/trusted/validator_arm/decoder_tester.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 virtual void ProcessMatch(); | 35 virtual void ProcessMatch(); |
36 virtual const NamedClassDecoder& ExpectedDecoder() const; | 36 virtual const NamedClassDecoder& ExpectedDecoder() const; |
37 virtual bool ApplySanityChecks( | 37 virtual bool ApplySanityChecks( |
38 nacl_arm_dec::Instruction inst, | 38 nacl_arm_dec::Instruction inst, |
39 const NamedClassDecoder& decoder); | 39 const NamedClassDecoder& decoder); |
40 | 40 |
41 protected: | 41 protected: |
42 // Note: we quit early if the safety values are not MAY_BE_SAFE | 42 // Note: we quit early if the safety values are not MAY_BE_SAFE |
43 bool MayBeSafe(); | 43 bool MayBeSafe(); |
44 | 44 |
45 // Checks that each corresponding ClassDecoder virtual matches. | 45 // Applies Sanity checks, as defined by the baseline tester. |
| 46 // Returns true if the sanity checks pass. |
| 47 virtual bool DoApplySanityChecks(); |
| 48 |
46 void CheckDefs(); | 49 void CheckDefs(); |
47 void CheckBaseAddressRegisterWritebackSmallImmediate(); | 50 void CheckBaseAddressRegisterWritebackSmallImmediate(); |
48 void CheckBaseAddressRegister(); | 51 void CheckBaseAddressRegister(); |
49 void CheckIsLiteralLoad(); | 52 void CheckIsLiteralLoad(); |
50 void CheckBranchTargetRegister(); | 53 void CheckBranchTargetRegister(); |
51 void CheckIsRelativeBranch(); | 54 void CheckIsRelativeBranch(); |
52 void CheckBranchTargetOffset(); | 55 void CheckBranchTargetOffset(); |
53 void CheckIsLiteralPoolHead(); | 56 void CheckIsLiteralPoolHead(); |
54 void CheckClearsBits(); | 57 void CheckClearsBits(); |
55 void CheckSetsZIfBitsClear(); | 58 void CheckSetsZIfBitsClear(); |
56 | 59 |
57 // Holds the arguments to use in comparisons. | 60 // Holds the arguments to use in comparisons. |
58 const NamedClassDecoder& actual_; | 61 const NamedClassDecoder& actual_; |
59 const NamedClassDecoder& baseline_; | 62 const NamedClassDecoder& baseline_; |
60 DecoderTester& baseline_tester_; | 63 DecoderTester& baseline_tester_; |
61 | 64 |
62 // These are added to cut down virtual redirection and | 65 // These are added to cut down virtual redirection and |
63 // speed up tests by about 33%. | 66 // speed up tests by about 33%. |
64 const nacl_arm_dec::ClassDecoder& actual_decoder_; | 67 const nacl_arm_dec::ClassDecoder& actual_decoder_; |
65 const nacl_arm_dec::ClassDecoder& baseline_decoder_; | 68 const nacl_arm_dec::ClassDecoder& baseline_decoder_; |
66 | 69 |
67 private: | 70 private: |
68 NACL_DISALLOW_COPY_AND_ASSIGN(ActualVsBaselineTester); | 71 NACL_DISALLOW_COPY_AND_ASSIGN(ActualVsBaselineTester); |
69 }; | 72 }; |
70 | 73 |
71 } // namespace nacl_arm_test | 74 } // namespace nacl_arm_test |
72 | 75 |
73 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_VS_BASELINE_H_ | 76 #endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_ARM_ACTUAL_VS_BASELINE_H_ |
OLD | NEW |