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

Side by Side Diff: source/row_neon64.cc

Issue 2467723002: HalfFloat Neon for ARMv7. (Closed)
Patch Set: bump version Created 4 years, 1 month 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/row_neon.cc ('k') | no next file » | 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 2014 The LibYuv Project Authors. All rights reserved. 2 * Copyright 2014 The LibYuv 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 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2711 ); 2711 );
2712 } 2712 }
2713 2713
2714 void HalfFloat1Row_NEON(const uint16* src, uint16* dst, float, int width) { 2714 void HalfFloat1Row_NEON(const uint16* src, uint16* dst, float, int width) {
2715 asm volatile ( 2715 asm volatile (
2716 "1: \n" 2716 "1: \n"
2717 MEMACCESS(0) 2717 MEMACCESS(0)
2718 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts 2718 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts
2719 "subs %w2, %w2, #8 \n" // 8 pixels per loop 2719 "subs %w2, %w2, #8 \n" // 8 pixels per loop
2720 "uxtl v2.4s, v1.4h \n" // 8 int's 2720 "uxtl v2.4s, v1.4h \n" // 8 int's
2721 "uxtl2 v1.4s, v1.8h \n" 2721 "uxtl2 v3.4s, v1.8h \n"
2722 "scvtf v2.4s, v2.4s \n" // 8 floats 2722 "scvtf v2.4s, v2.4s \n" // 8 floats
2723 "scvtf v1.4s, v1.4s \n" 2723 "scvtf v3.4s, v3.4s \n"
2724 "fcvtn v4.4h, v2.4s \n" // 8 floatsgit 2724 "fcvtn v1.4h, v2.4s \n" // 8 floatsgit
2725 "fcvtn2 v4.8h, v1.4s \n" 2725 "fcvtn2 v1.8h, v3.4s \n"
2726 MEMACCESS(1) 2726 MEMACCESS(1)
2727 "st1 {v4.16b}, [%1], #16 \n" // store 8 shorts 2727 "st1 {v1.16b}, [%1], #16 \n" // store 8 shorts
2728 "b.gt 1b \n" 2728 "b.gt 1b \n"
2729 : "+r"(src), // %0 2729 : "+r"(src), // %0
2730 "+r"(dst), // %1 2730 "+r"(dst), // %1
2731 "+r"(width) // %2 2731 "+r"(width) // %2
2732 : 2732 :
2733 : "cc", "memory", "v1", "v2", "v4" 2733 : "cc", "memory", "v1", "v2", "v3"
2734 ); 2734 );
2735 } 2735 }
2736 2736
2737 void HalfFloatRow_NEON(const uint16* src, uint16* dst, float scale, int width) { 2737 void HalfFloatRow_NEON(const uint16* src, uint16* dst, float scale, int width) {
2738 asm volatile ( 2738 asm volatile (
2739 "1: \n" 2739 "1: \n"
2740 MEMACCESS(0) 2740 MEMACCESS(0)
2741 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts 2741 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts
2742 "subs %w2, %w2, #8 \n" // 8 pixels per loop 2742 "subs %w2, %w2, #8 \n" // 8 pixels per loop
2743 "uxtl v2.4s, v1.4h \n" // 8 int's 2743 "uxtl v2.4s, v1.4h \n" // 8 int's
2744 "uxtl2 v1.4s, v1.8h \n" 2744 "uxtl2 v3.4s, v1.8h \n"
2745 "scvtf v2.4s, v2.4s \n" // 8 floats 2745 "scvtf v2.4s, v2.4s \n" // 8 floats
2746 "scvtf v1.4s, v1.4s \n" 2746 "scvtf v3.4s, v3.4s \n"
2747 "fmul v2.4s, v2.4s, %3.s[0] \n" // adjust exponent 2747 "fmul v2.4s, v2.4s, %3.s[0] \n" // adjust exponent
2748 "fmul v1.4s, v1.4s, %3.s[0] \n" 2748 "fmul v3.4s, v3.4s, %3.s[0] \n"
2749 "uqshrn v4.4h, v2.4s, #13 \n" // isolate halffloat 2749 "uqshrn v1.4h, v2.4s, #13 \n" // isolate halffloat
2750 "uqshrn2 v4.8h, v1.4s, #13 \n" 2750 "uqshrn2 v1.8h, v3.4s, #13 \n"
2751 MEMACCESS(1) 2751 MEMACCESS(1)
2752 "st1 {v4.16b}, [%1], #16 \n" // store 8 shorts 2752 "st1 {v1.16b}, [%1], #16 \n" // store 8 shorts
2753 "b.gt 1b \n" 2753 "b.gt 1b \n"
2754 : "+r"(src), // %0 2754 : "+r"(src), // %0
2755 "+r"(dst), // %1 2755 "+r"(dst), // %1
2756 "+r"(width) // %2 2756 "+r"(width) // %2
2757 : "w"(scale * 1.9259299444e-34f) // %3 2757 : "w"(scale * 1.9259299444e-34f) // %3
2758 : "cc", "memory", "v1", "v2", "v4" 2758 : "cc", "memory", "v1", "v2", "v3"
2759 ); 2759 );
2760 } 2760 }
2761 2761
2762 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) 2762 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__)
2763 2763
2764 #ifdef __cplusplus 2764 #ifdef __cplusplus
2765 } // extern "C" 2765 } // extern "C"
2766 } // namespace libyuv 2766 } // namespace libyuv
2767 #endif 2767 #endif
OLDNEW
« no previous file with comments | « source/row_neon.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698