From 50bfd8fc089c96ea0451fd5a10bae35faf0752b1 Mon Sep 17 00:00:00 2001 From: George Steed Date: Thu, 13 Aug 2026 18:55:19 +0100 Subject: [PATCH] AArch64: Avoid INCP in {YUY2,UYVY}ToUVRow_SVE2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The INCP instructions are particularly slow on some CPUs and in this case can be replaced by a simple ADD instruction, so use that instead. Reduction in time taken relative to the existing SVE2 code for {YUY2,UYVY}ToUVRow_SVE2: Cortex-A510: −12.1% Lumex C1-Nano: 0.0% Cortex-A720: 0.0% Lumex C1-Pro: 0.0% Cortex-X4: −20.9% Lumex C1-Ultra: −20.3% Bug: 546962730 Change-Id: Iea3d75f7b70fe8a29f12afdd877ac02d43e49f04 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/8252282 Reviewed-by: Frank Barchard Reviewed-by: Wan-Teh Chang Commit-Queue: Wan-Teh Chang --- source/row_sve.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/row_sve.cc b/source/row_sve.cc index 75f07aa2c..4aa66b1b2 100644 --- a/source/row_sve.cc +++ b/source/row_sve.cc @@ -1433,8 +1433,8 @@ void YUY2ToUVRow_SVE2(const uint8_t* src_yuy2, "subs %w[width], %w[width], %w[vl] \n" "st1b {z0.b}, p1, [%[dst_u]] \n" "st1b {z2.b}, p1, [%[dst_v]] \n" - "incp %[dst_u], p1.b \n" - "incp %[dst_v], p1.b \n" + "add %[dst_u], %[dst_u], %x[vl_half] \n" + "add %[dst_v], %[dst_v], %x[vl_half] \n" "b.ge 1b \n" "2: \n" @@ -1497,8 +1497,8 @@ void UYVYToUVRow_SVE2(const uint8_t* src_uyvy, "subs %w[width], %w[width], %w[vl] \n" "st1b {z1.b}, p1, [%[dst_u]] \n" "st1b {z2.b}, p1, [%[dst_v]] \n" - "incp %[dst_u], p1.b \n" - "incp %[dst_v], p1.b \n" + "add %[dst_u], %[dst_u], %x[vl_half] \n" + "add %[dst_v], %[dst_v], %x[vl_half] \n" "b.ge 1b \n" "2: \n"