public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][committed] aarch64: Delete __builtin_aarch64_neg* builtins and their use
@ 2023-04-19  9:32 Kyrylo Tkachov
  0 siblings, 0 replies; only message in thread
From: Kyrylo Tkachov @ 2023-04-19  9:32 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

Hi all,

I don't think we need to keep the __builtin_aarch64_neg* builtins around.
They are only used once in the vnegh_f16 intrinsic in arm_fp16.h and I AFAICT
it was added this way only for the sake of orthogonality in
https://gcc.gnu.org/g:d7f33f07d88984cbe769047e3d07fc21067fbba9
We already use normal "-" negation in the other vneg* intrinsics, so do so here as well.

Bootstrapped and tested on aarch64-none-linux-gnu.
Pushing to trunk.
Thanks,
Kyrill

gcc/ChangeLog:

	* config/aarch64/aarch64-simd-builtins.def (neg): Delete builtins
	definition.
	* config/aarch64/arm_fp16.h (vnegh_f16): Reimplement using normal negation.

[-- Attachment #2: neg-remove.patch --]
[-- Type: application/octet-stream, Size: 1152 bytes --]

diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def b/gcc/config/aarch64/aarch64-simd-builtins.def
index ea5fd33a28ab9d29bd1a7d3af5cdf27d8ae93d9e..1beaa08c1e7c94bc13a64865ddb677345534699c 100644
--- a/gcc/config/aarch64/aarch64-simd-builtins.def
+++ b/gcc/config/aarch64/aarch64-simd-builtins.def
@@ -848,9 +848,6 @@
   BUILTIN_VHSDF_HSDF (BINOP_USS, cmle, 0, FP)
   BUILTIN_VHSDF_HSDF (BINOP_USS, cmlt, 0, FP)
 
-  /* Implemented by neg<mode>2.  */
-  BUILTIN_VHSDF_HSDF (UNOP, neg, 2, ALL)
-
   /* Implemented by aarch64_fac<optab><mode>.  */
   BUILTIN_VHSDF_HSDF (BINOP_USS, faclt, 0, FP)
   BUILTIN_VHSDF_HSDF (BINOP_USS, facle, 0, FP)
diff --git a/gcc/config/aarch64/arm_fp16.h b/gcc/config/aarch64/arm_fp16.h
index a8fa4dbbdfe1bab4aa604bb311ef66d4e1de18ac..350f8cc33d99e16137e9d70fa7958b10924dc67f 100644
--- a/gcc/config/aarch64/arm_fp16.h
+++ b/gcc/config/aarch64/arm_fp16.h
@@ -334,7 +334,7 @@ __extension__ extern __inline float16_t
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 vnegh_f16 (float16_t __a)
 {
-  return __builtin_aarch64_neghf (__a);
+  return -__a;
 }
 
 __extension__ extern __inline float16_t

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-19  9:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-19  9:32 [PATCH][committed] aarch64: Delete __builtin_aarch64_neg* builtins and their use Kyrylo Tkachov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).