Bug 141 - Add support for fixed point constants from floats
Summary: Add support for fixed point constants from floats
Alias: None
Product: RMAC
Classification: Unclassified
Component: Core (show other bugs)
Version: unspecified
Hardware: PC Linux
: Normal enhancement
Assignee: Shamus Hammons
Depends on:
Reported: 2020-01-02 14:25 CST by ggn
Modified: 2020-01-03 09:35 CST (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description ggn 2020-01-02 14:25:28 CST
Continuing from #74:

The idea is simple, something like:

move.l #0.5,d0

could be auto extended to

move.l #$00008000,d0

This is the easiest case where the number of "decimal" digits can be deduced from the width of the instruction (.l for this example).

However we could extend this - for example there can be a global constant (like I dunno, ^^decimaldigits?) that can force the amount of digits for this (with the appropriate checks of course).

Now that most of the floating point stuff is in place, this shouldn't be a big pain to do!
Comment 1 Shamus Hammons 2020-01-03 09:35:26 CST
We could have a regular old directive (maybe something like .fixedpoint NN, where NN is the # of fractional bits) that would also tell the assembler that it was in fixed point mode, and to create constants appropriately.  Would probably need another one to tell it to come out of fixed point mode, maybe .floatpoint to tell it to go back to standard behavior.

At any rate, it should be fairly easy to do, so let's do it!  :-D