This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386]: Implement x87 register passing convention


Hello!

Attached to this message, please find updated patch that implements
x87 register passing conventions. This patch is complete with no
remaining issues left. Included are also documentation and testcases.

Patch is bootstrapped on i686-pc-linux-gnu and regression tested with
c,c++ and fortran. In addition, povray-3.6.1 was compiled, and the
test run produced expected results.

BTW: Option name and function attribute were renamed to x87regparm, as
function attribute can't start with number.

2006-10-13 Uros Bizjak <uros@kss-loka.si>

* 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 SFmode and DFmode arguments in 80387
	registers when cum->float_in_x87 and flag_unsafe_math_optimizations
	are set. Pass XFmode arguments in 80387 registers when
	cum->float_in_x87 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:

2006-10-13 Uros Bizjak <uros@kss-loka.si>

	* gcc.target/i386/x87regparm-1.c: New test.
	* gcc.target/i386/x87regparm-2.c: New test.
	* gcc.target/i386/x87regparm-3.c: New test.

:ADDPATCH target, i386:

OK for stage1 mainline?

Uros.

Attachment: i386-x87regparm.diff
Description: Binary data

Attachment: i386-x87regparm-tests.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]