public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/17236] New: inefficient code for long long multiply on x86
@ 2004-08-30  5:50 dann at godzilla dot ics dot uci dot edu
  2004-10-06 23:27 ` [Bug rtl-optimization/17236] " giovannibajo at libero dot it
                   ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2004-08-30  5:50 UTC (permalink / raw)
  To: gcc-bugs

Compiling:
unsigned long long LLM(unsigned long long arg1, unsigned long long arg2)
{
  return arg1 *  arg2;
}

with gcc -O2 -fomit-frame-pointer generates:

        pushl   %ebp
        pushl   %edi
        pushl   %ebx
        pushl   %edi
        pushl   %edi
        movl    32(%esp), %ecx
        movl    24(%esp), %eax
        movl    36(%esp), %ebx
        movl    24(%esp), %edi
        mull    %ecx
        imull   28(%esp), %ecx
        imull   %ebx, %edi
        movl    %edx, %ebp
        movl    %eax, (%esp)
        addl    %edi, %ebp
        movl    (%esp), %eax
        leal    (%ebp,%ecx), %ecx
        movl    %ecx, 4(%esp)
        movl    4(%esp), %edx
        popl    %ecx
        popl    %ebx
        popl    %ebx
        popl    %edi
        popl    %ebp
        ret

ICC -O2 generates much smaller code:

        movl      8(%esp), %ecx                                 #516.18
        imull     12(%esp), %ecx                                #516.18
        movl      16(%esp), %eax                                #516.18
        imull     4(%esp), %eax                                 #516.18
        addl      %eax, %ecx                                    #516.18
        movl      4(%esp), %eax                                 #516.18
        mull      12(%esp)                                      #516.18
        addl      %ecx, %edx                                    #516.18
        ret                                                     #516.18

-- 
           Summary: inefficient code for long long multiply on x86
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2008-09-06 16:20 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-17236-1008@http.gcc.gnu.org/bugzilla/>
2007-02-02  0:17 ` [Bug rtl-optimization/17236] inefficient code for long long multiply on x86 roger at eyesopen dot com
2007-11-23 20:48 ` steven at gcc dot gnu dot org
2007-12-18  7:43 ` bonzini at gnu dot org
2007-12-18  7:53 ` bonzini at gnu dot org
2007-12-18  8:05 ` bonzini at gnu dot org
2007-12-18  8:10 ` ebotcazou at gcc dot gnu dot org
2007-12-18 13:48 ` ubizjak at gmail dot com
2007-12-18 16:02 ` bonzini at gnu dot org
2007-12-18 16:39 ` jakub at gcc dot gnu dot org
2007-12-18 16:51 ` bonzini at gnu dot org
2007-12-18 18:20 ` ubizjak at gmail dot com
2007-12-18 18:33 ` ubizjak at gmail dot com
2007-12-19  9:49 ` bonzini at gnu dot org
2007-12-19 12:11 ` ubizjak at gmail dot com
2007-12-19 12:14 ` bonzini at gnu dot org
2007-12-19 12:32 ` bonzini at gnu dot org
2007-12-19 12:43 ` bonzini at gnu dot org
2007-12-19 13:12 ` ubizjak at gmail dot com
2007-12-19 13:36 ` bonzini at gnu dot org
2007-12-19 13:49 ` steven at gcc dot gnu dot org
2007-12-19 13:50 ` bonzini at gnu dot org
2007-12-19 13:54 ` bonzini at gnu dot org
2007-12-20 13:53 ` bonzini at gnu dot org
2007-12-20 14:16 ` bonzini at gnu dot org
2008-03-07  8:27 ` bonzini at gnu dot org
2008-03-07  8:42 ` bonzini at gnu dot org
2008-09-06 16:12 ` ubizjak at gmail dot com
2008-09-06 16:19 ` ubizjak at gmail dot com
2008-09-06 16:20 ` ubizjak at gmail dot com
2004-08-30  5:50 [Bug rtl-optimization/17236] New: " dann at godzilla dot ics dot uci dot edu
2004-10-06 23:27 ` [Bug rtl-optimization/17236] " giovannibajo at libero dot it
2005-03-14 18:24 ` cvs-commit at gcc dot gnu dot org
2005-03-15 10:05 ` giovannibajo at libero dot it
2005-03-15 10:07 ` giovannibajo at libero dot it

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).