PATCH: testsuite/37074: gcc.dg/torture/stackalign/builtin-apply-4.c failed with SSE2

Ye, Joey joey.ye@intel.com
Wed Aug 13 14:19:00 GMT 2008


Uros Bizjak wrote:
> Please note that we can add __attribute__ ((__option__ ("no-mmx"))) to
> calling function ("bar" in case of
> gcc.target/i386/builtin-apply-mmx.c) to suppress generation of MMX
> moves for __builtin_apply and __builtin_apply_args. I think that this
> new functionality should be mention in your doc patch.
How about this patch?

- Joey

Index: gcc/doc/extend.texi
===================================================================
--- gcc/doc/extend.texi (revision 138935)
+++ gcc/doc/extend.texi (working copy)
@@ -527,6 +527,35 @@ 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 floating point data types are used and it is required to
+enable SIMD, apply __attribute__ ((__option__ ("no-mmx"))) to the
+calling functions of these intrinsic functions. For example:
+@smallexample
+void __attribute__ ((__option__ ("no-mmx"))) bar ()
+@{
+  __builtin_apply (foo,__builtin_apply_args(), 16);
+@}
+@end smallexample
+@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



More information about the Gcc-patches mailing list