This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: PATCH: testsuite/37074: gcc.dg/torture/stackalign/builtin-apply-4.c failed with SSE2
- From: "Ye, Joey" <joey dot ye at intel dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "Uros Bizjak" <ubizjak at gmail dot com>, "Andrew Pinski" <pinskia at gmail dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 13 Aug 2008 16:53:16 +0800
- Subject: RE: PATCH: testsuite/37074: gcc.dg/torture/stackalign/builtin-apply-4.c failed with SSE2
Joey wrote on Wednesday, August 13, 2008 11:17 AM:
> Following patch fixes builtin-apply-4.c. But the changes in
> i386.md is ugly and inefficient, which insert EMMS after
> every mmx movd insn. Any suggestion?
Unless someone think it worthwhile to continue exploring and post a
patch that is applicable (my previous patch wasn't even close to there),
I somewhat believe that avoid mixing MMX and x87 in builtin_apply and
mention it in user manual is a good idea.
How about this patch to doc?
Thanks - Joey
Index: gcc/doc/extend.texi
===================================================================
--- gcc/doc/extend.texi (revision 138935)
+++ gcc/doc/extend.texi (working copy)
@@ -527,6 +527,24 @@ sophisticated features or other extensio
is, therefore, not recommended to use them outside very simple
functions acting as mere forwarders for their arguments.
+In x86 (not x86_64) platform, these built-in function won't work
+properly if both MMX and x87 floating point are supported (either
+in application code or in library). Following rules can be applied
+to avoid malfunction while using these functions:
+@itemize @bullet
+@item When floating point data types are used, don't enable MMX
+via -mmmx, -msse or -msseX options.
+@end itemize
+@itemize @bullet
+@item When floating point data types are used and it is required to
+enable SSE, use -mno-mmx to disable MMX.
+@end itemize
+@itemize @bullet
+@item When MMX instruction or data type are used, avoid using floating
+point data type and calling libraries that may involve floating
+point.
+@end itemize
+
@deftypefn {Built-in Function} {void *} __builtin_apply_args ()
This built-in function returns a pointer to data
describing how to perform a call with the same arguments as were passed