public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Hu, Lin1" <lin1.hu@intel.com>
Cc: "Lu, Hongjiu" <hongjiu.lu@intel.com>,
	"binutils@sourceware.org" <binutils@sourceware.org>
Subject: Re: [PATCH][v5] Support Intel USER_MSR
Date: Mon, 30 Oct 2023 09:31:05 +0100	[thread overview]
Message-ID: <260c522e-dbb0-7e40-1419-5bb269fef823@suse.com> (raw)
In-Reply-To: <SJ0PR11MB59403A1BF3F4951FBD576083A6A1A@SJ0PR11MB5940.namprd11.prod.outlook.com>

On 30.10.2023 06:50, Hu, Lin1 wrote:
>>> @@ -5232,8 +5244,23 @@ md_assemble (char *line)
>>>        && (t->mnem_off == MN_extrq || t->mnem_off == MN_insertq))
>>>        swap_2_operands (0, 1);
>>
>> Did you, btw, consider extending this to cater for UWRMSR as well, in place of
>> the new construct at the bottom of match_template()? (I'm not saying it needs
>> to be that way; if you decide to leave things as is, I may later see about folding
>> both.)
>>
> 
> For this part, my current changes are
> 
> @@ -5400,6 +5388,38 @@ md_assemble (char *line)
>        return;
>      }
> 
> +  /* The order of the immediates should be reversed
> +     for 2 immediates extrq and insertq instructions.
> +     And This pattern aims to put the unusually placed imm operand to a usual
> +     place. The constraints are currently only adapted to uwrmsr, and may
> +     need further tweaking when new similar instructions become available.  */
> +  if (i.imm_operands && i.imm_operands < i.operands
> +      && ((t->mnem_off == MN_extrq || t->mnem_off == MN_insertq)
> +         || operand_type_check (i.tm.operand_types[1], imm)))
> +    {
> +      i386_operand_type tmp_operand_type = i.tm.operand_types[0];
> +      i.tm.operand_types[0] = i.tm.operand_types[1];
> +      i.tm.operand_types[1] = tmp_operand_type;
> +      swap_2_operands(0, 1);
> +    }
> 
> after match_template. Some generalization has been reduced to save on code size.
> What's your opinion?

Hmm, why this way, rather than indeed merely extending (without moving)
what's there? (Anyway, as said, I'm not going to insist on this folding;
if you don't want to deal with that right here, I'll see to make a
follow-on change later.)

Jan

  reply	other threads:[~2023-10-30  8:31 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10  7:24 [PATCH] " Hu, Lin1
2023-10-16 12:11 ` Jan Beulich
2023-10-18  7:51   ` Hu, Lin1
2023-10-19  8:36     ` Jan Beulich
2023-10-24  8:38       ` Hu, Lin1
2023-10-24  8:55         ` Jan Beulich
2023-10-24 10:01           ` Hu, Lin1
2023-10-24 12:02             ` Jan Beulich
2023-10-25  2:01               ` Hu, Lin1
2023-10-25  8:48                 ` Jan Beulich
2023-10-25  9:11                   ` [PATCH][v3] " Hu, Lin1
2023-10-25 11:43                     ` Jan Beulich
2023-10-26  6:14                       ` Hu, Lin1
2023-10-26  6:21                       ` [PATCH][v4] " Hu, Lin1
2023-10-26  8:31                         ` Jan Beulich
2023-10-26  9:08                           ` Hu, Lin1
2023-10-26  9:25                             ` Jan Beulich
2023-10-26 10:26                               ` Hu, Lin1
2023-10-27  9:00                               ` [PATCH][v5] " Hu, Lin1
2023-10-27 13:36                                 ` Jan Beulich
2023-10-30  5:50                                   ` Hu, Lin1
2023-10-30  8:31                                     ` Jan Beulich [this message]
2023-10-31  1:43                                       ` Hu, Lin1
2023-10-31  2:14                                       ` [PATCH][v6] " Hu, Lin1
2023-10-31  8:03                                         ` Jan Beulich
2023-10-31  8:35                                           ` Hu, Lin1
2023-11-14  7:14                                         ` Jan Beulich
2023-11-15  3:09                                           ` Hu, Lin1
2023-11-15  3:34                                             ` Jiang, Haochen
2023-11-15  7:36                                               ` Jan Beulich
2023-11-15  7:41                                                 ` Jiang, Haochen
2023-11-15  7:48                                             ` Jan Beulich
     [not found] <2b4a78d3-a4e1-9fc3-c143-63bef46b276d@suse.co>
2023-10-26 11:24 ` [PATCH][v5] " Hu, Lin1

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=260c522e-dbb0-7e40-1419-5bb269fef823@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=hongjiu.lu@intel.com \
    --cc=lin1.hu@intel.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).