diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-03-17 11:48:28 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-03-17 11:48:28 -0500 |
commit | 0ea6b275aa84087aeb90313f41d1046a83746846 (patch) | |
tree | d593c265168728d2f5e1af29a2967da1db9d0f03 /gcc | |
parent | f6b54ae8080201d61fb5af1d612d810cc735c6d1 (diff) | |
download | gcc-0ea6b275aa84087aeb90313f41d1046a83746846.zip gcc-0ea6b275aa84087aeb90313f41d1046a83746846.tar.gz gcc-0ea6b275aa84087aeb90313f41d1046a83746846.tar.bz2 |
(winnt_function_prologue): Deleted.
(gen_stdcall_suffix): New function.
From-SVN: r9199
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/i386/winnt.c | 78 |
1 files changed, 23 insertions, 55 deletions
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index 813724c..89b7745 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -27,65 +27,33 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "tree.h" #include "flags.h" -/* This function generates the assembly code for function entry. - FILE is an stdio stream to output the code to. - SIZE is an int: how many units of temporary storage to allocate. */ +/* Return string which is the former assembler name modified with a + suffix consisting of an atsign (@) followed by the number of bytes of + arguments */ -void -winnt_function_prologue (file, size) - FILE *file; - int size; +char * +gen_stdcall_suffix (decl) + tree decl; { - register int regno; - int limit; - rtx xops[4]; - int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table - || current_function_uses_const_pool); + int total = 0; + char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); + char *newsym; - xops[0] = stack_pointer_rtx; - xops[1] = frame_pointer_rtx; - xops[2] = GEN_INT (size); - xops[3] = gen_rtx (REG, Pmode, 0); /* eax */ - if (frame_pointer_needed) - { - output_asm_insn ("push%L1 %1", xops); - output_asm_insn (AS2 (mov%L0,%0,%1), xops); - } - - if (size > 4095) - { - output_asm_insn (AS2 (mov%L0, %2, %3), xops); - output_asm_insn ("call __chkstk", xops); - } - else if (size) - output_asm_insn (AS2 (sub%L0,%2,%0), xops); - - /* Note If use enter it is NOT reversed args. - This one is not reversed from intel!! - I think enter is slower. Also sdb doesn't like it. - But if you want it the code is: - { - xops[3] = const0_rtx; - output_asm_insn ("enter %2,%3", xops); - } - */ - limit = (frame_pointer_needed ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM); - for (regno = limit - 1; regno >= 0; regno--) - if ((regs_ever_live[regno] && ! call_used_regs[regno]) - || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used)) + if (TYPE_ARG_TYPES (TREE_TYPE (decl))) + if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl)))) + == void_type_node) { - xops[0] = gen_rtx (REG, SImode, regno); - output_asm_insn ("push%L0 %0", xops); - } + tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); - if (pic_reg_used) - { - xops[0] = pic_offset_table_rtx; - xops[1] = (rtx) gen_label_rtx (); + while (TREE_VALUE (formal_type) != void_type_node) + { + total += TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); + formal_type = TREE_CHAIN (formal_type); + } + } - output_asm_insn (AS1 (call,%P1), xops); - ASM_OUTPUT_INTERNAL_LABEL (file, "L", CODE_LABEL_NUMBER (xops[1])); - output_asm_insn (AS1 (pop%L0,%0), xops); - output_asm_insn ("addl $_GLOBAL_OFFSET_TABLE_+[.-%P1],%0", xops); - } + newsym = xmalloc (strlen (asmname) + 10); + sprintf (newsym, "%s@%d", asmname, total/BITS_PER_UNIT); + return IDENTIFIER_POINTER (get_identifier (newsym)); } + |