* [ARM] PR66791: Replace builtins in vld1
@ 2021-07-26 21:24 Prathamesh Kulkarni
2021-07-29 9:27 ` Kyrylo Tkachov
0 siblings, 1 reply; 4+ messages in thread
From: Prathamesh Kulkarni @ 2021-07-26 21:24 UTC (permalink / raw)
To: gcc Patches, Kyrill Tkachov, Richard Earnshaw
[-- Attachment #1: Type: text/plain, Size: 526 bytes --]
Hi,
Similar to aarch64, this patch replaces call to builtin by
dereferencing __a in vld1_p64, vld1_s64 and vld1_u64.
The patch changes code-gen for the intrinsic as follows:
Before patch:
vld1.64 {d16}, [r0:64]
vmov r0, r1, d16 @ int
bx lr
After patch:
ldrd r0, [r0]
bx lr
I assume the code-gen after patch is correct, since it loads two
consecutive words from [r0] into r0 and r1 ?
Bootstrapped+tested on arm-linux-gnueabihf.
OK to commit ?
Thanks,
Prathamesh
[-- Attachment #2: vld1-1.txt --]
[-- Type: text/plain, Size: 1402 bytes --]
2021-07-27 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR target/66791
* config/arm/arm_neon.h (vld1_p64): Replace call to builtin by
explicitly dereferencing __a.
(vld1_s64): Likewise.
(vld1_u64): Likewise.
diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h
index 41b596b5fc6..5a91d15bf75 100644
--- a/gcc/config/arm/arm_neon.h
+++ b/gcc/config/arm/arm_neon.h
@@ -10301,7 +10301,7 @@ __extension__ extern __inline poly64x1_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vld1_p64 (const poly64_t * __a)
{
- return (poly64x1_t)__builtin_neon_vld1di ((const __builtin_neon_di *) __a);
+ return (poly64x1_t) { *__a };
}
#pragma GCC pop_options
@@ -10330,7 +10330,7 @@ __extension__ extern __inline int64x1_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vld1_s64 (const int64_t * __a)
{
- return (int64x1_t)__builtin_neon_vld1di ((const __builtin_neon_di *) __a);
+ return (int64x1_t) { *__a };
}
#if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
@@ -10374,7 +10374,7 @@ __extension__ extern __inline uint64x1_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vld1_u64 (const uint64_t * __a)
{
- return (uint64x1_t)__builtin_neon_vld1di ((const __builtin_neon_di *) __a);
+ return (uint64x1_t) { *__a };
}
__extension__ extern __inline poly8x8_t
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [ARM] PR66791: Replace builtins in vld1
2021-07-26 21:24 [ARM] PR66791: Replace builtins in vld1 Prathamesh Kulkarni
@ 2021-07-29 9:27 ` Kyrylo Tkachov
2021-07-29 14:45 ` Prathamesh Kulkarni
0 siblings, 1 reply; 4+ messages in thread
From: Kyrylo Tkachov @ 2021-07-29 9:27 UTC (permalink / raw)
To: Prathamesh Kulkarni, gcc Patches, Richard Earnshaw
Hi Prathamesh,
> -----Original Message-----
> From: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
> Sent: 26 July 2021 22:24
> To: gcc Patches <gcc-patches@gcc.gnu.org>; Kyrylo Tkachov
> <Kyrylo.Tkachov@arm.com>; Richard Earnshaw
> <Richard.Earnshaw@foss.arm.com>
> Subject: [ARM] PR66791: Replace builtins in vld1
>
> Hi,
> Similar to aarch64, this patch replaces call to builtin by
> dereferencing __a in vld1_p64, vld1_s64 and vld1_u64.
>
> The patch changes code-gen for the intrinsic as follows:
> Before patch:
> vld1.64 {d16}, [r0:64]
> vmov r0, r1, d16 @ int
> bx lr
>
> After patch:
> ldrd r0, [r0]
> bx lr
>
> I assume the code-gen after patch is correct, since it loads two
> consecutive words from [r0] into r0 and r1 ?
Yes, this looks correct.
>
> Bootstrapped+tested on arm-linux-gnueabihf.
> OK to commit ?
Ok. Can we now remove the vld1 builtin definition?
Thanks,
Kyrill
>
> Thanks,
> Prathamesh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ARM] PR66791: Replace builtins in vld1
2021-07-29 9:27 ` Kyrylo Tkachov
@ 2021-07-29 14:45 ` Prathamesh Kulkarni
2021-07-29 14:49 ` Kyrylo Tkachov
0 siblings, 1 reply; 4+ messages in thread
From: Prathamesh Kulkarni @ 2021-07-29 14:45 UTC (permalink / raw)
To: Kyrylo Tkachov; +Cc: gcc Patches, Richard Earnshaw
[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]
On Thu, 29 Jul 2021 at 14:57, Kyrylo Tkachov <Kyrylo.Tkachov@arm.com> wrote:
>
> Hi Prathamesh,
>
> > -----Original Message-----
> > From: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
> > Sent: 26 July 2021 22:24
> > To: gcc Patches <gcc-patches@gcc.gnu.org>; Kyrylo Tkachov
> > <Kyrylo.Tkachov@arm.com>; Richard Earnshaw
> > <Richard.Earnshaw@foss.arm.com>
> > Subject: [ARM] PR66791: Replace builtins in vld1
> >
> > Hi,
> > Similar to aarch64, this patch replaces call to builtin by
> > dereferencing __a in vld1_p64, vld1_s64 and vld1_u64.
> >
> > The patch changes code-gen for the intrinsic as follows:
> > Before patch:
> > vld1.64 {d16}, [r0:64]
> > vmov r0, r1, d16 @ int
> > bx lr
> >
> > After patch:
> > ldrd r0, [r0]
> > bx lr
> >
> > I assume the code-gen after patch is correct, since it loads two
> > consecutive words from [r0] into r0 and r1 ?
>
> Yes, this looks correct.
>
> >
> > Bootstrapped+tested on arm-linux-gnueabihf.
> > OK to commit ?
>
> Ok. Can we now remove the vld1 builtin definition?
Does the attached patch look OK ?
I suppose we can only remove entry for di since the patch replaces
calls to only __builtin_neon_vld1di ?
Thanks,
Prathamesh
> Thanks,
> Kyrill
>
> >
> > Thanks,
> > Prathamesh
[-- Attachment #2: vld1-2.txt --]
[-- Type: text/plain, Size: 2103 bytes --]
gcc/ChangeLog:
PR target/66791
* config/arm/arm_neon.h (vld1_p64): Replace call to builtin by
explicitly dereferencing __a.
(vld1_s64): Likewise.
(vld1_u64): Likewise.
* config/arm/arm_neon_builtins.def (vld1): Remove entry for di
and change to VAR13.
diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h
index 41b596b5fc6..5a91d15bf75 100644
--- a/gcc/config/arm/arm_neon.h
+++ b/gcc/config/arm/arm_neon.h
@@ -10301,7 +10301,7 @@ __extension__ extern __inline poly64x1_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vld1_p64 (const poly64_t * __a)
{
- return (poly64x1_t)__builtin_neon_vld1di ((const __builtin_neon_di *) __a);
+ return (poly64x1_t) { *__a };
}
#pragma GCC pop_options
@@ -10330,7 +10330,7 @@ __extension__ extern __inline int64x1_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vld1_s64 (const int64_t * __a)
{
- return (int64x1_t)__builtin_neon_vld1di ((const __builtin_neon_di *) __a);
+ return (int64x1_t) { *__a };
}
#if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
@@ -10374,7 +10374,7 @@ __extension__ extern __inline uint64x1_t
__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
vld1_u64 (const uint64_t * __a)
{
- return (uint64x1_t)__builtin_neon_vld1di ((const __builtin_neon_di *) __a);
+ return (uint64x1_t) { *__a };
}
__extension__ extern __inline poly8x8_t
diff --git a/gcc/config/arm/arm_neon_builtins.def b/gcc/config/arm/arm_neon_builtins.def
index 70438ac1848..fb6d66e594a 100644
--- a/gcc/config/arm/arm_neon_builtins.def
+++ b/gcc/config/arm/arm_neon_builtins.def
@@ -302,8 +302,8 @@ VAR1 (TERNOP, vtbx1, v8qi)
VAR1 (TERNOP, vtbx2, v8qi)
VAR1 (TERNOP, vtbx3, v8qi)
VAR1 (TERNOP, vtbx4, v8qi)
-VAR14 (LOAD1, vld1,
- v8qi, v4hi, v4hf, v2si, v2sf, di, v16qi, v8hi, v8hf, v4si, v4sf, v2di,
+VAR13 (LOAD1, vld1,
+ v8qi, v4hi, v4hf, v2si, v2sf, v16qi, v8hi, v8hf, v4si, v4sf, v2di,
v4bf, v8bf)
VAR12 (LOAD1LANE, vld1_lane,
v8qi, v4hi, v2si, v2sf, di, v16qi, v8hi, v4si, v4sf, v2di, v4bf, v8bf)
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [ARM] PR66791: Replace builtins in vld1
2021-07-29 14:45 ` Prathamesh Kulkarni
@ 2021-07-29 14:49 ` Kyrylo Tkachov
0 siblings, 0 replies; 4+ messages in thread
From: Kyrylo Tkachov @ 2021-07-29 14:49 UTC (permalink / raw)
To: Prathamesh Kulkarni; +Cc: gcc Patches, Richard Earnshaw
> -----Original Message-----
> From: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
> Sent: 29 July 2021 15:45
> To: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
> Cc: gcc Patches <gcc-patches@gcc.gnu.org>; Richard Earnshaw
> <Richard.Earnshaw@foss.arm.com>
> Subject: Re: [ARM] PR66791: Replace builtins in vld1
>
> On Thu, 29 Jul 2021 at 14:57, Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
> wrote:
> >
> > Hi Prathamesh,
> >
> > > -----Original Message-----
> > > From: Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
> > > Sent: 26 July 2021 22:24
> > > To: gcc Patches <gcc-patches@gcc.gnu.org>; Kyrylo Tkachov
> > > <Kyrylo.Tkachov@arm.com>; Richard Earnshaw
> > > <Richard.Earnshaw@foss.arm.com>
> > > Subject: [ARM] PR66791: Replace builtins in vld1
> > >
> > > Hi,
> > > Similar to aarch64, this patch replaces call to builtin by
> > > dereferencing __a in vld1_p64, vld1_s64 and vld1_u64.
> > >
> > > The patch changes code-gen for the intrinsic as follows:
> > > Before patch:
> > > vld1.64 {d16}, [r0:64]
> > > vmov r0, r1, d16 @ int
> > > bx lr
> > >
> > > After patch:
> > > ldrd r0, [r0]
> > > bx lr
> > >
> > > I assume the code-gen after patch is correct, since it loads two
> > > consecutive words from [r0] into r0 and r1 ?
> >
> > Yes, this looks correct.
> >
> > >
> > > Bootstrapped+tested on arm-linux-gnueabihf.
> > > OK to commit ?
> >
> > Ok. Can we now remove the vld1 builtin definition?
> Does the attached patch look OK ?
> I suppose we can only remove entry for di since the patch replaces
> calls to only __builtin_neon_vld1di ?
Yeah, we can just remove the DI entry.
Ok if this passes the usual testing.
Thanks,
Kyrill
>
> Thanks,
> Prathamesh
> > Thanks,
> > Kyrill
> >
> > >
> > > Thanks,
> > > Prathamesh
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-29 14:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26 21:24 [ARM] PR66791: Replace builtins in vld1 Prathamesh Kulkarni
2021-07-29 9:27 ` Kyrylo Tkachov
2021-07-29 14:45 ` Prathamesh Kulkarni
2021-07-29 14:49 ` 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).