1From 0fd3eaf312c6284450f758e3a49c5cfd855e4847 Mon Sep 17 00:00:00 2001
2From: Tri Vo <trong@google.com>
3Date: Wed, 21 Sep 2016 15:10:38 -0700
4Subject: [PATCH] Compile breakpoints and x86 tests. Test: make vts
5
6Change-Id: I0c5dd63b3386adb22f3370a8b736d190c781bd4f
7---
8
9 [smuckle@google.com: drop changes to Android-specific files for
10  tracking of changes to upstream]
11
12 tools/testing/selftests/x86/test_FISTTP.c |  18 +++++
13
14diff --git a/tools/testing/selftests/x86/test_FISTTP.c b/tools/testing/selftests/x86/test_FISTTP.c
15index b8e61a047f6b..6cae2d45b246 100644
16--- a/tools/testing/selftests/x86/test_FISTTP.c
17+++ b/tools/testing/selftests/x86/test_FISTTP.c
18@@ -24,7 +24,11 @@ int test(void)
19 	feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
20 	asm volatile ("\n"
21 	"	fld1""\n"
22+#ifdef __clang__
23+	"	fisttps	res16""\n"
24+#else
25 	"	fisttp	res16""\n"
26+#endif
27 	"	fld1""\n"
28 	"	fisttpl	res32""\n"
29 	"	fld1""\n"
30@@ -44,7 +48,11 @@ int test(void)
31 	feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
32 	asm volatile ("\n"
33 	"	fldpi""\n"
34+#ifdef __clang__
35+	"	fisttps	res16""\n"
36+#else
37 	"	fisttp	res16""\n"
38+#endif
39 	"	fldpi""\n"
40 	"	fisttpl	res32""\n"
41 	"	fldpi""\n"
42@@ -65,7 +73,13 @@ int test(void)
43 	asm volatile ("\n"
44 	"	fldpi""\n"
45 	"	fchs""\n"
46+#ifdef __clang__
47+	"	fisttps	res16""\n"
48+#else
49+    // clang will complain: ambiguous instructions require an explicit suffix
50+    // (could be 'fisttps', or 'fisttpl')
51 	"	fisttp	res16""\n"
52+#endif
53 	"	fldpi""\n"
54 	"	fchs""\n"
55 	"	fisttpl	res32""\n"
56@@ -87,7 +101,11 @@ int test(void)
57 	feclearexcept(FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW);
58 	asm volatile ("\n"
59 	"	fldln2""\n"
60+#ifdef __clang__
61+	"	fisttps	res16""\n"
62+#else
63 	"	fisttp	res16""\n"
64+#endif
65 	"	fldln2""\n"
66 	"	fisttpl	res32""\n"
67 	"	fldln2""\n"
68--
692.13.1.518.g3df882009-goog
70
71