[4/9] armv7: Simplify constant load

Submitted by Ben Avison on April 11, 2016, 12:26 p.m.

Details

Message ID 1460377590-23285-5-git-send-email-bavison@riscosopen.org
State New
Headers show
Series "Changes to existing ARMv7 routines" ( rev: 1 ) in Pixman

Not browsing as part of any series.

Commit Message

Ben Avison April 11, 2016, 12:26 p.m.
A minor point, but 0xFF000000 is already a valid immediate constant for
NEON, there's no need to construct it in two steps.

Signed-off-by: Ben Avison <bavison@riscosopen.org>
---
 pixman/pixman-arm-neon-asm.S |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/pixman/pixman-arm-neon-asm.S b/pixman/pixman-arm-neon-asm.S
index 9a5d85a..97315d4 100644
--- a/pixman/pixman-arm-neon-asm.S
+++ b/pixman/pixman-arm-neon-asm.S
@@ -1186,8 +1186,7 @@  generate_composite_function \
 .endm
 
 .macro pixman_composite_src_x888_8888_init
-    vmov.u8  q2, #0xFF
-    vshl.u32 q2, q2, #24
+    vmov.u32 q2, #0xFF000000
 .endm
 
 generate_composite_function \

Comments

Hi.

In aarch64, I cannot find corresponding instruction of this patch,
but

> movi v2.2s, 0xff, lsl #24

works well as your modification.


On 11 April 2016 at 21:26, Ben Avison <bavison@riscosopen.org> wrote:
> A minor point, but 0xFF000000 is already a valid immediate constant for
> NEON, there's no need to construct it in two steps.
>
> Signed-off-by: Ben Avison <bavison@riscosopen.org>
> ---
>  pixman/pixman-arm-neon-asm.S |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/pixman/pixman-arm-neon-asm.S b/pixman/pixman-arm-neon-asm.S
> index 9a5d85a..97315d4 100644
> --- a/pixman/pixman-arm-neon-asm.S
> +++ b/pixman/pixman-arm-neon-asm.S
> @@ -1186,8 +1186,7 @@ generate_composite_function \
>  .endm
>
>  .macro pixman_composite_src_x888_8888_init
> -    vmov.u8  q2, #0xFF
> -    vshl.u32 q2, q2, #24
> +    vmov.u32 q2, #0xFF000000
>  .endm
>
>  generate_composite_function \
> --
> 1.7.5.4
>
> _______________________________________________
> Pixman mailing list
> Pixman@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pixman
On Wed, 13 Apr 2016 21:24:07 +0900
Mizuki Asakura <ed6e117f@gmail.com> wrote:

> Hi.
> 
> In aarch64, I cannot find corresponding instruction of this patch,
> but
> 
> > movi v2.2s, 0xff, lsl #24  
> 
> works well as your modification.

Thanks for finding the AArch64 equivalent for this particular
instruction. This looks like a yet another minor syntax sugar
difference between the 32-bit and the 64-bit variants of the
GNU assembler.

> On 11 April 2016 at 21:26, Ben Avison <bavison@riscosopen.org> wrote:
> > A minor point, but 0xFF000000 is already a valid immediate constant for
> > NEON, there's no need to construct it in two steps.
> >
> > Signed-off-by: Ben Avison <bavison@riscosopen.org>
> > ---
> >  pixman/pixman-arm-neon-asm.S |    3 +--
> >  1 files changed, 1 insertions(+), 2 deletions(-)
> >
> > diff --git a/pixman/pixman-arm-neon-asm.S b/pixman/pixman-arm-neon-asm.S
> > index 9a5d85a..97315d4 100644
> > --- a/pixman/pixman-arm-neon-asm.S
> > +++ b/pixman/pixman-arm-neon-asm.S
> > @@ -1186,8 +1186,7 @@ generate_composite_function \
> >  .endm
> >
> >  .macro pixman_composite_src_x888_8888_init
> > -    vmov.u8  q2, #0xFF
> > -    vshl.u32 q2, q2, #24
> > +    vmov.u32 q2, #0xFF000000
> >  .endm
> >
> >  generate_composite_function \
> > --
> > 1.7.5.4
> >