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

Side by Side Diff: source/row_neon64.cc

Issue 2430313008: scale by 1 for neon implemented (Closed)
Patch Set: one allocations for halffloat test Created 4 years, 2 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/row_gcc.cc ('k') | unit_test/planar_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 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 2693 matching lines...) Expand 10 before | Expand all | Expand 10 after
2704 : "+r"(src_y0), // %0 2704 : "+r"(src_y0), // %0
2705 "+r"(src_y1), // %1 2705 "+r"(src_y1), // %1
2706 "+r"(dst_sobely), // %2 2706 "+r"(dst_sobely), // %2
2707 "+r"(width) // %3 2707 "+r"(width) // %3
2708 : "r"(1LL), // %4 2708 : "r"(1LL), // %4
2709 "r"(6LL) // %5 2709 "r"(6LL) // %5
2710 : "cc", "memory", "v0", "v1", "v2", "v3" // Clobber List 2710 : "cc", "memory", "v0", "v1", "v2", "v3" // Clobber List
2711 ); 2711 );
2712 } 2712 }
2713 2713
2714
2715 void HalfFloat1Row_NEON(const uint16* src, uint16* dst, float, int width) {
2716 asm volatile (
2717 "1: \n"
2718 MEMACCESS(0)
2719 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts
2720 "subs %w2, %w2, #8 \n" // 8 pixels per loop
2721 "uxtl v2.4s, v1.4h \n" // 8 int's
2722 "uxtl2 v1.4s, v1.8h \n"
2723 "scvtf v2.4s, v2.4s \n" // 8 floats
2724 "scvtf v1.4s, v1.4s \n"
2725 "fcvtn v4.4h, v2.4s \n" // 8 floatsgit
2726 "fcvtn2 v4.8h, v1.4s \n"
2727 MEMACCESS(1)
2728 "st1 {v4.16b}, [%1], #16 \n" // store 8 shorts
2729 "b.gt 1b \n"
2730 : "+r"(src), // %0
2731 "+r"(dst), // %1
2732 "+r"(width) // %2
2733 :
2734 : "cc", "memory", "v1", "v2", "v4"
2735 );
2736 }
2737
2738 void HalfFloatRow_NEON2(const uint16* src, uint16* dst, float scale, int width) {
2739 asm volatile (
2740 "1: \n"
2741 MEMACCESS(0)
2742 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts
2743 "subs %w2, %w2, #8 \n" // 8 pixels per loop
2744 "uxtl v2.4s, v1.4h \n" // 8 int's
2745 "uxtl2 v1.4s, v1.8h \n"
2746 "scvtf v2.4s, v2.4s \n" // 8 floats
2747 "scvtf v1.4s, v1.4s \n"
2748 "fmul v2.4s, v2.4s, %3.s[0] \n" // adjust exponent
2749 "fmul v1.4s, v1.4s, %3.s[0] \n"
2750 "uqshrn v4.4h, v2.4s, #13 \n" // isolate halffloat
2751 "uqshrn2 v4.8h, v1.4s, #13 \n"
2752 MEMACCESS(1)
2753 "st1 {v4.16b}, [%1], #16 \n" // store 8 shorts
2754 "b.gt 1b \n"
2755 : "+r"(src), // %0
2756 "+r"(dst), // %1
2757 "+r"(width) // %2
2758 : "w"(scale * 1.9259299444e-34f) // %3
2759 : "cc", "memory", "v1", "v2", "v4"
2760 );
2761 }
2762
2714 void HalfFloatRow_NEON(const uint16* src, uint16* dst, float scale, int width) { 2763 void HalfFloatRow_NEON(const uint16* src, uint16* dst, float scale, int width) {
2715 asm volatile ( 2764 asm volatile (
2716 "1: \n" 2765 "1: \n"
2717 MEMACCESS(0) 2766 MEMACCESS(0)
2718 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts 2767 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts
2719 "subs %w2, %w2, #8 \n" // 8 pixels per loop 2768 "subs %w2, %w2, #8 \n" // 8 pixels per loop
2720 "uxtl v2.4s, v1.4h \n" // 8 int's 2769 "uxtl v2.4s, v1.4h \n" // 8 int's
2721 "uxtl2 v1.4s, v1.8h \n" 2770 "uxtl2 v1.4s, v1.8h \n"
2722 "scvtf v2.4s, v2.4s \n" // 8 floats 2771 "scvtf v2.4s, v2.4s \n" // 8 floats
2723 "scvtf v1.4s, v1.4s \n" 2772 "scvtf v1.4s, v1.4s \n"
(...skipping 11 matching lines...) Expand all
2735 : "cc", "memory", "v1", "v2", "v4" 2784 : "cc", "memory", "v1", "v2", "v4"
2736 ); 2785 );
2737 } 2786 }
2738 2787
2739 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) 2788 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__)
2740 2789
2741 #ifdef __cplusplus 2790 #ifdef __cplusplus
2742 } // extern "C" 2791 } // extern "C"
2743 } // namespace libyuv 2792 } // namespace libyuv
2744 #endif 2793 #endif
OLDNEW
« no previous file with comments | « source/row_gcc.cc ('k') | unit_test/planar_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698