OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 statement; \ | 89 statement; \ |
90 } while (false) | 90 } while (false) |
91 | 91 |
92 } // namespace libvpx_test | 92 } // namespace libvpx_test |
93 | 93 |
94 #elif defined(CONFIG_SHARED) && defined(HAVE_NEON_ASM) && defined(CONFIG_VP9) \ | 94 #elif defined(CONFIG_SHARED) && defined(HAVE_NEON_ASM) && defined(CONFIG_VP9) \ |
95 && !CONFIG_SHARED && HAVE_NEON_ASM && CONFIG_VP9 | 95 && !CONFIG_SHARED && HAVE_NEON_ASM && CONFIG_VP9 |
96 | 96 |
97 extern "C" { | 97 extern "C" { |
98 // Save the d8-d15 registers into store. | 98 // Save the d8-d15 registers into store. |
99 void vp9_push_neon(int64_t *store); | 99 void vpx_push_neon(int64_t *store); |
100 } | 100 } |
101 | 101 |
102 namespace libvpx_test { | 102 namespace libvpx_test { |
103 | 103 |
104 // Compares the state of d8-d15 at construction with their state at | 104 // Compares the state of d8-d15 at construction with their state at |
105 // destruction. These registers should be preserved by the callee on | 105 // destruction. These registers should be preserved by the callee on |
106 // arm platform. | 106 // arm platform. |
107 class RegisterStateCheck { | 107 class RegisterStateCheck { |
108 public: | 108 public: |
109 RegisterStateCheck() { initialized_ = StoreRegisters(pre_store_); } | 109 RegisterStateCheck() { initialized_ = StoreRegisters(pre_store_); } |
110 ~RegisterStateCheck() { EXPECT_TRUE(Check()); } | 110 ~RegisterStateCheck() { EXPECT_TRUE(Check()); } |
111 | 111 |
112 private: | 112 private: |
113 static bool StoreRegisters(int64_t store[8]) { | 113 static bool StoreRegisters(int64_t store[8]) { |
114 vp9_push_neon(store); | 114 vpx_push_neon(store); |
115 return true; | 115 return true; |
116 } | 116 } |
117 | 117 |
118 // Compares the register state. Returns true if the states match. | 118 // Compares the register state. Returns true if the states match. |
119 bool Check() const { | 119 bool Check() const { |
120 if (!initialized_) return false; | 120 if (!initialized_) return false; |
121 int64_t post_store[8]; | 121 int64_t post_store[8]; |
122 vp9_push_neon(post_store); | 122 vpx_push_neon(post_store); |
123 for (int i = 0; i < 8; ++i) { | 123 for (int i = 0; i < 8; ++i) { |
124 EXPECT_EQ(pre_store_[i], post_store[i]) << "d" | 124 EXPECT_EQ(pre_store_[i], post_store[i]) << "d" |
125 << i + 8 << " has been modified"; | 125 << i + 8 << " has been modified"; |
126 } | 126 } |
127 return !testing::Test::HasNonfatalFailure(); | 127 return !testing::Test::HasNonfatalFailure(); |
128 } | 128 } |
129 | 129 |
130 bool initialized_; | 130 bool initialized_; |
131 int64_t pre_store_[8]; | 131 int64_t pre_store_[8]; |
132 }; | 132 }; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 } // namespace libvpx_test | 187 } // namespace libvpx_test |
188 | 188 |
189 #endif // __GNUC__ | 189 #endif // __GNUC__ |
190 #endif // ARCH_X86 || ARCH_X86_64 | 190 #endif // ARCH_X86 || ARCH_X86_64 |
191 | 191 |
192 #ifndef API_REGISTER_STATE_CHECK | 192 #ifndef API_REGISTER_STATE_CHECK |
193 #define API_REGISTER_STATE_CHECK ASM_REGISTER_STATE_CHECK | 193 #define API_REGISTER_STATE_CHECK ASM_REGISTER_STATE_CHECK |
194 #endif | 194 #endif |
195 | 195 |
196 #endif // TEST_REGISTER_STATE_CHECK_H_ | 196 #endif // TEST_REGISTER_STATE_CHECK_H_ |
OLD | NEW |