From: Jonathan Wright <Jonathan.Wright@arm.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Richard Sandiford <Richard.Sandiford@arm.com>,
Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
Subject: [PATCH] aarch64: Use type-qualified builtins for [R]SHRN[2] Neon intrinsics
Date: Thu, 11 Nov 2021 10:14:46 +0000 [thread overview]
Message-ID: <DB9PR08MB695989524E481A2893F2A804EB949@DB9PR08MB6959.eurprd08.prod.outlook.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 880 bytes --]
Hi,
Thus patch declares unsigned type-qualified builtins and uses them for
[R]SHRN[2] Neon intrinsics. This removes the need for casts in
arm_neon.h.
Bootstrapped and regression tested on aarch64-none-linux-gnu - no
issues.
Ok for master?
Thanks,
Jonathan
---
gcc/ChangeLog:
2021-11-08 Jonathan Wright <jonathan.wright@arm.com>
* config/aarch64/aarch64-simd-builtins.def: Declare type-
qualified builtins for [R]SHRN[2].
* config/aarch64/arm_neon.h (vshrn_n_u16): Use type-qualified
builtin and remove casts.
(vshrn_n_u32): Likewise.
(vshrn_n_u64): Likewise.
(vrshrn_high_n_u16): Likewise.
(vrshrn_high_n_u32): Likewise.
(vrshrn_high_n_u64): Likewise.
(vrshrn_n_u16): Likewise.
(vrshrn_n_u32): Likewise.
(vrshrn_n_u64): Likewise.
(vshrn_high_n_u16): Likewise.
(vshrn_high_n_u32): Likewise.
(vshrn_high_n_u64): Likewise.
[-- Attachment #2: rb15032.patch --]
[-- Type: application/octet-stream, Size: 5360 bytes --]
diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def b/gcc/config/aarch64/aarch64-simd-builtins.def
index 5e6df6abe3f5b42710a266d0b2a7a1e4597975a6..46ec2f9bfc509e5e460334d4c5324ddf18703639 100644
--- a/gcc/config/aarch64/aarch64-simd-builtins.def
+++ b/gcc/config/aarch64/aarch64-simd-builtins.def
@@ -253,15 +253,19 @@
/* Implemented by aarch64_shrn<mode>". */
BUILTIN_VQN (SHIFTIMM, shrn, 0, NONE)
+ BUILTIN_VQN (USHIFTIMM, shrn, 0, NONE)
/* Implemented by aarch64_shrn2<mode>. */
- BUILTIN_VQN (SHIFTACC, shrn2, 0, NONE)
+ BUILTIN_VQN (SHIFT2IMM, shrn2, 0, NONE)
+ BUILTIN_VQN (USHIFT2IMM, shrn2, 0, NONE)
/* Implemented by aarch64_rshrn<mode>". */
BUILTIN_VQN (SHIFTIMM, rshrn, 0, NONE)
+ BUILTIN_VQN (USHIFTIMM, rshrn, 0, NONE)
/* Implemented by aarch64_rshrn2<mode>. */
- BUILTIN_VQN (SHIFTACC, rshrn2, 0, NONE)
+ BUILTIN_VQN (SHIFT2IMM, rshrn2, 0, NONE)
+ BUILTIN_VQN (USHIFT2IMM, rshrn2, 0, NONE)
/* Implemented by aarch64_<su>mlsl<mode>. */
BUILTIN_VD_BHSI (TERNOP, smlsl, 0, NONE)
diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h
index 51cedab19d8d1c261fbcf9a6d3202c2e1b513183..37f02e2a24fbc85f23ea73e2fd0e06deac7db87e 100644
--- a/gcc/config/aarch64/arm_neon.h
+++ b/gcc/config/aarch64/arm_neon.h
@@ -7606,21 +7606,21 @@ __extension__ extern __inline uint8x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_n_u16 (uint16x8_t __a, const int __b)
{
- return (uint8x8_t)__builtin_aarch64_shrnv8hi ((int16x8_t)__a, __b);
+ return __builtin_aarch64_shrnv8hi_uus (__a, __b);
}
__extension__ extern __inline uint16x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_n_u32 (uint32x4_t __a, const int __b)
{
- return (uint16x4_t)__builtin_aarch64_shrnv4si ((int32x4_t)__a, __b);
+ return __builtin_aarch64_shrnv4si_uus (__a, __b);
}
__extension__ extern __inline uint32x2_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_n_u64 (uint64x2_t __a, const int __b)
{
- return (uint32x2_t)__builtin_aarch64_shrnv2di ((int64x2_t)__a, __b);
+ return __builtin_aarch64_shrnv2di_uus (__a, __b);
}
__extension__ extern __inline int32x4_t
@@ -8387,24 +8387,21 @@ __extension__ extern __inline uint8x16_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_high_n_u16 (uint8x8_t __a, uint16x8_t __b, const int __c)
{
- return (uint8x16_t) __builtin_aarch64_rshrn2v8hi ((int8x8_t) __a,
- (int16x8_t) __b, __c);
+ return __builtin_aarch64_rshrn2v8hi_uuus (__a, __b, __c);
}
__extension__ extern __inline uint16x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_high_n_u32 (uint16x4_t __a, uint32x4_t __b, const int __c)
{
- return (uint16x8_t) __builtin_aarch64_rshrn2v4si ((int16x4_t) __a,
- (int32x4_t) __b, __c);
+ return __builtin_aarch64_rshrn2v4si_uuus (__a, __b, __c);
}
__extension__ extern __inline uint32x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_high_n_u64 (uint32x2_t __a, uint64x2_t __b, const int __c)
{
- return (uint32x4_t) __builtin_aarch64_rshrn2v2di ((int32x2_t)__a,
- (int64x2_t)__b, __c);
+ return __builtin_aarch64_rshrn2v2di_uuus (__a, __b, __c);
}
__extension__ extern __inline int8x8_t
@@ -8432,21 +8429,21 @@ __extension__ extern __inline uint8x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_n_u16 (uint16x8_t __a, const int __b)
{
- return (uint8x8_t) __builtin_aarch64_rshrnv8hi ((int16x8_t) __a, __b);
+ return __builtin_aarch64_rshrnv8hi_uus (__a, __b);
}
__extension__ extern __inline uint16x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_n_u32 (uint32x4_t __a, const int __b)
{
- return (uint16x4_t) __builtin_aarch64_rshrnv4si ((int32x4_t) __a, __b);
+ return __builtin_aarch64_rshrnv4si_uus (__a, __b);
}
__extension__ extern __inline uint32x2_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vrshrn_n_u64 (uint64x2_t __a, const int __b)
{
- return (uint32x2_t) __builtin_aarch64_rshrnv2di ((int64x2_t) __a, __b);
+ return __builtin_aarch64_rshrnv2di_uus (__a, __b);
}
__extension__ extern __inline uint32x2_t
@@ -8488,24 +8485,21 @@ __extension__ extern __inline uint8x16_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_high_n_u16 (uint8x8_t __a, uint16x8_t __b, const int __c)
{
- return (uint8x16_t)
- __builtin_aarch64_shrn2v8hi ((int8x8_t) __a, (int16x8_t) __b, __c);
+ return __builtin_aarch64_shrn2v8hi_uuus (__a, __b, __c);
}
__extension__ extern __inline uint16x8_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_high_n_u32 (uint16x4_t __a, uint32x4_t __b, const int __c)
{
- return (uint16x8_t)
- __builtin_aarch64_shrn2v4si ((int16x4_t) __a, (int32x4_t) __b, __c);
+ return __builtin_aarch64_shrn2v4si_uuus (__a, __b, __c);
}
__extension__ extern __inline uint32x4_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vshrn_high_n_u64 (uint32x2_t __a, uint64x2_t __b, const int __c)
{
- return (uint32x4_t)
- __builtin_aarch64_shrn2v2di ((int32x2_t) __a, (int64x2_t) __b, __c);
+ return __builtin_aarch64_shrn2v2di_uuus (__a, __b, __c);
}
__extension__ extern __inline poly8x8_t
next reply other threads:[~2021-11-11 10:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 10:14 Jonathan Wright [this message]
2021-11-11 10:20 ` Richard Sandiford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB9PR08MB695989524E481A2893F2A804EB949@DB9PR08MB6959.eurprd08.prod.outlook.com \
--to=jonathan.wright@arm.com \
--cc=Kyrylo.Tkachov@arm.com \
--cc=Richard.Sandiford@arm.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).