public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH] Add type_unknown/type_executable/type_pic to output_type
Date: Mon, 24 Aug 2015 03:00:00 -0000	[thread overview]
Message-ID: <20150824030019.GD23693@bubble.grove.modra.org> (raw)
In-Reply-To: <CAMe9rOp01ArKXbnZZ-FA4vqQMi87peWLeqzOCQGy2z9yYt0W5Q@mail.gmail.com>

On Sun, Aug 23, 2015 at 07:41:09AM -0700, H.J. Lu wrote:
> My patch improves the generated code by changing
> 
>         movzbl  (%rax), %eax
>         movl    %eax, %edx
>         andl    $3, %edx
>         cmpb    $1, %dl
> 
> to
> 
>         movzbl  (%rax), %eax
>         testb   $1, %al
> 
> for bfd_link_executable (flinfo->info).

This is due to gcc tree-ssa-reassoc.c not considering a single range
test for optimisation to a bit test.  As I said previously, we could
work around this by using
#define bfd_link_executable(info)  (((info)->type & 2) == 0)

That generates good code, and doesn't regress other places like your
patch does (I'm assuming regressions from the size increase), but it
just doesn't seem worth applying this sort of micro-optimisation.

-- 
Alan Modra
Australia Development Lab, IBM

      reply	other threads:[~2015-08-24  3:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-23  2:09 H.J. Lu
2015-08-23 13:50 ` Alan Modra
2015-08-23 14:41   ` H.J. Lu
2015-08-24  3:00     ` Alan Modra [this message]

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=20150824030019.GD23693@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.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).