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 <fbarchard@google.com>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Reviewed-by: Wan-Teh Chang <wtc@google.com>
This commit is contained in:
George Steed 2026-08-10 09:45:16 +01:00 committed by libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com
parent c8e8b70460
commit f61a589bb3
2 changed files with 4 additions and 4 deletions

View File

@ -630,10 +630,10 @@ extern "C" {
#define HAS_RGB24TOARGBROW_SVE2 #define HAS_RGB24TOARGBROW_SVE2
#define HAS_SPLITUVROW_SVE2 #define HAS_SPLITUVROW_SVE2
#define HAS_UYVYTOARGBROW_SVE2 #define HAS_UYVYTOARGBROW_SVE2
// #define HAS_UYVYTOUVROW_SVE2 // Disabled: Bug 546962730 #define HAS_UYVYTOUVROW_SVE2
#define HAS_UYVYTOYROW_SVE2 #define HAS_UYVYTOYROW_SVE2
#define HAS_YUY2TOARGBROW_SVE2 #define HAS_YUY2TOARGBROW_SVE2
// #define HAS_YUY2TOUVROW_SVE2 // Disabled: Bug 546962730 #define HAS_YUY2TOUVROW_SVE2
#define HAS_YUY2TOYROW_SVE2 #define HAS_YUY2TOYROW_SVE2
#endif #endif

View File

@ -1441,10 +1441,10 @@ void YUY2ToUVRow_SVE2(const uint8_t* src_yuy2,
"adds %w[width], %w[width], %w[vl] \n" "adds %w[width], %w[width], %w[vl] \n"
"b.eq 99f \n" "b.eq 99f \n"
"whilelt p0.b, wzr, %w[width] \n"
"add %w[width_half], %w[width], #1 \n" "add %w[width_half], %w[width], #1 \n"
"lsr %w[width_half], %w[width_half], #1 \n" "lsr %w[width_half], %w[width_half], #1 \n"
"whilelt p1.b, wzr, %w[width_half] \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 {z0.b, z1.b}, p0/z, [%[src_yuy2]] \n"
"ld2b {z4.b, z5.b}, p0/z, [%[src_yuy2_1]] \n" "ld2b {z4.b, z5.b}, p0/z, [%[src_yuy2_1]] \n"
"urhadd z1.b, p0/m, z1.b, z5.b \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" "adds %w[width], %w[width], %w[vl] \n"
"b.eq 99f \n" "b.eq 99f \n"
"whilelt p0.b, wzr, %w[width] \n"
"add %w[width_half], %w[width], #1 \n" "add %w[width_half], %w[width], #1 \n"
"lsr %w[width_half], %w[width_half], #1 \n" "lsr %w[width_half], %w[width_half], #1 \n"
"whilelt p1.b, wzr, %w[width_half] \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 {z0.b, z1.b}, p0/z, [%[src_uyvy]] \n"
"ld2b {z4.b, z5.b}, p0/z, [%[src_uyvy_1]] \n" "ld2b {z4.b, z5.b}, p0/z, [%[src_uyvy_1]] \n"
"urhadd z0.b, p0/m, z0.b, z4.b \n" "urhadd z0.b, p0/m, z0.b, z4.b \n"