Removing RTTI from binaries
Jens Bauer via D.gnu
d.gnu at puremagic.com
Thu Apr 30 07:34:19 PDT 2015
On Thursday, 30 April 2015 at 14:27:17 UTC, Jens Bauer wrote:
> {snip} or make a 32-bit uniqueID (perhaps even a 16-bit UID).
Note: The most frequently used typeinfo should have the lowest ID
numbers, because on small devices, loading a small value into a
register, will use very little space.
Of course, an 8-bit value can be supported on most systems.
On ARM Cortex-M3 and later, we have several ways of loading small
values. One is the 'modified immediate', which is one of the
following:
(8-bit value) << (0 ..24)
(8-bit value) * 0x00010001
(8-bit value) * 0x01000100
(8-bit value) * 0x01010101
Then there's a 16-bit load using movw.
Both modified immediate and movw uses 32-bit instructions, but a
direct 8-bit value can be loaded using the 16-bit mov.n
instruction (also on Cortex-M0).
... My point is that if sorting things like UniqueIDs would
result in smaller binaries.
More information about the D.gnu
mailing list