public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] S390: Fix _FPU_SETCW/GETCW when compiling with Clang [BZ #30130]
@ 2023-02-28 12:48 Andreas Arnez
  2023-02-28 13:05 ` Stefan Liebler
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Arnez @ 2023-02-28 12:48 UTC (permalink / raw)
  To: libc-alpha; +Cc: Stefan Liebler

The _FPU_SETCW and _FPU_GETCW macros are defined with inline assemblies.
They use the sfpc and efpc instructions, respectively.  But both contain
a spurious second operand that leads to a compile error with Clang.
Removing this operand works both with gcc/gas (since binutils 2.18) as
well as with clang/llvm.
---
 sysdeps/s390/fpu/fpu_control.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/s390/fpu/fpu_control.h b/sysdeps/s390/fpu/fpu_control.h
index e00d7775f4..567b180034 100644
--- a/sysdeps/s390/fpu/fpu_control.h
+++ b/sysdeps/s390/fpu/fpu_control.h
@@ -32,8 +32,8 @@
 typedef unsigned int fpu_control_t;
 
 /* Macros for accessing the hardware control word.  */
-#define _FPU_GETCW(cw)  __asm__ __volatile__ ("efpc %0,0" : "=d" (cw))
-#define _FPU_SETCW(cw)  __asm__ __volatile__ ("sfpc  %0,0" : : "d" (cw))
+#define _FPU_GETCW(cw)  __asm__ __volatile__ ("efpc %0" : "=d" (cw))
+#define _FPU_SETCW(cw)  __asm__ __volatile__ ("sfpc %0" : : "d" (cw))
 
 /* Default control word set at startup.  */
 extern fpu_control_t __fpu_control;
-- 
2.39.1


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

* Re: [PATCH] S390: Fix _FPU_SETCW/GETCW when compiling with Clang [BZ #30130]
  2023-02-28 12:48 [PATCH] S390: Fix _FPU_SETCW/GETCW when compiling with Clang [BZ #30130] Andreas Arnez
@ 2023-02-28 13:05 ` Stefan Liebler
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Liebler @ 2023-02-28 13:05 UTC (permalink / raw)
  To: Andreas Arnez, libc-alpha

On 28.02.23 13:48, Andreas Arnez wrote:
> The _FPU_SETCW and _FPU_GETCW macros are defined with inline assemblies.
> They use the sfpc and efpc instructions, respectively.  But both contain
> a spurious second operand that leads to a compile error with Clang.
> Removing this operand works both with gcc/gas (since binutils 2.18) as
> well as with clang/llvm.
> ---
>  sysdeps/s390/fpu/fpu_control.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/s390/fpu/fpu_control.h b/sysdeps/s390/fpu/fpu_control.h
> index e00d7775f4..567b180034 100644
> --- a/sysdeps/s390/fpu/fpu_control.h
> +++ b/sysdeps/s390/fpu/fpu_control.h
> @@ -32,8 +32,8 @@
>  typedef unsigned int fpu_control_t;
>  
>  /* Macros for accessing the hardware control word.  */
> -#define _FPU_GETCW(cw)  __asm__ __volatile__ ("efpc %0,0" : "=d" (cw))
> -#define _FPU_SETCW(cw)  __asm__ __volatile__ ("sfpc  %0,0" : : "d" (cw))
> +#define _FPU_GETCW(cw)  __asm__ __volatile__ ("efpc %0" : "=d" (cw))
> +#define _FPU_SETCW(cw)  __asm__ __volatile__ ("sfpc %0" : : "d" (cw))
>  
>  /* Default control word set at startup.  */
>  extern fpu_control_t __fpu_control;

As mentioned in the bugzilla. This patch is fine. I've just committed it
and closed the bugzilla.

Thanks,
Stefan

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

end of thread, other threads:[~2023-02-28 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 12:48 [PATCH] S390: Fix _FPU_SETCW/GETCW when compiling with Clang [BZ #30130] Andreas Arnez
2023-02-28 13:05 ` Stefan Liebler

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).