Bug 3183 - gas doesn't handle integers in fp instructions correctly
Summary: gas doesn't handle integers in fp instructions correctly
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: pre-2.15
: P2 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-07 09:04 UTC by Miro Kropacek
Modified: 2022-06-22 06:23 UTC (History)
1 user (show)

See Also:
Host: m68k/freemint
Target: m68k/freemint
Build: m68k/freemint
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miro Kropacek 2006-09-07 09:04:14 UTC
Concretly, this bug applies to 2.13.2.1-2 version for FreeMiNT distribution 
(http://sparemint.atariforge.net/sparemint/html/packages/binutils.html).

Try this:

fmove.s #65536,fp0 or
fmove.s #1,fp0 or
fmove.s #16,fp0
etc...

after you assemble it for m68k (I used -m68020-60 switch) the result is crap 
(bad numbers in fp0). I have to write this instead:

fmove.l #65536,fp0
fmove.w #1,fp0
fmove.w #16,fp0

I do apologize if this bug was already fixed but I'm new to all this bug 
reporting...
Comment 1 Vincent Rivière 2010-06-07 21:18:54 UTC
This is not a bug, you used the wrong syntax.

When you write:
        fmove.s #1,fp0
the argument is the binary pattern of the single precision value, and it is 
not what you expect.
For example, the pattern of 1.0f is 0x3f800000. So the following instruction 
is valid and do what you want:
        fmove.s #0x3f800000,fp0
Of course it is not user-friendly.

If you want to use floating-point constants, you must use the 0e prefix. The 
following example is what you expect:
        fmoves #0e1,fp0
It is strictly equivalent to the previous example.

See the documentation here:
http://sourceware.org/binutils/docs-2.20/as/Flonums.html