Elimination of all floating point code in the tiny assembler
Nick Clifton
nickc@redhat.com
Wed Sep 13 11:18:30 GMT 2023
Hi Jacob,
> GAS has its own floating point code in very high precision. This code is quite cumbersome, and never used. All compilers emit floating point numbers as 32 or 64 bit integers, so, the directives for reading floating point numbers go unused.
Except of course when assembling hand written assembler source code.
You can bet that there is code out there that relies upon this feature
of the assembler.
A second point is that GAS actually has three different versions of the
text-to-float conversion code: atof-generic.c, atof-ieee.c and atof-vax.c.
These are to support the requirements of different architectures. Any
replacement code would ideally remove all three of these implementations,
although of course it would have to take care to not break anything.
Another issue is that the code needs to work when running in a cross
assembly environment. So for example it must work when running on a big
endian host but assembling for a little endian target, or when running
on a 32-bit host assembling for a 64-bit target.
All of which is not to say "don't do this". We absolutely would be
interested in any patches to improve/simplify the assembler. Just please
do consider that the code needs to be portable, paranoid and pleasing.
Cheers
Nick
More information about the Binutils
mailing list