This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATH] AMD MWAITX enablement


PFA MWAITX updated patch. Is it OK?

-----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 ();
    ...
  }



--
H.J.

Attachment: mwaitx_v5.patch
Description: mwaitx_v5.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]