From 10cce66930b3dc0405106bbb62a6d44602bec118 Mon Sep 17 00:00:00 2001 From: "Paul A. Clarke" Date: Fri, 29 Mar 2019 19:16:34 -0500 Subject: [powerpc] Use __builtin_{mffs,mtfsf} Replace inline asm uses of the "mffs" and "mtfsf" instructions with the analogous GCC builtins. __builtin_mffs and __builtin_mtfsf are both available in GCC 5 and above. Given the minimum GCC level for GLibC is now GCC 6.2, it is safe to use these builtins without restriction. 2019-03-29 Paul A. Clarke * sysdeps/powerpc/fpu/fenv_libc.h (fegetenv_register): Replace inline asm with builtin. * sysdeps/powerpc/powerpc64/le/fpu/sfp-machine.h (FP_INIT_ROUNDMODE): Likewise. * sysdeps/powerpc/fpu/tst-setcontext-fpscr.c (_GET_DI_FPSCR): Likewise. (_GET_SI_FPSCR): Likewise. (_SET_SI_FPSCR): Likewise. --- sysdeps/powerpc/fpu/fenv_libc.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sysdeps/powerpc/fpu/fenv_libc.h') diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h index 67a9c9a51a..8a0bace84d 100644 --- a/sysdeps/powerpc/fpu/fenv_libc.h +++ b/sysdeps/powerpc/fpu/fenv_libc.h @@ -32,8 +32,7 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden; /* Equivalent to fegetenv, but returns a fenv_t instead of taking a pointer. */ -#define fegetenv_register() \ - ({ fenv_t env; asm volatile ("mffs %0" : "=f" (env)); env; }) +#define fegetenv_register() __builtin_mffs() /* Equivalent to fesetenv, but takes a fenv_t instead of a pointer. */ #define fesetenv_register(env) \ @@ -45,7 +44,7 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden; "mtfsf 0xff,%0,1,0; " \ ".machine pop" : : "f" (d)); \ else \ - asm volatile ("mtfsf 0xff,%0" : : "f" (d)); \ + __builtin_mtfsf (0xff, d); \ } while(0) /* This very handy macro: -- cgit v1.2.3