From f61a589bb39a9446951c2690a10b3565ca9c1e10 Mon Sep 17 00:00:00 2001 From: George Steed Date: Mon, 10 Aug 2026 09:45:16 +0100 Subject: [PATCH] AArch64: Fix {YUY2,UYVY}ToUVRow_SVE2 tail predication The tail LD2B predicate previously used the raw remaining width, however for odd widths this is incorrect. We already calculate the correct halved predicate for the UV store part so just compute the load predicate from that directly. Bug: 546962730 Change-Id: I59654208ea48eb5bcc6261a63cb90abae58c1668 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8252280 Reviewed-by: Frank Barchard Commit-Queue: Wan-Teh Chang Reviewed-by: Wan-Teh Chang --- include/libyuv/row.h | 4 ++-- source/row_sve.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libyuv/row.h b/include/libyuv/row.h index 1c6208760..43f0b3273 100644 --- a/include/libyuv/row.h +++ b/include/libyuv/row.h @@ -630,10 +630,10 @@ extern "C" { #define HAS_RGB24TOARGBROW_SVE2 #define HAS_SPLITUVROW_SVE2 #define HAS_UYVYTOARGBROW_SVE2 -// #define HAS_UYVYTOUVROW_SVE2 // Disabled: Bug 546962730 +#define HAS_UYVYTOUVROW_SVE2 #define HAS_UYVYTOYROW_SVE2 #define HAS_YUY2TOARGBROW_SVE2 -// #define HAS_YUY2TOUVROW_SVE2 // Disabled: Bug 546962730 +#define HAS_YUY2TOUVROW_SVE2 #define HAS_YUY2TOYROW_SVE2 #endif diff --git a/source/row_sve.cc b/source/row_sve.cc index e6e2d1d4a..75f07aa2c 100644 --- a/source/row_sve.cc +++ b/source/row_sve.cc @@ -1441,10 +1441,10 @@ void YUY2ToUVRow_SVE2(const uint8_t* src_yuy2, "adds %w[width], %w[width], %w[vl] \n" "b.eq 99f \n" - "whilelt p0.b, wzr, %w[width] \n" "add %w[width_half], %w[width], #1 \n" "lsr %w[width_half], %w[width_half], #1 \n" "whilelt p1.b, wzr, %w[width_half] \n" + "zip1 p0.b, p1.b, p1.b \n" "ld2b {z0.b, z1.b}, p0/z, [%[src_yuy2]] \n" "ld2b {z4.b, z5.b}, p0/z, [%[src_yuy2_1]] \n" "urhadd z1.b, p0/m, z1.b, z5.b \n" @@ -1505,10 +1505,10 @@ void UYVYToUVRow_SVE2(const uint8_t* src_uyvy, "adds %w[width], %w[width], %w[vl] \n" "b.eq 99f \n" - "whilelt p0.b, wzr, %w[width] \n" "add %w[width_half], %w[width], #1 \n" "lsr %w[width_half], %w[width_half], #1 \n" "whilelt p1.b, wzr, %w[width_half] \n" + "zip1 p0.b, p1.b, p1.b \n" "ld2b {z0.b, z1.b}, p0/z, [%[src_uyvy]] \n" "ld2b {z4.b, z5.b}, p0/z, [%[src_uyvy_1]] \n" "urhadd z0.b, p0/m, z0.b, z4.b \n"