Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
c610a3b0
Commit
c610a3b0
authored
11 years ago
by
James Zern
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Add neon register state check for unit test."
parents
7a7db0f0
fdee7623
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
nextgen
nextgenv2
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/register_state_check.h
+59
-4
test/register_state_check.h
with
59 additions
and
4 deletions
test/register_state_check.h
+
59
−
4
View file @
c610a3b0
...
@@ -11,14 +11,15 @@
...
@@ -11,14 +11,15 @@
#ifndef TEST_REGISTER_STATE_CHECK_H_
#ifndef TEST_REGISTER_STATE_CHECK_H_
#define TEST_REGISTER_STATE_CHECK_H_
#define TEST_REGISTER_STATE_CHECK_H_
#ifdef _WIN64
#include
"third_party/googletest/src/include/gtest/gtest.h"
#include
"./vpx_config.h"
#if defined(_WIN64)
#define _WIN32_LEAN_AND_MEAN
#define _WIN32_LEAN_AND_MEAN
#include
<windows.h>
#include
<windows.h>
#include
<winnt.h>
#include
<winnt.h>
#include
"third_party/googletest/src/include/gtest/gtest.h"
namespace
testing
{
namespace
testing
{
namespace
internal
{
namespace
internal
{
...
@@ -81,7 +82,61 @@ class RegisterStateCheck {
...
@@ -81,7 +82,61 @@ class RegisterStateCheck {
}
// namespace libvpx_test
}
// namespace libvpx_test
#else // !_WIN64
#elif defined(CONFIG_SHARED) && defined(HAVE_NEON) \
&& !CONFIG_SHARED && HAVE_NEON
#include
"vpx/vpx_integer.h"
extern
"C"
{
// Save the d8-d15 registers into store.
void
vp9_push_neon
(
int64_t
*
store
);
}
namespace
libvpx_test
{
// Compares the state of d8-d15 at construction with their state at
// destruction. These registers should be preserved by the callee on
// arm platform.
// Usage:
// {
// RegisterStateCheck reg_check;
// FunctionToVerify();
// }
class
RegisterStateCheck
{
public:
RegisterStateCheck
()
{
initialized_
=
StoreRegisters
(
pre_store_
);
}
~
RegisterStateCheck
()
{
EXPECT_TRUE
(
Check
());
}
private
:
static
bool
StoreRegisters
(
int64_t
store
[
8
])
{
vp9_push_neon
(
store
);
return
true
;
}
// Compares the register state. Returns true if the states match.
bool
Check
()
const
{
if
(
!
initialized_
)
return
false
;
int64_t
post_store
[
8
];
vp9_push_neon
(
post_store
);
for
(
int
i
=
0
;
i
<
8
;
++
i
)
{
EXPECT_EQ
(
pre_store_
[
i
],
post_store
[
i
])
<<
"d"
<<
i
+
8
<<
" has been modified"
;
}
return
!
testing
::
Test
::
HasNonfatalFailure
();
}
bool
initialized_
;
int64_t
pre_store_
[
8
];
};
#define REGISTER_STATE_CHECK(statement) do { \
libvpx_test::RegisterStateCheck reg_check; \
statement; \
} while (false)
}
// namespace libvpx_test
#else
namespace
libvpx_test
{
namespace
libvpx_test
{
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets