From: John Hubbard <jhubbard@nvidia.com>
To: Shuah Khan <shuah@kernel.org>
Cc: angquan yu <angquan21@gmail.com>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Ingo Molnar <mingo@kernel.org>,
Binbin Wu <binbin.wu@linux.intel.com>,
Alexey Dobriyan <adobriyan@gmail.com>,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Sohil Mehta <sohil.mehta@intel.com>,
Yu-cheng Yu <yu-cheng.yu@intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Valentin Obst <kernel@valentinobst.de>,
linux-kselftest@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
llvm@lists.linux.dev, x86@kernel.org,
John Hubbard <jhubbard@nvidia.com>
Subject: [PATCH 2/7] selftests/x86: build test_FISTTP.c with clang
Date: Thu, 2 May 2024 20:02:09 -0700 [thread overview]
Message-ID: <20240503030214.86681-3-jhubbard@nvidia.com> (raw)
In-Reply-To: <20240503030214.86681-1-jhubbard@nvidia.com>
First of all, in order to build with clang at all, one must first apply
Valentin Obst's build fix for LLVM [1]. Once that is done, then when
building with clang, via:
make LLVM=1 -C tools/testing/selftests
...the build fails because clang inline asm requires size suffixes for
instructions, including the fisttp instruction. In this case, the 16-bit
suffix 's' is missing.
Fix by adding an 's' (short) suffix in each place that it is missing.
[1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
tools/testing/selftests/x86/test_FISTTP.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/x86/test_FISTTP.c b/tools/testing/selftests/x86/test_FISTTP.c
index 09789c0ce3e9..b9ae9d8cebcb 100644
--- a/tools/testing/selftests/x86/test_FISTTP.c
+++ b/tools/testing/selftests/x86/test_FISTTP.c
@@ -25,7 +25,7 @@ int test(void)
feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
asm volatile ("\n"
" fld1""\n"
- " fisttp res16""\n"
+ " fisttps res16""\n"
" fld1""\n"
" fisttpl res32""\n"
" fld1""\n"
@@ -45,7 +45,7 @@ int test(void)
feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
asm volatile ("\n"
" fldpi""\n"
- " fisttp res16""\n"
+ " fisttps res16""\n"
" fldpi""\n"
" fisttpl res32""\n"
" fldpi""\n"
@@ -66,7 +66,7 @@ int test(void)
asm volatile ("\n"
" fldpi""\n"
" fchs""\n"
- " fisttp res16""\n"
+ " fisttps res16""\n"
" fldpi""\n"
" fchs""\n"
" fisttpl res32""\n"
@@ -88,7 +88,7 @@ int test(void)
feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
asm volatile ("\n"
" fldln2""\n"
- " fisttp res16""\n"
+ " fisttps res16""\n"
" fldln2""\n"
" fisttpl res32""\n"
" fldln2""\n"
--
2.45.0
next prev parent reply other threads:[~2024-05-03 3:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 3:02 [PATCH 0/7] selftests/x86: fix build errors and warnings found via clang John Hubbard
2024-05-03 3:02 ` [PATCH 1/7] selftests/x86: fix Makefile dependencies to work with clang John Hubbard
2024-05-03 3:02 ` John Hubbard [this message]
2024-05-03 3:02 ` [PATCH 3/7] selftests/x86: build fsgsbase_restore.c " John Hubbard
2024-05-03 3:02 ` [PATCH 4/7] selftests/x86: build sysret_rip.c " John Hubbard
2024-05-03 3:02 ` [PATCH 5/7] selftests/x86: avoid -no-pie warnings from clang during compilation John Hubbard
2024-05-03 3:02 ` [PATCH 6/7] selftests/x86: remove (or use) unused variables and functions John Hubbard
2024-05-03 3:02 ` [PATCH 7/7] selftests/x86: fix printk() format warnings John Hubbard
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=20240503030214.86681-3-jhubbard@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=adobriyan@gmail.com \
--cc=angquan21@gmail.com \
--cc=binbin.wu@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=kernel@valentinobst.de \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mingo@kernel.org \
--cc=rick.p.edgecombe@intel.com \
--cc=shuah@kernel.org \
--cc=sohil.mehta@intel.com \
--cc=x86@kernel.org \
--cc=yu-cheng.yu@intel.com \
/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