[PATCH] Separate macro-fusible instructions from not for -mbranches-within-32B-boundaries

Hongtao Liu crazylht@gmail.com
Tue Mar 3 03:40:00 GMT 2020
On Mon, Mar 2, 2020 at 4:32 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 02.03.2020 05:05, Hongtao Liu wrote:
> > Update patch.
>
> >+enum mf_jcc_kind
> >+  {
> >+    mf_jcc_jo = 0,  /* base opcode 0x70  */
>
> Is there a reason for the " = 0" here? Without is, the standard
> still mandates the value to be zero.
>
Yes.
I saw some other places in tc-i386.c where first member of enum is
assigned as 0, and also some without initializer, so i guess when the
enum variable is used as left value such as calculated by (baseopcode
& 0x0e ) >>1, it should be explicitly assigned, otherwise not.
Just my guess.
> >+enum mf_cmp_kind
> >+  {
> >+    mf_cmp_test,  /* test */
> >+    mf_cmp_cmp,  /* cmp */
> >+    mf_cmp_and,  /* and */
> >+    mf_cmp_alu,  /* add/sub */
> >+    mf_cmp_incdec  /* inc/dec */
> >+  };
>
> I saw your reply to my question of why this is 5 instead of 3
> enumerators. Yet I think this being a workaround for something
> that hopefully will be fixed in newer hardware suggests to go
> with the minimal necessary set first, and split enumerators
> only if indeed needed down the road.
Done.
>
> >@@ -8503,6 +8557,9 @@ add_branch_padding_frag_p (enum align_branch_kind *branch_p)
> >       }
> >       else
> >       {
> >+        /* Because J<cc> and JN<cc> share same group in macro-fusible table,
> >+           igore the lowest bit.  */
> >+        *mf_jcc_p = (i.tm.base_opcode - 0x70) >> 1;
>
> May I suggest to use (i.tm.base_opcode & 0x0e) >> 1, to be independent
> of the insn variant presently in i.tm (after all we do dynamically
> update it after copying from the template)?
>
Done.

Update my patch.

> Thanks for doing the other adjustments.
>
> Jan



--
BR,
Hongtao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-According-to-intel-SDM-manual-not-all-compare-flag-m_v2.patch
Type: application/x-patch
Size: 24132 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200303/3df71167/attachment.bin>


More information about the Binutils mailing list