This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: [PATCH] Add type_unknown/type_executable/type_pic to output_type


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


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