aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2006-11-15 17:21:58 +0100
committerUros Bizjak <uros@gcc.gnu.org>2006-11-15 17:21:58 +0100
commit47a37ce45e4feb8cd84a315353a2077c9fbda747 (patch)
tree764fb41a529e8c99e2fdcd06f12aed4fa7003f09 /gcc/doc
parentab25c2d92002803f424e096520a945d67f12616f (diff)
downloadgcc-47a37ce45e4feb8cd84a315353a2077c9fbda747.zip
gcc-47a37ce45e4feb8cd84a315353a2077c9fbda747.tar.gz
gcc-47a37ce45e4feb8cd84a315353a2077c9fbda747.tar.bz2
i386.opt: New target option -mx87regparm.
* config/i386/i386.opt: New target option -mx87regparm. * config/i386/i386.h (struct ix86_args): Add x87_nregs, x87_regno, float_in_x87: Add new variables. mmx_words, sse_words: Remove. (X87_REGPARM_MAX): Define. * config/i386/i386.c (override_options): Error out for -mx87regparm but no 80387 support. (ix86_attribute_table): Add x87regparm. (ix86_handle_cconv_attribute): Update comments for x87regparm. (ix86_comp_type_attributes): Check for mismatched x87regparm types. (ix86_function_x87regparm): New function. (ix86_function_arg_regno_p): Add X87_REGPARM_MAX 80387 floating point registers. (init_cumulative_args): Initialize x87_nregs and float_in_x87 variables. (function_arg_advance): Process x87_nregs and x87_regno when floating point argument is to be passed in 80387 register. (function_arg): Pass XFmode arguments in 80387 registers for local functions. Pass SFmode and DFmode arguments to local functions in 80387 registers when flag_unsafe_math_optimizations is set. * reg-stack.c (convert_regs_entry): Disable NaN load for stack registers that are used for argument passing. * doc/extend.texi: Document x87regparm function attribute. * doc/invoke.texi: Document -mx87regparm. testsuite/ChangeLog: * gcc.target/i386/x87regparm-1.c: New test. * gcc.target/i386/x87regparm-2.c: New test. * gcc.target/i386/x87regparm-3.c: New test. * gcc.target/i386/x87regparm-4.c: New test. From-SVN: r118859
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi8
-rw-r--r--gcc/doc/invoke.texi15
2 files changed, 21 insertions, 2 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 2a1391e..099e4dd 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2221,6 +2221,14 @@ safe since the loaders there save all registers. (Lazy binding can be
disabled with the linker or the loader if desired, to avoid the
problem.)
+@item x87regparm
+@cindex @code{x87regparm} attribute
+On the Intel x86 with 80387 @code{x87regparm} attribute causes the
+compiler to pass up to 3 floating point arguments in 80387 registers
+instead of on the stack. Functions that take a variable number of
+arguments will continue to pass all of their floating point arguments
+on the stack.
+
@item sseregparm
@cindex @code{sseregparm} attribute
On the Intel 386 with SSE support, the @code{sseregparm} attribute
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 544467e..1a62289 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -535,8 +535,8 @@ Objective-C and Objective-C++ Dialects}.
-mmmx -msse -msse2 -msse3 -mssse3 -m3dnow @gol
-mthreads -mno-align-stringops -minline-all-stringops @gol
-mpush-args -maccumulate-outgoing-args -m128bit-long-double @gol
--m96bit-long-double -mregparm=@var{num} -msseregparm @gol
--mstackrealign @gol
+-m96bit-long-double -mregparm=@var{num} -mx87regparm @gol
+-msseregparm @gol -mstackrealign @gol
-momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol
-mcmodel=@var{code-model} @gol
-m32 -m64 -mlarge-data-threshold=@var{num}}
@@ -9542,6 +9542,17 @@ function by using the function attribute @samp{regparm}.
value, including any libraries. This includes the system libraries and
startup modules.
+@item -mx87regparm
+@opindex mx87regparm
+Use 80387 register passing conventions for floating point arguments.
+You can control this behavior for a specific function by using the
+function attribute @samp{x87regparm}.
+@xref{Function Attributes}.
+
+@strong{Warning:} if you use this switch then you must build all
+modules with the same value, including any libraries. This includes
+the system libraries and startup modules.
+
@item -msseregparm
@opindex msseregparm
Use SSE register passing conventions for float and double arguments