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


On Fri, Dec 19, 2008 at 1:07 AM, Jan Beulich <jbeulich@novell.com> wrote:
>>>> Stefan Dösinger<stefan@codeweavers.com> 19.12.08 01:52 >>>
>>I had to regenerate opcodes/i386-tbl.h, but now it works like a charm!
>>Objdump also disassembles the opcodes properly with the .r suffix
>
> I would strongly suggest to print to .r only with -Msuffix.

Good point. I will do that.

> Also, the whole thing seems half-baked to me, as it only deals with
> alternative encodings using the 'D' bit. Using an .a suffix and handling

".r" handles insns which can be encoded differently by swapping operands
in encoding:

	fadd	%st,%st
	fadd.r	%st,%st
	fdiv	%st,%st
	fdiv.r	%st,%st
	fsub	%st,%st
	fsub.r	%st,%st
	fsubr	%st,%st
	fsubr.r	%st,%st
	mov %al, %dl
	mov.r %al, %dl
	mov %ax, %dx
	mov.r %ax, %dx
	mov %eax, %edx
	mov.r %eax, %edx
	movapd	%xmm1, %xmm2
	movapd.r	%xmm1, %xmm2
	movaps	%xmm1, %xmm2
	movaps.r	%xmm1, %xmm2
	movdqa	%xmm1, %xmm2
	movdqa.r	%xmm1, %xmm2
	movdqu	%xmm1, %xmm2
	movdqu.r	%xmm1, %xmm2
	vmovapd	%xmm1, %xmm2
	vmovapd.r	%xmm1, %xmm2
	vmovaps	%xmm1, %xmm2
	vmovaps.r	%xmm1, %xmm2
	vmovdqa	%xmm1, %xmm2
	vmovdqa.r	%xmm1, %xmm2
	vmovdqu	%xmm1, %xmm2
	vmovdqu.r	%xmm1, %xmm2
	vmovapd	%ymm1, %ymm2
	vmovapd.r	%ymm1, %ymm2
	vmovaps	%ymm1, %ymm2
	vmovaps.r	%ymm1, %ymm2
	vmovdqa	%ymm1, %ymm2
	vmovdqa.r	%ymm1, %ymm2
	vmovdqu	%ymm1, %ymm2
	vmovdqu.r	%ymm1, %ymm2

I think  ".s" a better name. I will change ".r" to ".s".

> all cases would come closer (the question is whether there's any insn
> that can be encoded in more than two ways).
>

Many insns have more than one encoding. I will add ".i32" and ".d32" for
32bit immediate and displacement.



-- 
H.J.


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