1From d96ffd4a824958e85e5de51210a4a49b5251a7d5 Mon Sep 17 00:00:00 2001
2From: Tri Vo <[email protected]>
3Date: Wed, 21 Sep 2016 15:10:38 -0700
4Subject: [PATCH 02/20] x86/test_FISTTP: Compile breakpoints and x86 tests
5
6Test: make vts
7(cherry picked from commit 0fd3eaf312c6284450f758e3a49c5cfd855e4847)
8---
9 tools/testing/selftests/x86/test_FISTTP.c | 18 ++++++++++++++++++
10 1 file changed, 18 insertions(+)
11
12diff --git a/tools/testing/selftests/x86/test_FISTTP.c b/tools/testing/selftests/x86/test_FISTTP.c
13index 09789c0ce3e9..c920a57ddb06 100644
14--- a/tools/testing/selftests/x86/test_FISTTP.c
15+++ b/tools/testing/selftests/x86/test_FISTTP.c
16@@ -25,7 +25,11 @@ int test(void)
17 	feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
18 	asm volatile ("\n"
19 	"	fld1""\n"
20+#ifdef __clang__
21+	"	fisttps	res16""\n"
22+#else
23 	"	fisttp	res16""\n"
24+#endif
25 	"	fld1""\n"
26 	"	fisttpl	res32""\n"
27 	"	fld1""\n"
28@@ -45,7 +49,11 @@ int test(void)
29 	feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
30 	asm volatile ("\n"
31 	"	fldpi""\n"
32+#ifdef __clang__
33+	"	fisttps	res16""\n"
34+#else
35 	"	fisttp	res16""\n"
36+#endif
37 	"	fldpi""\n"
38 	"	fisttpl	res32""\n"
39 	"	fldpi""\n"
40@@ -66,7 +74,13 @@ int test(void)
41 	asm volatile ("\n"
42 	"	fldpi""\n"
43 	"	fchs""\n"
44+#ifdef __clang__
45+	"	fisttps	res16""\n"
46+#else
47+    // clang will complain: ambiguous instructions require an explicit suffix
48+    // (could be 'fisttps', or 'fisttpl')
49 	"	fisttp	res16""\n"
50+#endif
51 	"	fldpi""\n"
52 	"	fchs""\n"
53 	"	fisttpl	res32""\n"
54@@ -88,7 +102,11 @@ int test(void)
55 	feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
56 	asm volatile ("\n"
57 	"	fldln2""\n"
58+#ifdef __clang__
59+	"	fisttps	res16""\n"
60+#else
61 	"	fisttp	res16""\n"
62+#endif
63 	"	fldln2""\n"
64 	"	fisttpl	res32""\n"
65 	"	fldln2""\n"
66--
672.42.0.609.gbb76f46606-goog
68
69