public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Enable libgcc floating point emulation routines
@ 2020-10-21 20:27 William Tambe
  2020-10-21 23:36 ` Jim Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: William Tambe @ 2020-10-21 20:27 UTC (permalink / raw)
  To: gcc-help

For a specific platform, what is the proper way to enable the floating
point emulation routines described at ?
https://gcc.gnu.org/onlinedocs/gccint/Soft-float-library-routines.html#Soft-float-library-routines

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Enable libgcc floating point emulation routines
  2020-10-21 20:27 Enable libgcc floating point emulation routines William Tambe
@ 2020-10-21 23:36 ` Jim Wilson
  2020-10-22  2:48   ` William Tambe
  0 siblings, 1 reply; 6+ messages in thread
From: Jim Wilson @ 2020-10-21 23:36 UTC (permalink / raw)
  To: William Tambe; +Cc: gcc-help

On Wed, Oct 21, 2020 at 1:27 PM William Tambe via Gcc-help <
gcc-help@gcc.gnu.org> wrote:

> For a specific platform, what is the proper way to enable the floating
> point emulation routines described at ?
>
> https://gcc.gnu.org/onlinedocs/gccint/Soft-float-library-routines.html#Soft-float-library-routines


In libgcc/config.host, add one of the t-softfp* files to tmake_file for
your host.  There are a number of choices, depending on exactly which modes
you need support for, and exactly which modes are implemented in hardware.
E.g. a target with no FP hardware and no 128-bit long double needs only
soft-float sf and df.  A target with FP hardware that supports 32-bit float
only, and supports 128-bit long double, needs soft-float df and tf.  Etc.
See the various target independent and target dependent t-softfp files and
pick one that matches your situation.

Jim

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Enable libgcc floating point emulation routines
  2020-10-21 23:36 ` Jim Wilson
@ 2020-10-22  2:48   ` William Tambe
  2020-10-22  3:40     ` William Tambe
  2020-10-23 19:33     ` Jim Wilson
  0 siblings, 2 replies; 6+ messages in thread
From: William Tambe @ 2020-10-22  2:48 UTC (permalink / raw)
  To: Jim Wilson; +Cc: gcc-help

On Wed, Oct 21, 2020 at 6:36 PM Jim Wilson <jimw@sifive.com> wrote:
>
> On Wed, Oct 21, 2020 at 1:27 PM William Tambe via Gcc-help <gcc-help@gcc.gnu.org> wrote:
>>
>> For a specific platform, what is the proper way to enable the floating
>> point emulation routines described at ?
>> https://gcc.gnu.org/onlinedocs/gccint/Soft-float-library-routines.html#Soft-float-library-routines
>
>
> In libgcc/config.host, add one of the t-softfp* files to tmake_file for your host.  There are a number of choices, depending on exactly which modes you need support for, and exactly which modes are implemented in hardware.  E.g. a target with no FP hardware and no 128-bit long double needs only soft-float sf and df.  A target with FP hardware that supports 32-bit float only, and supports 128-bit long double, needs soft-float df and tf.  Etc.  See the various target independent and target dependent t-softfp files and pick one that matches your situation.

In libgcc/config.host we currently have:
tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp"

However, compiling a program that uses __mulsf3() throws the following error:
error: implicit declaration of function ‘__mulsf3’; did you mean
‘__mulsc3’? [-Werror=implicit-function-declaration]

Compilation is done using -nostdlib -lgcc

Any idea what else is missing ?

>
> Jim
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Enable libgcc floating point emulation routines
  2020-10-22  2:48   ` William Tambe
@ 2020-10-22  3:40     ` William Tambe
  2020-10-23 19:34       ` Jim Wilson
  2020-10-23 19:33     ` Jim Wilson
  1 sibling, 1 reply; 6+ messages in thread
From: William Tambe @ 2020-10-22  3:40 UTC (permalink / raw)
  To: Jim Wilson; +Cc: gcc-help

On Wed, Oct 21, 2020 at 9:48 PM William Tambe <tambewilliam@gmail.com> wrote:
>
> On Wed, Oct 21, 2020 at 6:36 PM Jim Wilson <jimw@sifive.com> wrote:
> >
> > On Wed, Oct 21, 2020 at 1:27 PM William Tambe via Gcc-help <gcc-help@gcc.gnu.org> wrote:
> >>
> >> For a specific platform, what is the proper way to enable the floating
> >> point emulation routines described at ?
> >> https://gcc.gnu.org/onlinedocs/gccint/Soft-float-library-routines.html#Soft-float-library-routines
> >
> >
> > In libgcc/config.host, add one of the t-softfp* files to tmake_file for your host.  There are a number of choices, depending on exactly which modes you need support for, and exactly which modes are implemented in hardware.  E.g. a target with no FP hardware and no 128-bit long double needs only soft-float sf and df.  A target with FP hardware that supports 32-bit float only, and supports 128-bit long double, needs soft-float df and tf.  Etc.  See the various target independent and target dependent t-softfp files and pick one that matches your situation.
>
> In libgcc/config.host we currently have:
> tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp"

I ended up using:
tmake_file="${tmake_file} t-fpbit"
and it worked.

What is the difference between t-fpbit and t-softfp* ?

>
> However, compiling a program that uses __mulsf3() throws the following error:
> error: implicit declaration of function ‘__mulsf3’; did you mean
> ‘__mulsc3’? [-Werror=implicit-function-declaration]
>
> Compilation is done using -nostdlib -lgcc
>
> Any idea what else is missing ?
>
> >
> > Jim
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Enable libgcc floating point emulation routines
  2020-10-22  2:48   ` William Tambe
  2020-10-22  3:40     ` William Tambe
@ 2020-10-23 19:33     ` Jim Wilson
  1 sibling, 0 replies; 6+ messages in thread
From: Jim Wilson @ 2020-10-23 19:33 UTC (permalink / raw)
  To: William Tambe; +Cc: gcc-help

On Wed, Oct 21, 2020 at 7:48 PM William Tambe <tambewilliam@gmail.com>
wrote:

> However, compiling a program that uses __mulsf3() throws the following
> error:
> error: implicit declaration of function ‘__mulsf3’; did you mean
> ‘__mulsc3’? [-Werror=implicit-function-declaration]
>

__mulsf3 isn't a user visible function.  Instead of trying to call it, use
the '*' multiply operator and the compiler will call it for you.

Jim

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Enable libgcc floating point emulation routines
  2020-10-22  3:40     ` William Tambe
@ 2020-10-23 19:34       ` Jim Wilson
  0 siblings, 0 replies; 6+ messages in thread
From: Jim Wilson @ 2020-10-23 19:34 UTC (permalink / raw)
  To: William Tambe; +Cc: gcc-help

On Wed, Oct 21, 2020 at 8:41 PM William Tambe <tambewilliam@gmail.com>
wrote:

> What is the difference between t-fpbit and t-softfp* ?


t-fpbit is for 8-bit targets that support float but not double.

Jim

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-23 19:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 20:27 Enable libgcc floating point emulation routines William Tambe
2020-10-21 23:36 ` Jim Wilson
2020-10-22  2:48   ` William Tambe
2020-10-22  3:40     ` William Tambe
2020-10-23 19:34       ` Jim Wilson
2020-10-23 19:33     ` Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).