[PATCH 3/5] i386: Align branches within a fixed boundary
Jan Beulich
jbeulich@suse.com
Wed Nov 20 09:07:00 GMT 2019
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
More information about the Binutils
mailing list