This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Feature request: Set the direction flag on x86/x64 register->register operations
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "Stefan Dösinger" <stefan at codeweavers dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 18 Dec 2008 09:16:10 -0800
- Subject: Re: Feature request: Set the direction flag on x86/x64 register->register operations
- References: <000001c959fc$d3880ff0$7a982fd0$@com>
On Tue, Dec 9, 2008 at 4:51 AM, Stefan Dösinger <stefan@codeweavers.com> wrote:
> Hi,
>
> Here is another version of my patch to set the direction flag on
> register->register operations.
>
> The main change is that it is now controlled by a per-instruction suffix
> instead of a command line switch. Alexandre Julliard didn't like the idea of
> the command line switch, he prefers gcc to control the bit. I have to modify
> gcc to make it generate a "movl %edi, %edi" like Windows has it anyway, so
> going this route is ok for me.
>
> I added a test for this feature which specifically tests the instructions
> that are important to me(mov %edi, %edi and mov %esp, %ebp) and a few more.
> I ran the existing tests with the flag forced on for all instructions, and
> they pass. There are a few false positives obviously because the patch
> changes the encoding, but I checked all of those cases and the code works
> correctly.
>
> I verified the behavior against msvc, and it does set the flag on 8, 16 and
> 32 bit operations for sure. I didn't check 64 bit ones because I do not have
> a 64 bit Windows installation to test, but this is moot now anyway because
> gcc controls the flag. It doesn't affect this patch any longer.
>
Please use "movl.r" instead of "movlr".
BTW, do you have copyright paper with FSF?
Thanks.
--
H.J.