public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: PATCH: PR target/44588: Very inefficient 8bit mod/div
Date: Tue, 22 Jun 2010 18:28:00 -0000	[thread overview]
Message-ID: <1277229955.2613.1.camel@localhost> (raw)
In-Reply-To: <20100621193321.GA13780@intel.com>

On Mon, 2010-06-21 at 12:33 -0700, H.J. Lu wrote:
> Hi,
> 
> This patch adds 8bit divmov pattern for x86. X86 8bit divide
> instructions return result in AX with
> 
> AL <- Quotient
> AH <- Remainder
> 
> This patch models it and properly extends quotient. Tested
> on Intel64 with -m64 and -m32.  There are no regressions.
> OK for trunk?
> 
> BTW, there is only one divb used in subreg_get_info in
> gcc compilers. The old code is
> 
>         movzbl  mode_size(%r13), %edi
>         movzbl  mode_size(%r14), %esi
>         xorl    %edx, %edx
>         movl    %edi, %eax
>         divw    %si
>         testw   %dx, %dx
>         jne     .L1194
> 
> The new one is
> 
>         movzbl  mode_size(%r13), %edi
>         movl    %edi, %eax
>         divb    mode_size(%r14)
>         movzbl  %ah, %eax
>         testb   %al, %al
>         jne     .L1194
> 

Hm, something is not combined correctly, I'd say "testb %ah, %ah" is
optimal in the second case.

Uros.

  parent reply	other threads:[~2010-06-22 18:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21 20:38 H.J. Lu
2010-06-22 17:08 ` H.J. Lu
2010-06-22 18:28 ` Uros Bizjak [this message]
2010-06-22 18:36   ` H.J. Lu
2010-06-22 19:12     ` Uros Bizjak
2010-06-22 20:08       ` H.J. Lu
2010-06-23  6:26         ` Uros Bizjak
2010-06-23 16:54           ` H.J. Lu
2010-06-23 18:37             ` Paolo Bonzini
2010-06-23 18:46               ` H.J. Lu
2010-06-23 19:00                 ` Paolo Bonzini
2010-06-23 19:08                   ` H.J. Lu
2010-06-23 19:53                     ` Paolo Bonzini
2010-06-23 20:22                       ` H.J. Lu
2010-06-23 20:22                         ` Paolo Bonzini
2010-06-23 20:27                           ` H.J. Lu
2010-06-23 21:50                             ` H.J. Lu
2010-06-23 22:44                               ` H.J. Lu
2010-06-24  0:05                                 ` Paolo Bonzini
2010-06-24  0:54                                   ` H.J. Lu
2010-06-24  3:47                                     ` Paolo Bonzini
2010-06-24 17:38                                       ` H.J. Lu
2010-06-24 17:58                                         ` Paolo Bonzini
2010-06-24 19:01                                         ` Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1277229955.2613.1.camel@localhost \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).