OLD | NEW |
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 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2703 "b.gt 1b \n" | 2703 "b.gt 1b \n" |
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 |
| 2714 void HalfFloatRow_NEON(const uint16* src, uint16* dst, float scale, int width) { |
| 2715 asm volatile ( |
| 2716 "1: \n" |
| 2717 MEMACCESS(0) |
| 2718 "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts |
| 2719 "subs %w2, %w2, #8 \n" // 8 pixels per loop |
| 2720 "uxtl v2.4s, v1.4h \n" // 8 int's |
| 2721 "uxtl2 v1.4s, v1.8h \n" |
| 2722 "scvtf v2.4s, v2.4s \n" // 8 floats |
| 2723 "scvtf v1.4s, v1.4s \n" |
| 2724 "fmul v2.4s, v2.4s, %3.s[0] \n" // adjust exponent |
| 2725 "fmul v1.4s, v1.4s, %3.s[0] \n" |
| 2726 "uqshrn v4.4h, v2.4s, #13 \n" // isolate halffloat |
| 2727 "uqshrn2 v4.8h, v1.4s, #13 \n" |
| 2728 MEMACCESS(1) |
| 2729 "st1 {v4.16b}, [%1], #16 \n" // store 8 shorts |
| 2730 "b.gt 1b \n" |
| 2731 : "+r"(src), // %0 |
| 2732 "+r"(dst), // %1 |
| 2733 "+r"(width) // %2 |
| 2734 : "w"(scale * 1.9259299444e-34f) // %3 |
| 2735 : "cc", "memory", "v1", "v2", "v4" |
| 2736 ); |
| 2737 } |
| 2738 |
2713 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) | 2739 #endif // !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) |
2714 | 2740 |
2715 #ifdef __cplusplus | 2741 #ifdef __cplusplus |
2716 } // extern "C" | 2742 } // extern "C" |
2717 } // namespace libyuv | 2743 } // namespace libyuv |
2718 #endif | 2744 #endif |
OLD | NEW |