This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/20415] New: Vector init builtin produces invalid instruction pshufw
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Mar 2005 05:32:41 -0000
- Subject: [Bug target/20415] New: Vector init builtin produces invalid instruction pshufw
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
__builtin_ia32_vec_init_v4hi and __builtin_ia32_vec_init_v8qi
produce the pshufw instruction when compiled with -O2 and any of the
switches -mmmx, -m3dnow, -march=pentium-mmx, -march=pentium2,
-march=k6, -march=k6-2, i.e. targeting CPUs which do not support SSE.
Environment:
System: Linux localhost 2.4.20 #2 Tue Mar 8 16:32:57 CET 2005 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../../cvs/gcc/configure --prefix=/opt/gcc-4.1 --enable-languages=c,c++
How-To-Repeat:
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
extern int i;
extern __v4hi v1;
extern __v4hi v2;
void foo (void)
{
v1 = __builtin_ia32_vec_init_v4hi (i,i,i,i);
v2 = __builtin_ia32_vec_init_v8qi (i,i,i,i,i,i,i,i);
}
gcc -O2 -mmmx -S example.c
.file "example.c"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
pushl %ebp
movl %esp, %ebp
pushl %eax
movl i, %edx
movl %edx, -4(%ebp)
andl $255, %edx
movl %edx, %eax
movd -4(%ebp), %mm1
sall $8, %eax
orl %edx, %eax
pshufw $0, %mm1, %mm1
movl %eax, -4(%ebp)
movq %mm1, v1
movd -4(%ebp), %mm1
pshufw $0, %mm1, %mm1
movq %mm1, v2
leave
ret
.size foo, .-foo
.ident "GCC: (GNU) 4.1.0 20050307 (experimental)"
.section .note.GNU-stack,"",@progbits
--
Summary: Vector init builtin produces invalid instruction pshufw
Product: gcc
Version: 1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mschimek at users dot sourceforge dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20415