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: Feature request: Set the direction flag on x86/x64 register->register operations


Mail ping? Did this get lost?

> -----Original Message-----
> From: binutils-owner@sourceware.org [mailto:binutils-
> owner@sourceware.org] On Behalf Of Stefan Dösinger
> Sent: Tuesday, December 09, 2008 1:51 PM
> To: binutils@sourceware.org
> Subject: RE: Feature request: Set the direction flag on x86/x64
> register->register operations
> 
> 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.
> 
> On Mon, Dec 1, 2008 at 1:42 PM, H.J. Lu <hjl dot tools at gmail dot
> com>
> wrote:
> > Your new patch still doesn't handle movdqu and other instructions,
> > like instructions with more than 1 source operands.
> movdqu doesn't have the D flag set in the opcode table. Still my patch
> now doesn't care about the operand types and just looks at the D flag
> and the possible operands for the template, so from my code's point of
> view it works with movdqu now.
> 
> As for more than 1 source operand: It doesn't seem to me that the
> existing code that deals with the direction flag can works with such
> instructions. In the branch that sets the flag only 2 operands are
> handled.
> 
> Thanks again for your help,
> Stefan



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