linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: math-emu: fix up 'cmp' insn for clang ias
@ 2020-05-27 13:53 Arnd Bergmann
  2020-06-08 21:12 ` Nick Desaulniers
  2020-07-16 15:30 ` [tip: x86/urgent] x86: math-emu: Fix " tip-bot2 for Arnd Bergmann
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2020-05-27 13:53 UTC (permalink / raw)
  To: Bill Metzenthen, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: Arnd Bergmann, H. Peter Anvin, Jiri Slaby, linux-kernel,
	clang-built-linux

The clang integrated assembler requires the 'cmp' instruction to
have a length prefix here:

arch/x86/math-emu/wm_sqrt.S:212:2: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', or 'cmpl')
 cmp $0xffffffff,-24(%ebp)
 ^

Make this a 32-bit comparison, which it was clearly meant to be.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/math-emu/wm_sqrt.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/math-emu/wm_sqrt.S b/arch/x86/math-emu/wm_sqrt.S
index 3b2b58164ec1..40526dd85137 100644
--- a/arch/x86/math-emu/wm_sqrt.S
+++ b/arch/x86/math-emu/wm_sqrt.S
@@ -209,7 +209,7 @@ sqrt_stage_2_finish:
 
 #ifdef PARANOID
 /* It should be possible to get here only if the arg is ffff....ffff */
-	cmp	$0xffffffff,FPU_fsqrt_arg_1
+	cmpl	$0xffffffff,FPU_fsqrt_arg_1
 	jnz	sqrt_stage_2_error
 #endif /* PARANOID */
 
-- 
2.26.2


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

* Re: [PATCH] x86: math-emu: fix up 'cmp' insn for clang ias
  2020-05-27 13:53 [PATCH] x86: math-emu: fix up 'cmp' insn for clang ias Arnd Bergmann
@ 2020-06-08 21:12 ` Nick Desaulniers
  2020-07-16 15:30 ` [tip: x86/urgent] x86: math-emu: Fix " tip-bot2 for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2020-06-08 21:12 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Bill Metzenthen, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	H. Peter Anvin, Jiri Slaby, LKML, clang-built-linux

On Wed, May 27, 2020 at 6:53 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> The clang integrated assembler requires the 'cmp' instruction to
> have a length prefix here:
>
> arch/x86/math-emu/wm_sqrt.S:212:2: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', or 'cmpl')
>  cmp $0xffffffff,-24(%ebp)
>  ^
>
> Make this a 32-bit comparison, which it was clearly meant to be.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for the patch.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  arch/x86/math-emu/wm_sqrt.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/math-emu/wm_sqrt.S b/arch/x86/math-emu/wm_sqrt.S
> index 3b2b58164ec1..40526dd85137 100644
> --- a/arch/x86/math-emu/wm_sqrt.S
> +++ b/arch/x86/math-emu/wm_sqrt.S
> @@ -209,7 +209,7 @@ sqrt_stage_2_finish:
>
>  #ifdef PARANOID
>  /* It should be possible to get here only if the arg is ffff....ffff */
> -       cmp     $0xffffffff,FPU_fsqrt_arg_1
> +       cmpl    $0xffffffff,FPU_fsqrt_arg_1
>         jnz     sqrt_stage_2_error
>  #endif /* PARANOID */
>
> --

-- 
Thanks,
~Nick Desaulniers

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

* [tip: x86/urgent] x86: math-emu: Fix up 'cmp' insn for clang ias
  2020-05-27 13:53 [PATCH] x86: math-emu: fix up 'cmp' insn for clang ias Arnd Bergmann
  2020-06-08 21:12 ` Nick Desaulniers
@ 2020-07-16 15:30 ` tip-bot2 for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Arnd Bergmann @ 2020-07-16 15:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Arnd Bergmann, Thomas Gleixner, Nick Desaulniers, x86, LKML

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     81e96851ea32deb2c921c870eecabf335f598aeb
Gitweb:        https://git.kernel.org/tip/81e96851ea32deb2c921c870eecabf335f598aeb
Author:        Arnd Bergmann <arnd@arndb.de>
AuthorDate:    Wed, 27 May 2020 15:53:46 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 16 Jul 2020 17:26:42 +02:00

x86: math-emu: Fix up 'cmp' insn for clang ias

The clang integrated assembler requires the 'cmp' instruction to
have a length prefix here:

arch/x86/math-emu/wm_sqrt.S:212:2: error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', or 'cmpl')
 cmp $0xffffffff,-24(%ebp)
 ^

Make this a 32-bit comparison, which it was clearly meant to be.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lkml.kernel.org/r/20200527135352.1198078-1-arnd@arndb.de

---
 arch/x86/math-emu/wm_sqrt.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/math-emu/wm_sqrt.S b/arch/x86/math-emu/wm_sqrt.S
index 3b2b581..40526dd 100644
--- a/arch/x86/math-emu/wm_sqrt.S
+++ b/arch/x86/math-emu/wm_sqrt.S
@@ -209,7 +209,7 @@ sqrt_stage_2_finish:
 
 #ifdef PARANOID
 /* It should be possible to get here only if the arg is ffff....ffff */
-	cmp	$0xffffffff,FPU_fsqrt_arg_1
+	cmpl	$0xffffffff,FPU_fsqrt_arg_1
 	jnz	sqrt_stage_2_error
 #endif /* PARANOID */
 

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

end of thread, other threads:[~2020-07-16 15:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 13:53 [PATCH] x86: math-emu: fix up 'cmp' insn for clang ias Arnd Bergmann
2020-06-08 21:12 ` Nick Desaulniers
2020-07-16 15:30 ` [tip: x86/urgent] x86: math-emu: Fix " tip-bot2 for Arnd Bergmann

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 NNTP newsgroup(s).