public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Eric Bresie <ebresie@gmail.com>
To: Eshan dhawan via Newlib <newlib@sourceware.org>
Subject: Re: [PATCH] Remove multiple defination error
Date: Thu, 23 Jul 2020 06:54:58 -0500	[thread overview]
Message-ID: <1205787e-7423-4387-875e-bc4ad312e25f@Erics-iPhone-X> (raw)
In-Reply-To: 20200710224109.18663-1-eshandhawan51@gmail.com

Just wanted to confirm in the below cases...

Is it suppose to do both vfp and softfp operations when #ifndef SOFTFP_ABI or should it be one or the other?

Eric Bresie
Ebresie@gmail.com
> On July 10, 2020 at 5:41:09 PM CDT, Eshan dhawan via Newlib <newlib@sourceware.org> wrote:
> Signed-off-by: Eshan dhawan <eshandhawan51@gmail.com>
> ---
> newlib/libm/machine/arm/fenv-vfp.c | 7 ++++-
> newlib/libm/machine/arm/fenv.c | 47 +++++++++++++++++++-----------
> 2 files changed, 36 insertions(+), 18 deletions(-)
>
>
> static int
> __softfp_round_to_vfp(int round)
> @@ -171,8 +170,9 @@ __softfp_round_from_vfp(int round)
> int feclearexcept(int excepts)
> {
>
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __vfp_feclearexcept(excepts);
> +#endif
> __softfp_feclearexcept(excepts);
>
> return (0);
> @@ -183,8 +183,9 @@ int fegetexceptflag(fexcept_t *flagp, int excepts)
> fexcept_t __vfp_flagp;
>
> __vfp_flagp = 0;
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __vfp_fegetexceptflag(&__vfp_flagp, excepts);
> +#endif
> __softfp_fegetexceptflag(flagp, excepts);
>
> *flagp |= __vfp_flagp;
> @@ -195,8 +196,9 @@ int fegetexceptflag(fexcept_t *flagp, int excepts)
> int fesetexceptflag(const fexcept_t *flagp, int excepts)
> {
>
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __vfp_fesetexceptflag(flagp, excepts);
> +#endif
> __softfp_fesetexceptflag(flagp, excepts);
>
> return (0);
> @@ -205,8 +207,9 @@ int fesetexceptflag(const fexcept_t *flagp, int excepts)
> int feraiseexcept(int excepts)
> {
>
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __vfp_feraiseexcept(excepts);
> +#endif
> __softfp_feraiseexcept(excepts);
>
> return (0);
> @@ -217,8 +220,9 @@ int fetestexcept(int excepts)
> int __got_excepts;
>
> __got_excepts = 0;
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __got_excepts = __vfp_fetestexcept(excepts);
> +#endif
> __got_excepts |= __softfp_fetestexcept(excepts);
>
> return (__got_excepts);
> @@ -227,16 +231,18 @@ int fetestexcept(int excepts)
> int fegetround(void)
> {
>
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> return __softfp_round_from_vfp(__vfp_fegetround());
> +#endif
> return __softfp_fegetround();
> }
>
> int fesetround(int round)
> {
>
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __vfp_fesetround(__softfp_round_to_vfp(round));
> +#endif
> __softfp_fesetround(round);
>
> return (0);
> @@ -247,8 +253,9 @@ int fegetenv(fenv_t *envp)
> fenv_t __vfp_envp;
>
> __vfp_envp = 0;
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __vfp_fegetenv(&__vfp_envp);
> +#endif
> __softfp_fegetenv(envp);
> *envp |= __vfp_envp;
>
> @@ -260,8 +267,9 @@ int feholdexcept(fenv_t *envp)
> fenv_t __vfp_envp;
>
> __vfp_envp = 0;
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __vfp_feholdexcept(&__vfp_envp);
> +#endif
> __softfp_feholdexcept(envp);
> *envp |= __vfp_envp;
>
> @@ -271,8 +279,9 @@ int feholdexcept(fenv_t *envp)
> int fesetenv(const fenv_t *envp)
> {
>
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __vfp_fesetenv(envp);
> +#endif
> __softfp_fesetenv(envp);
>
> return (0);
> @@ -281,8 +290,9 @@ int fesetenv(const fenv_t *envp)
> int feupdateenv(const fenv_t *envp)
> {
>
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __vfp_feupdateenv(envp);
> +#endif
> __softfp_feupdateenv(envp);
>
> return (0);
> @@ -293,8 +303,9 @@ int feenableexcept(int __mask)
> int __unmasked;
>
> __unmasked = 0;
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __unmasked = __vfp_feenableexcept(__mask);
> +#endif
> __unmasked |= __softfp_feenableexcept(__mask);
>
> return (__unmasked);
> @@ -305,8 +316,9 @@ int fedisableexcept(int __mask)
> int __unmasked;
>
> __unmasked = 0;
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __unmasked = __vfp_fedisableexcept(__mask);
> +#endif
> __unmasked |= __softfp_fedisableexcept(__mask);
>
> return (__unmasked);
> @@ -317,8 +329,9 @@ int fegetexcept(void)
> int __unmasked;
>
> __unmasked = 0;
> - if (_libc_arm_fpu_present)
> +#ifndef SOFTFP_ABI
> __unmasked = __vfp_fegetexcept();
> +#endif
> __unmasked |= __softfp_fegetexcept();
>
> return (__unmasked);
> --
> 2.17.1
>

             reply	other threads:[~2020-07-23 11:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 11:54 Eric Bresie [this message]
2020-07-23 12:04 ` Sebastian Huber
  -- strict thread matches above, loose matches on Subject: below --
2020-07-10 22:41 Eshan dhawan
2020-07-11 15:16 ` Sebastian Huber
2020-07-11 17:18   ` Eshan Dhawan
2020-07-13  5:36     ` Sebastian Huber
2020-07-13  5:48       ` Sebastian Huber
2020-07-14 13:11         ` Joel Sherrill
2020-07-14 16:59           ` Jim Wilson
2020-07-14 17:51             ` Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1205787e-7423-4387-875e-bc4ad312e25f@Erics-iPhone-X \
    --to=ebresie@gmail.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).