Re: Re: MLton codegen combines divison on arm

Adam Goode <[email protected]>
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <[email protected]>
On 11/13/2010 08:05 AM, Wesley W. Terpstra wrote:
> On Sat, Nov 13, 2010 at 1:27 PM, Adam Goode <[email protected]> wrote:
>> On 11/11/2010 10:49 AM, Wesley W. Terpstra wrote:
>>> On Thu, Nov 11, 2010 at 3:15 PM, Matthew Fluet <[email protected]> wrote:
>>>> Were you able to declare success with the ARM floating-point rounding?
>>> What needs to be done IMO is to turn on the rounding mode support in
>>> libgcc. It's absurd that something as simple as wiring it to a public
>>> symbol is considered a roadblock to fixing this problem. I don't have
>>> the time or energy needed to try and push a change like this through
>>> the sorts of people who gather around libc development.
>>>
>>
>> It is not this simple.
>> If you are using software floating point, then, at a start, you need to hack these files:
> 
> I did say there is some assembler code that doesn't support rounding
> modes which is used in some configurations. However, there is also a
> nice C library in libgcc which DOES support rounding modes. Where that
> is enabled, it IS as simple as exporting a symbol that can control the
> rounding mode.
> 
> I suppose there are people who prefer performance over correctness,
> and these people may prefer the assembler emulation to the C
> emulation. Since both are broken at the moment, I guess there is no
> downside to the assembler variant. If the C variant were fixed, in my
> opinion correctness should trump speed with default compile options.

Well, it isn't really a simple matter to change these things as you've
found. These kinds of decisions are really system-wide and ABI-changing.
And the standard ARM ABI doesn't require rounding modes.

Specifically, switching gcc to emit the soft-fp code (the C version you
mention) into libgcc instead of the ARM assembly version would be a big
change and not well tested. According to gcc/gcc/config/arm/t-elf-arm,
the asm version is used everywhere on ARM except for ARMv6M which uses
soft-fp. After hacking around with GCC, you would then need to recompile
your OS, since libgcc is statically linked on ARM by default.

At that point, you might as well only compile for the newer ARMv7-A
processors and just do something like:
http://wiki.debian.org/ArmHardFloatPort

By the way, this shouldn't be silently failing for you since I made this
change:
http://mlton.org/cgi-bin/viewsvn.cgi?rev=7082&view=rev

... unless of course you are running on a system that actually has
hardware VFP and then you are hitting the glibc bug that will happily
set the rounding mode of the hardware even if your floating point is all
in software.


Adam

_______________________________________________
MLton mailing list
[email protected]
http://mlton.org/mailman/listinfo/mlton
signature.asc (application/pgp-signature, 261 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkzfWUIACgkQlenB4PQRJazsrwCff11ZoQuLDeq+tFnGCAzPHYlO
WRQAoLF/q0dJWH+vuOjCP7cckxshlNFq
=mQe/
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.