This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] 2nd try: Add sseregparm function attribute for x86
Richard Henderson wrote:
> On Thu, Jun 09, 2005 at 09:17:58PM +0200, Richard Guenther wrote:
>
>>Using the above testcase and compiling with -O2 -msse I get ...
>
>
> There are some hacks to remove from function_arg{,_advance}.
>
> I had assumed they were your changes, actually; I guess we'll
> have to figure out where they came from and what they're for...
>
> Here's the patch I used.
>
>
> @@ -2775,8 +2830,6 @@ function_arg_advance (CUMULATIVE_ARGS *c
> break;
>
> case DFmode:
> - if (!TARGET_SSE2)
> - break;
> case SFmode:
> if (!cum->float_in_sse)
> break;
> @@ -2904,8 +2957,6 @@ function_arg (CUMULATIVE_ARGS *cum, enum
> }
> break;
> case DFmode:
> - if (!TARGET_SSE2)
> - break;
> case SFmode:
> if (!cum->float_in_sse)
> break;
Yep, these were mine, but I backed them out (dunno why).
> @@ -3244,14 +3295,10 @@ ix86_value_regno (enum machine_mode mode
> return 0;
>
> /* Floating point return values in %st(0), except for local functions when
> - SSE math is enabled. */
> - if (func && SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH
> - && flag_unit_at_a_time)
> - {
> - struct cgraph_local_info *i = cgraph_local_info (func);
> - if (i && i->local)
> - return FIRST_SSE_REG;
> - }
> + SSE math is enabled or for functions with sseregparm attribute. */
> + if (func && (mode == SFmode || mode == DFmode)
> + && ix86_function_sseregparm (TREE_TYPE (func), func))
> + return FIRST_SSE_REG;
This change, s/SSE_FLOAT_MODE_P (mode)/(mode == SFmode || mode ==
DFmode)/ I did not have - it helps for the return value. Now it does
indeed work :) I also like it better this way. Due to the cleanup
the patch is somewhat unreadable now, but I'll put it though regtesting
on i686 and x86_64 anyway.
Stay tuned,
Richard.