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] 2nd try: Add sseregparm function attribute for x86


Richard Henderson wrote:
> On Thu, Jun 09, 2005 at 12:03:50AM +0200, Richard Guenther wrote:
> 
>>+ /* Handle a "sseregparm" attribute;
>>+    arguments as in struct attribute_spec.handler.  */
>>+ static tree
>>+ ix86_handle_sseregparm_attribute (tree *node, tree name,
>>+ 				 tree args ATTRIBUTE_UNUSED,
>>+ 				 int flags ATTRIBUTE_UNUSED,
>>+ 				 bool *no_add_attrs)
>>+ {
>>+   if (TREE_CODE (*node) != FUNCTION_TYPE
>>+       && TREE_CODE (*node) != METHOD_TYPE)
>>+     {
>>+       warning (OPT_Wattributes, "%qs attribute only applies to functions",
>>+ 	       IDENTIFIER_POINTER (name));
>>+       *no_add_attrs = true;
>>+     }
>>+ 
>>+   return NULL_TREE;
> 
> 
> This needs to handle all the other calling conventions, and rejecting
> combinations that don't make sense.  I guess this could be paired with
> regparm or fastcall, since sseregparm doesn't say anything about integer
> data, but it certainly can't be paired with cdecl or stdcall.

Ok, I'm trying to clean things up there.  From reading the documentation
and from experimenting I got  fastcall == stdcall + regparm(2), so,
fastcall and stdcall are not incompatible (but redundant) as the
ix86_handle_cdecl_attribute says.  So one could combine fastcall,
stdcall and sseregparm in any way, but not with cdecl and with
regparm only if it matches fastcall or fastcall is not present.

I'll try inventing a ix86_handle_calling_convention_attributes.

Richard.


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