This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386]: Fix target/19356


Hello!

The problem here is that IX86_BUILTIN_MMX_ZERO and IX86_BUILTIN_CLRTI return const0_rtx instead of CONST0_RTX in proper mode.

However, there is a question with MMX_ZERO handling. The asm code from this example is somehow suspicious:

typedef char __m64 __attribute__((vector_size(8)));

void foo()
{
           __m64 v=(__m64)__builtin_ia32_mmx_zero();
}

foo:
       pushl   %ebp
       movl    %esp, %ebp
       subl    $24, %esp
       movl    $0, %eax
       movl    $0, %edx
       movl    %eax, -24(%ebp)
       movl    %edx, -20(%ebp)
       movq    -24(%ebp), %mm0
       movq    %mm0, -8(%ebp)
       leave
       ret

Note, no pxor and a lot of unnecessary moves... This could be the problem, described in PR 13366.

2005-01-11 Uros Bizjak <uros@kss-loka.si>

       * config/i386/i386.c (ix86_expand_builtin) [IX86_BUILTIN_MMX_ZERO]:
       Return CONST0_RTX (DImode).
       [IX86_BUILTIN_CLRTI]: Return CONST0_RTX (V2DImode).

Uros.
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.773
diff -u -p -r1.773 i386.c
--- i386.c	10 Jan 2005 21:13:45 -0000	1.773
+++ i386.c	11 Jan 2005 08:03:52 -0000
@@ -13883,10 +13883,10 @@ ix86_expand_builtin (tree exp, rtx targe
       return CONST0_RTX (V4SFmode);
 
     case IX86_BUILTIN_MMX_ZERO:
-      return const0_rtx;
+      return CONST0_RTX (DImode);
 
     case IX86_BUILTIN_CLRTI:
-      return const0_rtx;
+      return CONST0_RTX (V2DImode);
 
     case IX86_BUILTIN_SQRTSD:
       return ix86_expand_unop1_builtin (CODE_FOR_sse2_vmsqrtv2df2, arglist, target);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]