This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 3/5] i386: Align branches within a fixed boundary
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Beulich <jbeulich at suse dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 3 Dec 2019 11:10:09 -0800
- Subject: Re: [PATCH 3/5] i386: Align branches within a fixed boundary
- References: <20191112161905.10048-1-hjl.tools@gmail.com> <20191112161905.10048-4-hjl.tools@gmail.com> <d053d48c-7726-c177-c4f2-f91a4a64160d@suse.com> <CAMe9rOqru4pY+peF6dJFQJG8=b+yY455Y81YUoNgb0LzyTXQ=Q@mail.gmail.com> <7800306d-073a-0fe3-3b55-9425364ab6ff@suse.com> <CAMe9rOorO1ooP6An=azW+az+Pww7hfU41Hjxq5ukM48Zd0yFCg@mail.gmail.com> <31d5b485-a64a-5f3e-8c42-7a37b32b8cfc@suse.com> <aa2b4d94-ff06-5c6f-6f57-1a9ebade816c@suse.com>
On Wed, Nov 20, 2019 at 1:07 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 18.11.2019 11:50, Jan Beulich wrote:
> > On 16.11.2019 00:11, H.J. Lu wrote:
> >> On Fri, Nov 15, 2019 at 1:16 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>> On 15.11.2019 00:21, H.J. Lu wrote:
> >>>> On Wed, Nov 13, 2019 at 5:15 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>>>> On 12.11.2019 17:19, H.J. Lu wrote:
> >>>>> Like elsewhere I think you want to use i.tm checks here. This
> >>>>> would also eliminate my worry of the code not catching cases
> >>>>> where optimization changes the opcode in i.tm without also
> >>>>> changing the name.
> >>>>
> >>>> It don't think CMP instructions can be replaced by totally different
> >>>> instructions.
> >>>
> >>> But there's also e.g. AND in the set, which I would expect
> >>> optimization to be able to switch _to_ (not from, as you were
> >>> implying).
> >>
> >> What other instructions can be encoded as AND?
> >
> > I didn't say there _are_ such optimizations, but I wouldn't exclude
> > there might be in the future. Other aspects of the patch already
> > suggested that the combination of these new options and the
> > optimization ones may not have been fully taken into consideration
> > on this first version of the patch. I'd simply be afraid of such
> > aspect to be overlooked later on (when adding further optimizations)
> > as well. Yet the changes here are useful only if they indeed manage
> > to cover _all_ problematic code sequences, not just most of them.
>
> Actually AND isn't the best example. TEST is even better. We
> already have such an optimization: We translate various OR and
> AND to TEST. If you want to catch these TESTs, then you either
> need to make optimize_encoding() update the insn's name, or
> (preferable imo) recognize insns here by looking at the opcodes.
>
> Jan
I submitted a new set of patches:
https://sourceware.org/ml/binutils/2019-12/msg00035.html
https://sourceware.org/ml/binutils/2019-12/msg00032.html
https://sourceware.org/ml/binutils/2019-12/msg00038.html
https://sourceware.org/ml/binutils/2019-12/msg00039.html
https://sourceware.org/ml/binutils/2019-12/msg00037.html
--
H.J.