arm: Remove __builtin_arm_uqsub8 usage on string-fza.h

Message ID 20230228182325.3127358-1-adhemerval.zanella@linaro.org
State Committed
Commit 3a4781c16c680a2c5ab4585b4696f781898ab610
Headers
Series arm: Remove __builtin_arm_uqsub8 usage on string-fza.h |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Adhemerval Zanella Netto Feb. 28, 2023, 6:23 p.m. UTC
  The __builtin_arm_uqsub8 is an internal GCC builtin which might change
in future release (the correct way is to include "arm_acle.h" and use
__uqsub8 ()).  Since not all compilers support it, just use the
inline assembler instead.

Checked on armv7a-linux-gnueabihf.
---
 sysdeps/arm/armv6t2/string-fza.h | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Wilco Dijkstra March 1, 2023, 1:47 p.m. UTC | #1
Hi Adhemerval,
 
> The __builtin_arm_uqsub8 is an internal GCC builtin which might change
> in future release (the correct way is to include "arm_acle.h" and use
> __uqsub8 ()).  Since not all compilers support it, just use the
> inline assembler instead.

LGTM.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>


@@ -33,13 +33,9 @@ find_zero_all (op_t x)
   /* Use unsigned saturated subtraction from 1 in each byte.
      That leaves 1 for every byte that was zero.  */
   op_t ones = repeat_bytes (0x01);
-#if __GNUC_PREREQ (10, 0)
-  return __builtin_arm_uqsub8 (ones, x);
-#else
   op_t ret;
   asm ("uqsub8 %0,%1,%2" : "=r"(ret) : "r"(ones), "r"(x));
   return ret;
-#endif
 }

OK
  

Patch

diff --git a/sysdeps/arm/armv6t2/string-fza.h b/sysdeps/arm/armv6t2/string-fza.h
index d85ce86434..fb75011991 100644
--- a/sysdeps/arm/armv6t2/string-fza.h
+++ b/sysdeps/arm/armv6t2/string-fza.h
@@ -33,13 +33,9 @@  find_zero_all (op_t x)
   /* Use unsigned saturated subtraction from 1 in each byte.
      That leaves 1 for every byte that was zero.  */
   op_t ones = repeat_bytes (0x01);
-#if __GNUC_PREREQ (10, 0)
-  return __builtin_arm_uqsub8 (ones, x);
-#else
   op_t ret;
   asm ("uqsub8 %0,%1,%2" : "=r"(ret) : "r"(ones), "r"(x));
   return ret;
-#endif
 }
 
 /* Identify bytes that are equal between X1 and X2.  */