mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
fegetenv_and_set_rn now uses the builtins provided by GCC.
On powerpc, SET_RESTORE_ROUND uses inline assembly to optimize the
prologue get/save/set rounding mode operations for POWER9 and
later by using 'mffscrn' where possible, this was introduced by
commit f1c56cdff0
.
GCC version 14 onwards supports builtins as __builtin_set_fpscr_rn
which now returns the FPSCR fields in a double. This feature is
available on Power9 when the __SET_FPSCR_RN_RETURNS_FPSCR__ macro
is defined.
GCC commit ef3bbc69d15707e4db6e2f198c621effb636cc26 adds
this feature.
Changes are done to use __builtin_set_fpscr_rn instead of mffscrn
or mffscrni in __fe_mffscrn(rn).
Suggested-by: Carl Love <cel@us.ibm.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
551101e824
commit
4eac1825ed
1 changed files with 9 additions and 0 deletions
|
@ -68,6 +68,14 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden;
|
|||
__fr; \
|
||||
})
|
||||
|
||||
/* Starting with GCC 14 __builtin_set_fpscr_rn can be used to return the
|
||||
FPSCR fields as a double. This support is available
|
||||
on Power9 when the __SET_FPSCR_RN_RETURNS_FPSCR__ macro is defined.
|
||||
To retain backward compatibility with older GCC, we still retain the
|
||||
old inline assembly implementation.*/
|
||||
#ifdef __SET_FPSCR_RN_RETURNS_FPSCR__
|
||||
#define __fe_mffscrn(rn) __builtin_set_fpscr_rn (rn)
|
||||
#else
|
||||
#define __fe_mffscrn(rn) \
|
||||
({register fenv_union_t __fr; \
|
||||
if (__builtin_constant_p (rn)) \
|
||||
|
@ -83,6 +91,7 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden;
|
|||
} \
|
||||
__fr.fenv; \
|
||||
})
|
||||
#endif
|
||||
|
||||
/* Like fegetenv_control, but also sets the rounding mode. */
|
||||
#ifdef _ARCH_PWR9
|
||||
|
|
Loading…
Add table
Reference in a new issue