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 targets]: Add support of ms_hook_prologue for x64 architecture


"H.J. Lu" <hjl.tools@gmail.com> wrote on 08.07.2010 16:38:29:

> On Thu, Jul 8, 2010 at 4:14 AM, Kai Tietz <Kai.Tietz@onevision.com> 
wrote:
> > Hello,
> >
> > I reworked my initial patch (which is reverted) and now I am using the
> > approach to introduce for function-label emitting the new macro
> > ASM_OUTPUT_FUNCTION_LABEL, which can be overriden by architectures on
> > demand.
> >
> > ChangeLog
> > 2010-07-08  Kai Tietz
> >
> >        * config/i386/i386-protos.h (ix86_asm_output_function_label):
> >        New prototype.
> >        * config/i386/i386.c (ix86_function_ms_hook_prologue): Check
> >        for NULL fntype argument and allow 64-bit targets.
> >        (ix86_asm_output_function_label): New function.
> >        (ix86_expand_prologue): Handle 64-bit ms hook prologue.
> >        (ix86_handle_fndecl_attribute): Likewise.
> >        * doc/extend.texi (ms_hook_prologue): Adjust documentation.
> >        * doc/doc/tm.texi: Regenerated.
> >        * doc/doc/doc/tm.texi.in (ASM_OUTPUT_FUNCTION_LABEL): New.
> >        (ASM_DECLARE_FUNCTION_NAME): Adjust documentation.
> >        * defaults.h (ASM_OUTPUT_FUNCTION_LABEL): New macro.
> >        * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use
> > ASM_OUTPUT_FUNCTION_LABEL
> >        instead of ASM_OUTPUT_LABEL.
> >        * config/elfos.h: Likewise.
> >        * config/i386/cygming.h: Likewise.
> >        * config/netbsd-aout.h: Likewise.
> >        * config/openbsd.h: Likewise.
> >        * config/i386/i386.h (ASM_OUTPUT_FUNCTION_LABEL): Override
> >        by ix86_asm_output_function_label function call.
> >        * varasm.c (assemble_start_function): Use
> > ASM_OUTPUT_FUNCTION_LABEL
> >
> > Tested for i686-pc-cygwin, x86_64-pc-mingw32, and i686-pc-linux-gnu. I
> > need approval for this patch by darwin, elfos, openbsd, i386, and 
netbsd
> > maintainer(s),
> > Ok for apply?
> 
> +/* Write the extra assembler code needed to declare a function 
properly.  */
> +
> +void
> +ix86_asm_output_function_label (FILE *asm_out_file, const char *fname,
> +            tree decl)
> +{
> +  const char *xname = fname;
> +  bool is_ms_hook = ix86_function_ms_hook_prologue (decl);
> +
> +  if (is_ms_hook)
> +    {
> +      int i, filler_count = (TARGET_64BIT ? 32 : 16);
> +      unsigned int filler_cc = 0xcccccccc;
> +
> +      for (i = 0; i < filler_count; i += 4)
> +        fprintf (asm_out_file, ASM_LONG " 0x%x\n", filler_cc);
> +    }
> +
> +  ASM_OUTPUT_LABEL (asm_out_file, xname);
> +
> 
> Is xname for Darwin? Do you still need it?
> 
> 
> -- 
> H.J.
> 

Thank you for catching it. No, it isn't necessary anymore.

Regards,
Kai

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

Attachment: asm_declare_function_name_II.diff
Description: Binary data


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