the left. */
if (val < 0 && (val & 1) == 0)
{
- fprintf (file, "0");
+ putc ('0', file);
return;
}
else if (val >= 0)
if (TARGET_RELOCATABLE)
{
ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno);
- fprintf (file, "\tbl ");
+ fputs ("\tbl ", file);
assemble_name (file, buf);
- fprintf (file, "\n");
+ putc ('\n', file);
ASM_OUTPUT_INTERNAL_LABEL (file, "LCF", rs6000_pic_labelno);
fprintf (file, "\tmflr %s\n", reg_names[30]);
fprintf (file, " %s,(", reg_names[0]);
ASM_GENERATE_INTERNAL_LABEL (buf, "LCL", rs6000_pic_labelno);
assemble_name (file, buf);
- fprintf (file, "-");
+ putc ('-', file);
ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno);
assemble_name (file, buf);
fprintf (file, ")(%s)\n", reg_names[30]);
/* An all-zero word flags the start of the tbtab, for debuggers
that have to find it by searching forward from the entry
point or from the current pc. */
- fprintf (file, "\t.long 0\n");
+ fputs ("\t.long 0\n", file);
/* Tbtab format type. Use format type 0. */
- fprintf (file, "\t.byte 0,");
+ fputs ("\t.byte 0,", file);
/* Language type. Unfortunately, there doesn't seem to be any
official way to get this info, so we use language_string. C
fprintf (file, "\t.long %d\n", parm_info);
/* Offset from start of code to tb table. */
- fprintf (file, "\t.long ");
+ fputs ("\t.long ", file);
ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LT");
RS6000_OUTPUT_BASENAME (file, fname);
- fprintf (file, "-.");
+ fputs ("-.", file);
RS6000_OUTPUT_BASENAME (file, fname);
- fprintf (file, "\n");
+ putc ('\n', file);
/* Interrupt handler mask. */
/* Omit this long, since we never set the interrupt handler bit
/* Register for alloca automatic storage; this is always reg 31.
Only emit this if the alloca bit was set above. */
if (frame_pointer_needed)
- fprintf (file, "\t.byte 31\n");
+ fputs ("\t.byte 31\n", file);
}
/* Reset varargs and save TOC indicator */
ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LC");
fprintf (file, "%d = .-", labelno);
ASM_OUTPUT_INTERNAL_LABEL_PREFIX (file, "LCTOC");
- fprintf (file, "1\n");
+ fputs ("1\n", file);
}
else
ASM_OUTPUT_INTERNAL_LABEL (file, "LC", labelno);
abort ();
if (TARGET_MINIMAL_TOC)
- fprintf (file, "\t.long ");
+ fputs ("\t.long ", file);
else
{
STRIP_NAME_ENCODING (real_name, name);
else if (offset)
fprintf (file, ".P%d", offset);
- fprintf (file, "[TC],");
+ fputs ("[TC],", file);
}
output_addr_const (file, x);
- fprintf (file, "\n");
+ putc ('\n', file);
}
\f
/* Output an assembler pseudo-op to write an ASCII string of N characters
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
if (TARGET_MINIMAL_TOC)
{
- fprintf (file, "\t.long ");
+ fputs ("\t.long ", file);
assemble_name (file, buf);
- fprintf (file, "\n");
+ putc ('\n', file);
}
else
{
- fprintf (file, "\t.tc\t");
+ fputs ("\t.tc\t", file);
assemble_name (file, buf);
- fprintf (file, "[TC],");
+ fputs ("[TC],", file);
assemble_name (file, buf);
- fprintf (file, "\n");
+ putc ('\n', file);
}
text_section ();
it might be set up as the frame pointer. */
for (i = 3, j = 30; i <= last_parm_reg; i++, j--)
- fprintf (file, "\tai %d,%d,0\n", j, i);
+ asm_fprintf (file, "\tmr %d,%d\n", j, i);
/* Load location address into r3, and call mcount. */
ASM_GENERATE_INTERNAL_LABEL (buf, "LPC", labelno);
- fprintf (file, "\tl 3,");
+ asm_fprintf (file, "\t{l|lwz} %s,", reg_names[3]);
assemble_name (file, buf);
- fprintf (file, "(2)\n\tbl .mcount\n");
+ asm_fprintf (file, "(%s)\n\tbl .mcount\n", reg_names[2]);
/* Restore parameter registers. */
for (i = 3, j = 30; i <= last_parm_reg; i++, j--)
- fprintf (file, "\tai %d,%d,0\n", i, j);
+ asm_fprintf (file, "\tmr %d,%d\n", i, j);
}
/* Adjust the cost of a scheduling dependency. Return the new cost of
/* A C expression for the size in bits of the type `int' on the
target machine. If you don't define this, the default is one
word. */
-#define INT_TYPE_SIZE (TARGET_64BIT ? 64 : 32)
-#define MAX_INT_TYPE_SIZE 64
+#define INT_TYPE_SIZE 32
/* A C expression for the size in bits of the type `long' on the
target machine. If you don't define this, the default is one
private_data_section (); \
text_section (); \
if (profile_flag) \
- fprintf (FILE, "\t.extern .mcount\n"); \
+ fputs ("\t.extern .mcount\n", FILE); \
}
/* Output at end of assembler file.
#define ASM_FILE_END(FILE) \
{ \
text_section (); \
- fprintf (FILE, "_section_.text:\n"); \
+ fputs ("_section_.text:\n", FILE); \
data_section (); \
- fprintf (FILE, "\t.long _section_.text\n"); \
+ fputs ("\t.long _section_.text\n", FILE); \
}
/* We define this to prevent the name mangler from putting dollar signs into
in each file. */ \
if (! toc_initialized) \
{ \
- fprintf (asm_out_file, ".toc\nLCTOC..0:\n"); \
- fprintf (asm_out_file, "\t.tc toc_table[TC],toc_table[RW]\n"); \
+ fputs (".toc\nLCTOC..0:\n", asm_out_file); \
+ fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); \
toc_initialized = 1; \
} \
\
if (in_section != toc) \
- fprintf (asm_out_file, ".csect toc_table[RW]\n"); \
+ fputs (".csect toc_table[RW]\n", asm_out_file); \
} \
else \
{ \
if (in_section != toc) \
- fprintf (asm_out_file, ".toc\n"); \
+ fputs (".toc\n", asm_out_file); \
} \
in_section = toc; \
}
#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
{ if (TREE_PUBLIC (DECL)) \
{ \
- fprintf (FILE, "\t.globl ."); \
+ fputs ("\t.globl .", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
- fprintf (FILE, "\n"); \
+ putc ('\n', FILE); \
} \
else \
{ \
- fprintf (FILE, "\t.lglobl ."); \
+ fputs ("\t.lglobl .", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
- fprintf (FILE, "\n"); \
+ putc ('\n', FILE); \
} \
- fprintf (FILE, ".csect "); \
+ fputs (".csect ", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
- fprintf (FILE, "[DS]\n"); \
+ fputs ("[DS]\n", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
- fprintf (FILE, ":\n"); \
- fprintf (FILE, "\t.long ."); \
+ fputs (":\n", FILE); \
+ fputs ("\t.long .", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
- fprintf (FILE, ", TOC[tc0], 0\n"); \
- fprintf (FILE, ".csect .text[PR]\n."); \
+ fputs (", TOC[tc0], 0\n", FILE); \
+ fputs (".csect .text[PR]\n.", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
- fprintf (FILE, ":\n"); \
+ fputs (":\n", FILE); \
if (write_symbols == XCOFF_DEBUG) \
xcoffout_declare_function (FILE, DECL, NAME); \
}
strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
XSTR (_symref, 0) = _name; \
} \
- fprintf (FILE, "\t.extern "); \
+ fputs ("\t.extern ", FILE); \
assemble_name (FILE, XSTR (_symref, 0)); \
if (TREE_CODE (DECL) == FUNCTION_DECL) \
{ \
- fprintf (FILE, "\n\t.extern ."); \
+ fputs ("\n\t.extern .", FILE); \
RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0)); \
} \
- fprintf (FILE, "\n"); \
+ putc ('\n', FILE); \
}
/* Similar, but for libcall. We only have to worry about the function name,
not that of the descriptor. */
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
-{ fprintf (FILE, "\t.extern ."); \
+{ fputs ("\t.extern .", FILE); \
assemble_name (FILE, XSTR (FUN, 0)); \
- fprintf (FILE, "\n"); \
+ putc ('\n', FILE); \
}
/* Output to assembler file text saying following lines
/* This is how to output an assembler line defining an `int' constant. */
#define ASM_OUTPUT_INT(FILE,VALUE) \
-( fprintf (FILE, "\t.long "), \
+( fputs ("\t.long ", FILE), \
output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
+ putc ('\n', FILE))
/* Likewise for `char' and `short' constants. */
#define ASM_OUTPUT_SHORT(FILE,VALUE) \
-( fprintf (FILE, "\t.short "), \
+( fputs ("\t.short ", FILE), \
output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
+ putc ('\n', FILE))
#define ASM_OUTPUT_CHAR(FILE,VALUE) \
-( fprintf (FILE, "\t.byte "), \
+( fputs ("\t.byte ", FILE), \
output_addr_const (FILE, (VALUE)), \
- fprintf (FILE, "\n"))
+ putc ('\n', FILE))
/* This is how to output an assembler line for a numeric constant byte. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
do { char buf[100]; \
- fprintf (FILE, "\t.long "); \
+ fputs ("\t.long ", FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
assemble_name (FILE, buf); \
- fprintf (FILE, "\n"); \
+ putc ('\n', FILE); \
} while (0)
/* This is how to output an element of a case-vector that is relative. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
do { char buf[100]; \
- fprintf (FILE, "\t.long "); \
+ fputs ("\t.long ", FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
assemble_name (FILE, buf); \
- fprintf (FILE, "-"); \
+ putc ('-', FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L", REL); \
assemble_name (FILE, buf); \
- fprintf (FILE, "\n"); \
+ putc ('\n', FILE); \
} while (0)
/* This is how to output an assembler line
#undef ASM_OUTPUT_EXTERNAL
-#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
-{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \
- if ((TREE_CODE (DECL) == VAR_DECL \
- || TREE_CODE (DECL) == FUNCTION_DECL) \
- && (NAME)[0] != '*' \
- && (NAME)[strlen (NAME) - 1] != ']') \
- { \
- char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
- strcpy (_name, XSTR (_symref, 0)); \
- XSTR (_symref, 0) = _name; \
- } \
- fprintf (FILE, "\t.extern "); \
- assemble_name (FILE, XSTR (_symref, 0)); \
- if (TREE_CODE (DECL) == FUNCTION_DECL) \
- { \
- fprintf (FILE, "\n\t.extern .."); \
- assemble_name (FILE, XSTR (_symref, 0)); \
- } \
- fprintf (FILE, "\n"); \
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
+{ \
+ char *_name; \
+ rtx _symref = XEXP (DECL_RTL (DECL), 0); \
+ if ((TREE_CODE (DECL) == VAR_DECL \
+ || TREE_CODE (DECL) == FUNCTION_DECL) \
+ && (NAME)[0] != '*' \
+ && (NAME)[strlen (NAME) - 1] != ']') \
+ { \
+ _name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
+ strcpy (_name, XSTR (_symref, 0)); \
+ XSTR (_symref, 0) = _name; \
+ } \
+ else \
+ _name = XSTR (_symref, 0); \
+ \
+ if (DECL_FUNCTION_CODE (DECL) == 0) \
+ { \
+ fputs ("\t.extern ", FILE); \
+ assemble_name (FILE, _name); \
+ putc ('\n', FILE); \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ { \
+ fputs ("\t.extern ..", FILE); \
+ assemble_name (FILE, _name); \
+ putc ('\n', FILE); \
+ } \
+ } \
}
/* Similar, but for libcall. We only have to worry about the function name,