This is the mail archive of the binutils@sources.redhat.com 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: i386 intel syntax integer load/store fp instructions


I am in the process of preparing a (quite large) patch to address
several Intel syntax limitations. While I'm mostly done (among the fixes
already there is one for the problem you point out), I'd like to get
this fi... suffixing game right (short of ripping it out entirely based
on the previously made statement that Intel syntax in reality only knows
suffixes for a very small set of instructions where there is no other
way to express the operand size needed), and thus I'd need to understand
the whole picture here. I found
http://sources.redhat.com/ml/binutils/2000-12/msg00088.html which
introduced the current way of handling this. However, I consider this
broken:

- fildd/fistp/fisttp translate to fild/fistp/fisttp qword ptr, whereas
fistd translates to fist word ptr (similar to all the other fi...
instructions)
- fild/fistp/fisttp qword ptr get encoded as fild/fistp/fisttp word
ptr
- there is no suffix for expressing fi... word ptr operations (they get
used only when there is no suffix at all, but generally I consider
something like fiadd [eax] as ambiguous as inc [eax], and as much as the
current IgnoreSize on all f... and a lot of other instructions is, which
I intend to rectify, too)

I would believe that the correct thing would be to treat the 'd' suffix
as meaning 'dword ptr' in all cases, i.e. SHORT_MNEM_SUFFIX for f...
instructions and LONG_MNEM_SUFFIX for fi... instructions.
I'm not sure whether using 's' or 'w' for the missing suffix would be
the right thing, but I think 'w' looks more like Intel syntax.

Still, I'd prefer to do away with suffixes for Intel syntax altogether,
but that's perhaps not acceptable...

Jan

>>> Alan Modra <amodra@bigpond.net.au> 23.06.04 03:24:10 >>>
On Tue, Jun 15, 2004 at 02:14:01PM +0200, Jan Beulich wrote:
> Is there anybody able to provide the origin for fildd, fistpd, and
> fisttpd? It would seem to me that if thus suffixed instructions exist
at
> all in Intel syntax (after all, Intel syntax in general is not known
to
> use suffixes), then these would perhaps rather mean 32-bit
loads/stores
> (currently, gas translates them to 64-bit ones, identical to the
> respective q-suffixed ones).

I forget why I made the change to i386.h as part of this patch
http://sources.redhat.com/ml/binutils-cvs/2000-q1/msg00155.html 

The binutils email archive doesn't seem to contain anything related to
my patch.  The instructions probably should have been removed, as they
duplicate fildq.

Hmm, I see that "fild qword ptr [%esi]" doesn't do the right thing
too.
:-(

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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