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/Intel: correct MOVSD and CMPSD handling


On 06.11.2019 16:58, H.J. Lu wrote:
> On Wed, Nov 6, 2019 at 5:23 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 06.11.2019 01:12, H.J. Lu wrote:
>>> On Fri, Oct 4, 2019 at 12:45 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>>
>>>> First and foremost the EsSeg attribute was misplaced for CMPSD. Then
>>>> both it and MOVSD were lacking Dword on both of their operands.
>>>> Finally string insns with multiple operands and requiring use of ES:
>>>> had the wrong operand number reported in the diagnostic.
>>>>
>>>> gas/
>>>> 2019-10-04  Jan Beulich  <jbeulich@suse.com>
>>>>
>>>>         * config/tc-i386.c (check_string): Make reported operand number
>>>>         depend on Intel syntax.
>>>>         * testsuite/gas/i386/intel-cmps.s,
>>>>         testsuite/gas/i386/intel-cmps32.d,
>>>>         testsuite/gas/i386/intel-cmps64.d: New.
>>>>         * testsuite/gas/i386/i386.exp: Run new tests.
>>>>         * testsuite/gas/i386/intel-movs.s: Extend.
>>>>         * testsuite/gas/i386/intel-movs32.d,
>>>>         testsuite/gas/i386/intel-movs64.d: Adjust expectations.
>>>>         * testsuite/gas/i386/string-bad.l: Tighten expectations.
>>>>
>>>> opcodes/
>>>> 2019-10-04  Jan Beulich  <jbeulich@suse.com>
>>>>
>>>>         * opcodes/i386-opc.tbl (movsd): Add Dword and IgnoreSize.
>>>>         (cmpsd): Likewise. Move EsSeg to other operand.
>>>>         * opcodes/i386-tbl.h: Re-generate.
>>>>
>>>
>>> This breaks:
>>>
>>> [hjl@gnu-skx-1 build-x86_64-linux]$ cat x.s
>>> .code16
>>> rep; movsd
>>> [hjl@gnu-skx-1 build-x86_64-linux]$ gcc -c -m32 x.s
>>> [hjl@gnu-skx-1 build-x86_64-linux]$ objdump -dw -Mi8086 x.o
>>>
>>> x.o:     file format elf32-i386
>>>
>>>
>>> Disassembly of section .text:
>>>
>>> 00000000 <.text>:
>>>    0: f3 66 a5              rep movsl %ds:(%si),%es:(%di)
>>> [hjl@gnu-skx-1 build-x86_64-linux]$ gcc -c -m32 x.s -B/bin/
>>> [hjl@gnu-skx-1 build-x86_64-linux]$ objdump -dw -Mi8086 x.o
>>>
>>> x.o:     file format elf32-i386
>>>
>>>
>>> Disassembly of section .text:
>>>
>>> 00000000 <.text>:
>>>    0: f3 a5                rep movsw %ds:(%si),%es:(%di)  <<<<<<< This is wrong.
>>
>> I suppose that's the IgnoreSize that I mistakenly added also to
>> the operand-less forms. You've already approved this as a separate
> 
> It is wrong for both forms.

But it is helpful to know that the operand-less form can be fixed
by simply dropping the bad IgnoreSize. I think I also see what needs
changing for the forms with operands, but I have to yet try it out.
Also I will want to further extend the intel-cmps and intel-movs
test cases, which is going to take a little more time.

Jan


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