From: "Pawar, Amit" <Amit.Pawar@amd.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "binutils@sourceware.org" <binutils@sourceware.org>,
Jan Beulich <JBeulich@suse.com>
Subject: RE: [PATH] AMD MWAITX enablement
Date: Fri, 26 Jun 2015 05:46:00 -0000 [thread overview]
Message-ID: <0428E25D138CAA4D819A6FED9429E51AF4CBC5@SCYBEXDAG02.amd.com> (raw)
In-Reply-To: <CAMe9rOocBnj6cEvcPLOg1cqm69bQgv1hC+9z-PP28TW3YCJRVA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2575 bytes --]
PFA MWAITX fixed patch. OK to apply?
-----Original Message-----
From: H.J. Lu [mailto:hjl.tools@gmail.com]
Sent: Thursday, June 25, 2015 2:56 PM
To: Pawar, Amit
Cc: binutils@sourceware.org; Jan Beulich
Subject: Re: [PATH] AMD MWAITX enablement
On Thu, Jun 25, 2015 at 12:55 AM, Pawar, Amit <Amit.Pawar@amd.com> wrote:
> PFA MWAITX rebase patch without generated header files. Is ok to apply?
>
> Regards,
> Amit
+ if (i.tm.cpu_flags.bitfield.cpumwaitx && i.operands > 0)
+ {
+ /* MONITORX/MWAITX instructions have fixed operands with an opcode
+ suffix which is coded in the same place as an 8-bit immediate field
+ would be.
+ Here we check those operands and remove them afterwards. */
^^^^
Align it with "would be".
+ unsigned int x;
+
+ if (strcmp(i.tm.name, "mwaitx") == 0)
+ {
+ x = 0;
+ if (register_number (i.op[x].regs) != x)
+ as_bad (_("can't use register '%s%s' as operand %d in '%s'."),
+ register_prefix, i.op[x].regs->reg_name, x + 1,
+ i.tm.name);
+
+ x++;
+ if (register_number (i.op[x].regs) != x)
+ as_bad (_("can't use register '%s%s' as operand %d in '%s'."),
+ register_prefix, i.op[x].regs->reg_name, x + 1,
+ i.tm.name);
+
+ x++;
+ if (register_number (i.op[x].regs) != x+1)
+ as_bad (_("can't use register '%s%s' as operand %d in '%s'."),
+ register_prefix, i.op[x].regs->reg_name, x + 1,
+ i.tm.name);
+
+ }
+ else
+ {
+ for (x = 0; x < i.operands; x++)
+ if (register_number (i.op[x].regs) != x)
+ as_bad (_("can't use register '%s%s' as operand %d in '%s'."),
+ register_prefix, i.op[x].regs->reg_name, x + 1,
+ i.tm.name);
+ }
+
+ i.operands = 0;
+ }
+
Please use a single for loop and fix indentation like
if (
{
if (
{
H.J.
static void
+OP_Mwaitx (int bytemode ATTRIBUTE_UNUSED,
+ int sizeflag ATTRIBUTE_UNUSED)
+{
+ /* mwait %eax,%ecx */
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Please fix comments.
+ if (!intel_syntax)
+ {
+ const char **names = (address_mode == mode_64bit
+ ? names64 : names32);
+ strcpy (op_out[0], names[0]);
+ strcpy (op_out[1], names[1]);
+ strcpy (op_out[2], names[3]);
+ two_source_ops = 1;
+ }
+ /* Skip mod/rm byte. */
+ MODRM_CHECK;
+ codep++;
+}
+
--
H.J.
[-- Attachment #2: mwaitx_v3.patch.bz2 --]
[-- Type: application/octet-stream, Size: 5228 bytes --]
next prev parent reply other threads:[~2015-06-26 5:46 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 6:56 Pawar, Amit
2015-06-02 8:22 ` Jan Beulich
2015-06-02 13:35 ` Pawar, Amit
2015-06-08 6:16 ` Pawar, Amit
2015-06-08 7:05 ` Jan Beulich
2015-06-10 9:37 ` Pawar, Amit
2015-06-25 7:55 ` Pawar, Amit
2015-06-25 9:26 ` H.J. Lu
2015-06-26 5:46 ` Pawar, Amit [this message]
2015-06-26 10:04 ` H.J. Lu
2015-06-26 11:09 ` Pawar, Amit
2015-06-26 11:55 ` H.J. Lu
2015-06-26 15:00 ` Pawar, Amit
2015-06-26 15:04 ` H.J. Lu
2015-06-26 16:26 ` Pawar, Amit
2015-06-26 16:30 ` H.J. Lu
2015-06-26 16:33 ` Pawar, Amit
2015-06-26 16:39 ` Pawar, Amit
2015-06-26 16:43 ` H.J. Lu
2015-06-26 16:52 ` Pawar, Amit
2015-06-26 18:02 ` Andreas Schwab
2015-06-27 5:20 ` Pawar, Amit
2015-06-30 6:58 ` Pawar, Amit
2015-06-30 14:53 ` H.J. Lu
2015-06-30 15:39 ` Pawar, Amit
2015-06-26 17:06 ` Pawar, Amit
2015-06-26 17:08 ` H.J. Lu
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=0428E25D138CAA4D819A6FED9429E51AF4CBC5@SCYBEXDAG02.amd.com \
--to=amit.pawar@amd.com \
--cc=JBeulich@suse.com \
--cc=binutils@sourceware.org \
--cc=hjl.tools@gmail.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).