> /usr/local/gcc44/bin/gcc -v
Using built-in specs.
Target: i386-apple-darwin9.2.0
Configured with: ../gcc/configure --prefix=/usr/local/gcc44
--enable-threads=posix --with-arch=core2 --with-tune=core2 --with-gmp=/sw
--with-mpfr=/sw --disable-nls --disable-bootstrap --enable-checking=yes,rtl
CFLAGS=-g LDFLAGS=/usr/lib/libiconv.dylib --enable-languages=c,c++,objc
Thread model: posix
gcc version 4.4.0 20080326 (experimental) (GCC)
> /usr/local/gcc44/bin/gcc -Os -march=core2 -fno-pic -fomit-frame-pointer 
> -flax-vector-conversions -S pmaddwd.c

generates:
_madd_swapped:
        subl    $12, %esp
        movaps  LC0, %xmm1
        addl    $12, %esp
        pmaddwd %xmm1, %xmm0
        ret
.globl _madd
_madd:
        subl    $12, %esp
        movaps  LC0, %xmm1
        addl    $12, %esp
        pmaddwd %xmm0, %xmm1
        movaps  %xmm1, %xmm0
        ret

Both of these should be:
_madd:
        pmaddwd LC0, %xmm0
        ret

since the stack isn't referenced and pmaddwd is commutative. (the variable
being renamed LC0 is PR 31043)


-- 
           Summary: x86 poor code with pmaddwd
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: astrange at ithinksw dot com
 GCC build triplet: i386-apple-darwin9.2.0
  GCC host triplet: i386-apple-darwin9.2.0
GCC target triplet: i386-apple-darwin9.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35714

Reply via email to