[patch i386]: Implementation for call abi switching via attribute.
Kai Tietz
Kai.Tietz@onevision.com
Thu May 29 11:26:00 GMT 2008
Mark Mitchell <mark@codesourcery.com> wrote on 28.05.2008 17:33:51:
> Kai Tietz wrote:
>
> > Mark is this patch ok for apply on trunk?
>
> I've not reviewed the x86 bits; Jan can do that. However, the
> documentation can be improved a lot.
>
> > +@defmac OVERRIDE_ABI_FORMAT (@var{fndecl})
> > +This is a target macro to allow function specific abi overrides. If
> > +present, it is used in @code{allocate_struct_function}.
> > +The @var{fndecl} can be NULL if used in library calls.
> > +@end defmac
>
> "This is a target macro" is redundant; this in a section about target
> macros. "function-specific" should be hyphenated; it's an adjective.
> Talking abut "allocate_struct_function" isn't very helpful; from a
> backend implementors point of view, that's not something they should
> have to know about. NULL needs TeXinfo markup.
>
> So, I'd say something like:
>
> If defined, this macro is called before generating any code for a
> function, but after the @var{cfun} descriptor for the function has been
> created. The back end may use this macro to update @var{cfun} to
> reflect an ABI other than that which would normally be used. If the
> compiler is generating code for a a compiler-generated function,
> @var{fndecl} may be @code{NULL}.
>
> > +@item ms_abi/sysv_abi
> > +@cindex @code{sysv_abi} attribute
> > +@cindex @code[ms_abi} attribute
> > +
> > +On x86_64 and w64 targets, you can use the @code{ms_abi} and
> @code{sysv_abi}
> > +function attribute to locally select the used calling convention for
> > +a function. You can choose between sysv and the w64 calling
convention.
> > +For w64 targets functions default to the @code{ms_abi} and for x86_64
> > +target they default to the @code{sysv_abi} calling convention.
> > +
> > +Note, this feature is currently sorried out for w64 -> x86_64.
>
> The @code markup for ms_abi uses "[" instead of "{". I don't think
> "w64" and "x86_64" are defined terms in the manual. Are they? If not,
> we should be speaking in terms users understand, not in terms of our
> internal lingo.
>
> "On 64-bit targets, you can use the ... " and then later, "For Windows
> targets". "sysv" should be capitalized and it's not really accurate;
> there's no AT&T System 5 ABI for 64-bit x86; it's the AMD64 ABI.
> Something like:
>
> "On 64-bit targets, you can use an ABI attribute to indicate which
> calling convention should be used for a function. The @code{ms_abi}
> attribute tells the compiler to use the Microsoft ABI, while the
> @code{amd_abi} attribute tells the compiler to use the ABI used on
> GNU/Linux and other systems. The default is to use the Microsoft ABI
> when targeting Windows. On all other systems, the default is the AMD
ABI."
>
> I think it should be "amd_abi", since this ABI was originally designed
> for AMD CPUs. Using a vendor-netural term is fine -- but "sysv" seems
> misleading.
Thank you for your corrections for documentation. I adjusted it as
suggested.
I renamed my patch to use "amd_abi" instead of "sysv_abi". I am not
really happy with this, may the name "gnu_abi" would fit better. But
amd_abi is ok for me, too.
Is this patch ok for apply?
Thanks
Kai
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: amd64_abis_part2.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080529/f72775dc/attachment.txt>
More information about the Gcc-patches
mailing list