------- Comment #20 from ubizjak at gmail dot com 2008-01-24 13:48 -------
(In reply to comment #19)
> Uros, can you handle x86?
Sometimes CONSTANT_P is just too broad to construct correct RTX. This patch
creates most sensible asm (i.e. using movd instead of movdqa):
--cut here--
Index: i386.c
===================================================================
--- i386.c (revision 131776)
+++ i386.c (working copy)
@@ -23593,7 +23593,9 @@ ix86_expand_vector_init (bool mmx_ok, rt
for (i = 0; i < n_elts; ++i)
{
x = XVECEXP (vals, 0, i);
- if (!CONSTANT_P (x))
+ if (!(CONST_INT_P (x)
+ || GET_CODE (x) == CONST_DOUBLE
+ || GET_CODE (x) == CONST_FIXED))
n_var++, one_var = i;
else if (x != CONST0_RTX (inner_mode))
all_const_zero = false;
--cut here--
f1:
pushl %ebx
subl $24, %esp
movl 32(%esp), %ebx
movd .LC0, %xmm0
movdqa %xmm0, (%esp)
.p2align 4,,7
.p2align 3
.L2:
movdqa (%esp), %xmm0
call f
subl $1, %ebx
jne .L2
addl $24, %esp
popl %ebx
ret
.size f1, .-f1
.section .rodata.cst4,"aM",@progbits,4
.align 4
.LC0:
.long g+32
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34856