diff mbox

[ARM] Fix PR51819.

Message ID CACUk7=UvsmX4Tm9aHZ4MA2yV-FNw6NVtnRMYk0e9MZgS=N5wJQ@mail.gmail.com
State Accepted
Headers show

Commit Message

Ramana Radhakrishnan Jan. 20, 2012, 1:25 p.m. UTC
Hi,

PR51819 is a case where we were actually putting out alignment hints
for the wrong memory size. The attached patch corrects this and
another latent issue that I spotted.

Committed after testing on arm-linux-gnueabi with Neon configurations.

cheers
Ramana

2012-01-20  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

        PR target/51819
        * config/arm/arm.c (arm_print_operand): Correct output of alignment
        hints for neon loads and stores.

Comments

Ramana Radhakrishnan April 16, 2012, 1:47 p.m. UTC | #1
Hi Uli,

Apologies for the delayed response.

>
> Shouldn't the check be implemented along the following lines?
>
>        if (memsize == 32 && (align % 32) == 0)
>          align_bits = 256;
>        else if ((memsize == 16 || memsize == 32) && (align % 16) == 0)
>          align_bits = 128;
>        else if (memsize >= 8 && (align % 8) == 0)
>          align_bits = 64;
>        else
>          align_bits = 0;

This looks OK to me. Looking at the ISA documents and the variants of
the vldn instructions your summary is correct. The alignment specifier
should not be greater than the memory size being transferred and
checking this in this form is OK .

regards,
Ramana



>
> Bye,
> Ulrich
>
> --
>  Dr. Ulrich Weigand
>  GNU Toolchain for Linux on System z and Cell BE
>  Ulrich.Weigand@de.ibm.com
>
diff mbox

Patch

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 183333)
+++ gcc/config/arm/arm.c	(working copy)
@@ -17711,9 +17711,9 @@ 
 	/* Only certain alignment specifiers are supported by the hardware.  */
 	if (memsize == 16 && (align % 32) == 0)
 	  align_bits = 256;
-	else if ((memsize == 8 || memsize == 16) && (align % 16) == 0)
+	else if (memsize == 16 && (align % 16) == 0)
 	  align_bits = 128;
-	else if ((align % 8) == 0)
+	else if (memsize >= 8 && (align % 8) == 0)
 	  align_bits = 64;
 	else
 	  align_bits = 0;