On 2024-07-03 17:59, Jeff Law wrote:
On 7/3/24 3:59 AM, Sébastien Michelland wrote:
libgcc's fp-bit.c is quite slow and most modern/developed architectures
have switched to using the soft-fp library. This patch does so for
free-standing/unknown-OS SH3/SH4 builds, using soft-fp's default parameters
for the most part, most notably no exceptions.

A quick run of Whetstone (built with OpenLibm) on an SH4 machine shows
about x3 speedup (~320 -> 1050 Kwhets/s).

I'm sending this as RFC because I'm quite unsure about testing. I built
the compiler and ran the benchmark, but I don't know if GCC has a test
for soft-fp correctness and whether I can run that in my non-hosted
environment. Any advice?

Cheers,
Sébastien

libgcc/ChangeLog:

         * config.host: Use soft-fp library for non-hosted SH3/SH4
         instead of fpdbit.
         * config/sh/sfp-machine.h: New.
I'd really like to hear from Oleg on this, though given we're using the soft-fp library on other targets it seems reasonable at a high level.

As far as testing, the GCC testsuite has some FP components which would implicitly test soft fp on any target that doesn't have hardware floating point.

Thank you. I went this route, following the guide [1] and the instructions for cross-compiling [2] before hitting "Newlib does not support CPU sh3eb" which I should have seen coming.

There are plenty of random ports lying around but just grabbing one doesn't feel right (and I don't have a canonical one to go to as I usually run a custom libc for... mostly bad reasons).

Deferring maybe again to the few SH users... how do you usually do it?

Sébastien

[1] https://gcc.gnu.org/install/test.html
[2] https://gcc.gnu.org/simtest-howto.html

Reply via email to