michael@0: /* michael@0: * Copyright 2012 The LibYuv Project Authors. All rights reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: #include "libyuv/basic_types.h" michael@0: michael@0: #ifdef __cplusplus michael@0: namespace libyuv { michael@0: extern "C" { michael@0: #endif michael@0: michael@0: #if !defined(LIBYUV_DISABLE_NEON) && defined(__ARM_NEON__) michael@0: michael@0: uint32 SumSquareError_NEON(const uint8* src_a, const uint8* src_b, int count) { michael@0: volatile uint32 sse; michael@0: asm volatile ( michael@0: "vmov.u8 q8, #0 \n" michael@0: "vmov.u8 q10, #0 \n" michael@0: "vmov.u8 q9, #0 \n" michael@0: "vmov.u8 q11, #0 \n" michael@0: michael@0: ".p2align 2 \n" michael@0: "1: \n" michael@0: "vld1.8 {q0}, [%0]! \n" michael@0: "vld1.8 {q1}, [%1]! \n" michael@0: "subs %2, %2, #16 \n" michael@0: "vsubl.u8 q2, d0, d2 \n" michael@0: "vsubl.u8 q3, d1, d3 \n" michael@0: "vmlal.s16 q8, d4, d4 \n" michael@0: "vmlal.s16 q9, d6, d6 \n" michael@0: "vmlal.s16 q10, d5, d5 \n" michael@0: "vmlal.s16 q11, d7, d7 \n" michael@0: "bgt 1b \n" michael@0: michael@0: "vadd.u32 q8, q8, q9 \n" michael@0: "vadd.u32 q10, q10, q11 \n" michael@0: "vadd.u32 q11, q8, q10 \n" michael@0: "vpaddl.u32 q1, q11 \n" michael@0: "vadd.u64 d0, d2, d3 \n" michael@0: "vmov.32 %3, d0[0] \n" michael@0: : "+r"(src_a), michael@0: "+r"(src_b), michael@0: "+r"(count), michael@0: "=r"(sse) michael@0: : michael@0: : "memory", "cc", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11"); michael@0: return sse; michael@0: } michael@0: michael@0: #endif // __ARM_NEON__ michael@0: michael@0: #ifdef __cplusplus michael@0: } // extern "C" michael@0: } // namespace libyuv michael@0: #endif