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: [PATCH] X86: Disassemble primary opcode map's group 2 ModRM.reg == 6 aliases correctly


On Tue, May 30, 2017 at 7:52 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, May 30, 2017 at 7:48 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>>> On 30.05.17 at 16:43, <hjl.tools@gmail.com> wrote:
>>> On Tue, May 30, 2017 at 7:41 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>>>>> On 30.05.17 at 16:35, <hjl.tools@gmail.com> wrote:
>>>>> On Tue, May 30, 2017 at 1:37 AM, Borislav Petkov <bp@suse.de> wrote:
>>>>>> On Tue, May 30, 2017 at 02:34:28AM -0600, Jan Beulich wrote:
>>>>>>> which I think should read
>>>>>>>
>>>>>>> "The CF flag contains the value of the last bit shifted out of the
>>>>>>>  destination operand; for instructions other than SAR it is undefined
>>>>>>>  when the count is greater than or equal to the size (in bits) of
>>>>>>>  the destination operand."
>>>>>>
>>>>>> Makes sense.
>>>>>
>>>>> I look another look.  Disassembler always display "shl".  Please
>>>>> don't use "sal" now.
>>>>
>>>> Which disassembler are you talking about, as you can't mean
>>>> objdump or anything else that's libopcode-based?
>>>
>>> [hjl@gnu-6 tmp]$ cat x.s
>>> shl %cl, %eax
>>> sal %cl, %eax
>>> shl $1, %eax
>>> sal $1, %eax
>>> [hjl@gnu-6 tmp]$ gcc -c x.s
>>> [hjl@gnu-6 tmp]$ objdump -dw x.o
>>>
>>> x.o:     file format elf64-x86-64
>>>
>>>
>>> Disassembly of section .text:
>>>
>>> 0000000000000000 <.text>:
>>>    0: d3 e0                 shl    %cl,%eax
>>>    2: d3 e0                 shl    %cl,%eax
>>>    4: d1 e0                 shl    %eax
>>>    6: d1 e0                 shl    %eax
>>> [hjl@gnu-6 tmp]$ objdump -dw -Mintel x.o
>>>
>>> x.o:     file format elf64-x86-64
>>>
>>>
>>> Disassembly of section .text:
>>>
>>> 0000000000000000 <.text>:
>>>    0: d3 e0                 shl    eax,cl
>>>    2: d3 e0                 shl    eax,cl
>>>    4: d1 e0                 shl    eax,1
>>>    6: d1 e0                 shl    eax,1
>>> [hjl@gnu-6 tmp]$
>>
>> Right, but here all instructions use the /4 encoding. We're talking
>> about how to display the /6 encoding, though, and I think it would
>> be helpful to the user if she could distinguish one from the other
>> without having to look at the opcode bytes.
>
> This is adjust an opcode alias.  These aren't the only instructions with
> identical opcodes.
>

II meant "the same instruction with different opcodes".


-- 
H.J.


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