Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: source/libvpx/test/register_state_check.h

Issue 1302353004: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/libvpx/test/partial_idct_test.cc ('k') | source/libvpx/test/superframe_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « source/libvpx/test/partial_idct_test.cc ('k') | source/libvpx/test/superframe_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698