This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [PATH] AMD MWAITX enablement
- From: "Pawar, Amit" <Amit dot Pawar at amd dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, Jan Beulich <JBeulich at suse dot com>
- Date: Fri, 26 Jun 2015 16:32:50 +0000
- Subject: RE: [PATH] AMD MWAITX enablement
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none;
- References: <0428E25D138CAA4D819A6FED9429E51AF4A29C at SCYBEXDAG02 dot amd dot com> <556D83DE02000078000800CE at mail dot emea dot novell dot com> <0428E25D138CAA4D819A6FED9429E51AF4A96C at SCYBEXDAG02 dot amd dot com> <55755AD50200007800081CE1 at mail dot emea dot novell dot com> <0428E25D138CAA4D819A6FED9429E51AF4CB28 at SCYBEXDAG02 dot amd dot com> <CAMe9rOocBnj6cEvcPLOg1cqm69bQgv1hC+9z-PP28TW3YCJRVA at mail dot gmail dot com> <0428E25D138CAA4D819A6FED9429E51AF4CBC5 at SCYBEXDAG02 dot amd dot com> <CAMe9rOpA=cZLNeAE0-kag8oU8hOJLubArHFZFEbmFnT7VeYrzQ at mail dot gmail dot com> <0428E25D138CAA4D819A6FED9429E51AF4CC18 at SCYBEXDAG02 dot amd dot com> <CAMe9rOogt0E+KrGwHcFWeyeTO-urVbT3K-NsOQaPDtZtU6heQg at mail dot gmail dot com> <0428E25D138CAA4D819A6FED9429E51AF4CC42 at SCYBEXDAG02 dot amd dot com> <CAMe9rOp0ELpkHcapKMEid7Egr0+N70L9TscitPXNg0od3OffJw at mail dot gmail dot com> <0428E25D138CAA4D819A6FED9429E51AF4CC6E at SCYBEXDAG02 dot amd dot com> <CAMe9rOq-Wz_bEEznq_Fq--LCpQ89PRqU8y78mRhnW6NnH_ob=w at mail dot gmail dot com>
-----Original Message-----
From: H.J. Lu [mailto:hjl.tools@gmail.com]
Sent: Friday, June 26, 2015 10:00 PM
To: Pawar, Amit
Cc: binutils@sourceware.org; Jan Beulich
Subject: Re: [PATH] AMD MWAITX enablement
On Fri, Jun 26, 2015 at 9:26 AM, Pawar, Amit <Amit.Pawar@amd.com> wrote:
>
> On Fri, Jun 26, 2015 at 8:00 AM, Pawar, Amit <Amit.Pawar@amd.com> wrote:
>>
>> Comments are fixed and please suggest how to allow following
>> instructions without operands
>>
>> --- Required ----
>> label:
>> monitorx
>> mwaitx
>> --------------------
>>
>> ---- Accepted----
>> monitorx %eax, %ecx, %edx
>> mwaitx %eax, %ecx, %ebx
>> --------------------
>> by adding following code
>>
>> if (i.operands != 3)
>> abort ();
>>
>>
>> -----Original Message-----
>> From: H.J. Lu [mailto:hjl.tools@gmail.com]
>> Sent: Friday, June 26, 2015 5:26 PM
>> To: Pawar, Amit
>> Cc: binutils@sourceware.org; Jan Beulich
>> Subject: Re: [PATH] AMD MWAITX enablement
>>
>> On Fri, Jun 26, 2015 at 4:09 AM, Pawar, Amit <Amit.Pawar@amd.com> wrote:
>>>
>>> Operand check is required at that line as instructions MONITORX/MWAITX are accepted without operands also.
>>
>> Add
>
> You have
>
> if (i.tm.cpu_flags.bitfield.cpumwaitx && i.operands > 0)
> {
> ....
> }
> [Pawar, Amit] This condition was included to handle mwaitx cpu
> instructions with more than zero operands and skips for zero operands.
>
> If i.operands == 0, you won't reach
>>[Pawar, Amit] Zero operands instruction are allowed but should not
>>enter here as it will get
> handled by normal code.
>
> if (i.operands != 3)
> abort ();
> [Pawar, Amit] Will throw error for zero operand instructions, as this
> is inside if case and which is not required here.
I meant
if (i.tm.cpu_flags.bitfield.cpumwaitx && i.operands > 0)
{
if (i.operands != 3)
abort ();
...
}
[Pawar, Amit] This will handle. Will send the updated patch. Thanks
--
H.J.