summaryrefslogtreecommitdiff
path: root/third_party/libyuv/source/compare_neon.cc
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2014-08-22 10:31:01 -0700
committerJames Zern <jzern@google.com>2014-08-22 10:31:01 -0700
commitb644eb9f446c89a25b26a19882f394b6f3711d64 (patch)
tree3aa7e78491f41bc62fb5b2a252ee1324fd0a4e24 /third_party/libyuv/source/compare_neon.cc
parent812506b80c4dfe6600038933a47ccef6ec3faa94 (diff)
downloadlibvpx-b644eb9f446c89a25b26a19882f394b6f3711d64.tar
libvpx-b644eb9f446c89a25b26a19882f394b6f3711d64.tar.gz
libvpx-b644eb9f446c89a25b26a19882f394b6f3711d64.tar.bz2
libvpx-b644eb9f446c89a25b26a19882f394b6f3711d64.zip
libyuv: update to r1060
picks up some lint, build fixes Change-Id: I0efb19385afa4ea3073a53e2b8334e57f245eea0
Diffstat (limited to 'third_party/libyuv/source/compare_neon.cc')
-rw-r--r--third_party/libyuv/source/compare_neon.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/third_party/libyuv/source/compare_neon.cc b/third_party/libyuv/source/compare_neon.cc
index 5e7b8e443..55052c0ee 100644
--- a/third_party/libyuv/source/compare_neon.cc
+++ b/third_party/libyuv/source/compare_neon.cc
@@ -56,6 +56,45 @@ uint32 SumSquareError_NEON(const uint8* src_a, const uint8* src_b, int count) {
return sse;
}
+#elif !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__)
+
+uint32 SumSquareError_NEON(const uint8* src_a, const uint8* src_b, int count) {
+ volatile uint32 sse;
+ asm volatile (
+ "eor v16.16b, v16.16b, v16.16b \n"
+ "eor v18.16b, v18.16b, v18.16b \n"
+ "eor v17.16b, v17.16b, v17.16b \n"
+ "eor v19.16b, v19.16b, v19.16b \n"
+
+ ".p2align 2 \n"
+ "1: \n"
+ MEMACCESS(0)
+ "ld1 {v0.16b}, [%0], #16 \n"
+ MEMACCESS(1)
+ "ld1 {v1.16b}, [%1], #16 \n"
+ "subs %2, %2, #16 \n"
+ "usubl v2.8h, v0.8b, v1.8b \n"
+ "usubl2 v3.8h, v0.16b, v1.16b \n"
+ "smlal v16.4s, v2.4h, v2.4h \n"
+ "smlal v17.4s, v3.4h, v3.4h \n"
+ "smlal2 v18.4s, v2.8h, v2.8h \n"
+ "smlal2 v19.4s, v3.8h, v3.8h \n"
+ "bgt 1b \n"
+
+ "add v16.4s, v16.4s, v17.4s \n"
+ "add v18.4s, v18.4s, v19.4s \n"
+ "add v19.4s, v16.4s, v18.4s \n"
+ "addv s0, v19.4s \n"
+ "fmov %w3, s0 \n"
+ : "+r"(src_a),
+ "+r"(src_b),
+ "+r"(count),
+ "=r"(sse)
+ :
+ : "cc", "v0", "v1", "v2", "v3", "v16", "v17", "v18", "v19");
+ return sse;
+}
+
#endif // __ARM_NEON__
#ifdef __cplusplus