On Thu, Jun 21, 2007 at 10:14:55AM +0200, Uros Bizjak wrote:
> Hello H.J.!
> 
> The testscase gcc.target/i386/sse2-vec-5.c you ported from mainline
> fails on gcc-4.2 branch because  __builtin_ia32_vec_ext_v16qi builtin
> does not exist in gcc-4.2. This builtin corresponds to pextrb insn
> that was introduced in SSE4 (gcc-4.3).
> 
> Also, the definition of __builtin_ia32_vec_ext_v16qi in the mainline
> should be enabled only for OPTION_MASK_ISA_SSE4_1, as current
> definition is also enabled for SSE2:
> 
>  def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_vec_ext_v16qi",
> ftype, IX86_BUILTIN_VEC_EXT_V16QI);
> 
> I propose that sse2-vec-5.c is removed from the testsuite in gcc-4_2
> branch and mainline.

__builtin_ia32_vec_ext_v16qi, like many other vector extra builtins,
is supported by SSE2, but not with single instruction. I don't think
it should be removed from mainline.

bash-3.1$ cat /tmp/v.c
#include <emmintrin.h>

int
foo (__m128i x)
{
  return __builtin_ia32_vec_ext_v16qi ((__v16qi) x, 3);
}
bash-3.1$ ./xgcc -B./ -msse2 -O -S /tmp/v.c -m32
bash-3.1$ cat v.s
        .file   "v.c"
        .text
.globl foo
        .type   foo, @function
foo:
        pushl   %ebp
        movl    %esp, %ebp
        movdqa  %xmm0, -24(%ebp)
        movsbl  -21(%ebp),%eax
        leave
        ret
        .size   foo, .-foo
        .ident  "GCC: (GNU) 4.3.0 20070619 (experimental) [trunk
revision 125849]"
        .section        .note.GNU-stack,"",@progbits
bash-3.1$ 

I will remove sse2-vec-5.c from 4.2 since __builtin_ia32_vec_ext_v16qi
isn't available there.

H.J.

Reply via email to