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]

Re: [PATCH]: Fix __builtin_apply problems with MMX registers


Richard Henderson (rth@redhat.com) wrote:

>> 	(apply_args_size): Use FUNCTION_ARG_REGNO_P_APPLY_ARGS.
>> 	(apply_result_size): Use FUNCTION_VALUE_REGNO_P_APPLY_RESULT.

> You need to document the new macros.

Done.

Also, the logic in ix86_function_arg_regno_p () and ix86_function_value_regno_p
() functions is tweaked a little. MMX registers are now blocked only when
TARGET_80387 and from_builtin are both set. This way, we still save MMX
registers when -mno-80387 is used. "untyped_call" expander  in i386.md already
supports this.

(BTW: Patch has some offsets, but should apply cleanly. Also, I have no CVS
access ATM, so if patch is OK, someone should commit it to CVS)

2005-07-22  Uros Bizjak  <uros@kss-loka.si>

	* builtins.c (FUNCTION_VALUE_REGNO_P_APPLY_RESULT): Define
	to FUNCTION_VALUE_REGNO_P if undefined.
	(FUNCTION_ARG_REGNO_P_APPLY_ARGS): Define to
	FUNCTION_ARG_REGNO_P if undefined.
	(apply_args_size): Use FUNCTION_ARG_REGNO_P_APPLY_ARGS.
	(apply_result_size): Use FUNCTION_VALUE_REGNO_P_APPLY_RESULT.

	* config/i386/i386-protos.h (ix86_function_value_regno_p):
	Add new bool argument.
	(ix86_function_arg_regno_p): Add new bool argument.
	* config/i386/i386.h (FUNCTION_VALUE_REGNO_P): Add new
	argument in call to ix86_function_value_regno_p ().
	(FUNCTION_VALUE_REGNO_P_APPLY_RESULT): New define.
	(FUNCTION_ARG_REGNO_P): Add new argument in call to
	ix86_function_arg_regno_p ().
	(FUNCTION_ARG_REGNO_P_APPLY_ARGS): New define.
	* config/i386/i386.c (ix86_function_arg_regno_p): Add new
	from_builtin function argument. Do not return true for MMX
	registers when TARGET_80387 and from_builtin are set.
	(ix86_function_value_regno_p): Add new from_builtin function
	argument. Do not return true for MMX registers when 
	TARGET_80387 and from_builtin are set.

	* doc/tm.texi (Register Arguments): Document 
	FUNCTION_ARG_REGNO_P_APPLY_ARGS macro.
	(Scalar Return): Document FUNCTION_VALUE_REGNO_P_APPLY_RESULT
	macro.

Uros.

Attachment: apply.diff
Description: Binary data


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