This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
i386: constant_alignment
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Tue, 19 Feb 2002 10:27:45 +1100
- Subject: i386: constant_alignment
while i'm at it... x86 needs constant alignment too.
see my note on my answer to your patch approval for vec constants
for the reason why.
2002-02-19 Aldy Hernandez <aldyh@redhat.com>
* i386.c (ix86_constant_alignment): Handle vector constants.
* i386.md ("mmx_uavgv8qi3"): Use const_vector.
("mmx_uavgv4hi3"): Same.
("pmulhrwv4hi3"): Same.
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/uberbaum/gcc/config/i386/i386.c,v
retrieving revision 1.364
diff -c -p -r1.364 i386.c
*** i386.c 2002/02/18 14:09:38 1.364
--- i386.c 2002/02/18 23:22:28
*************** ix86_constant_alignment (exp, align)
*** 10563,10568 ****
--- 10563,10575 ----
else if (ALIGN_MODE_128 (TYPE_MODE (TREE_TYPE (exp))) && align < 128)
return 128;
}
+ else if (TREE_CODE (exp) == VECTOR_CST)
+ {
+ if (TYPE_MODE (TREE_TYPE (exp)) == DFmode && align < 64)
+ return 64;
+ if (ALIGN_MODE_128 (TYPE_MODE (TREE_TYPE (exp))) && align < 128)
+ return 128;
+ }
else if (TREE_CODE (exp) == STRING_CST && TREE_STRING_LENGTH (exp) >= 31
&& align < 256)
return 256;