[PATCH]: Fix __builtin_apply problems with MMX registers

Uros Bizjak uros.bizjak@kss-loka.si
Fri Jul 22 08:32:00 GMT 2005


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: apply.diff
Type: application/octet-stream
Size: 6368 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050722/8d738c4b/attachment.obj>


More information about the Gcc-patches mailing list