Commit 809d4ef1 by Richard Henderson Committed by Richard Henderson

c-decl.c: Include "tm_p.h".

        * c-decl.c: Include "tm_p.h".

        * config/ia64/ia64-protos.h: Rearrange decls to reduce ifdef madness.
        (fetchadd_operand, ia64_expand_fetch_and_op): Declare.
        (ia64_expand_op_and_fetch): Declare.
        * config/ia64/ia64.c: Include "toplev.h".  Kill trailing whitespace.
        (setjmp_operand): Constify variables for XSTR.
        (ia64_encode_section_info): Likewise.
        (ia64_print_operand): Use %d for exact_log2; cast 32-bit printed
        values to int.
        (ia64_asm_output_external): Constify name.
        (process_set): Use HOST_WIDE_INT_PRINT_DEC for frame size.
        (process_for_unwind_directive): Provide switch default.
        (ia64_expand_compare_and_swap): Remove unused variables.
        (ia64_expand_builtin): Likewise.
        * config/ia64/ia64.h (ASM_OUTPUT_BYTE): Mask and cast value to int
        for printing.

From-SVN: r33752
parent 3262c1f5
2000-05-06 Richard Henderson <rth@cygnus.com> 2000-05-06 Richard Henderson <rth@cygnus.com>
2000-05-06 Richard Henderson <rth@cygnus.com>
* c-decl.c: Include "tm_p.h".
* config/ia64/ia64-protos.h: Rearrange decls to reduce ifdef madness.
(fetchadd_operand, ia64_expand_fetch_and_op): Declare.
(ia64_expand_op_and_fetch): Declare.
* config/ia64/ia64.c: Include "toplev.h". Kill trailing whitespace.
(setjmp_operand): Constify variables for XSTR.
(ia64_encode_section_info): Likewise.
(ia64_print_operand): Use %d for exact_log2; cast 32-bit printed
values to int.
(ia64_asm_output_external): Constify name.
(process_set): Use HOST_WIDE_INT_PRINT_DEC for frame size.
(process_for_unwind_directive): Provide switch default.
(ia64_expand_compare_and_swap): Remove unused variables.
(ia64_expand_builtin): Likewise.
* config/ia64/ia64.h (ASM_OUTPUT_BYTE): Mask and cast value to int
for printing.
2000-05-06 Richard Henderson <rth@cygnus.com>
* rtl.def (DEFINE_COND_EXEC): New. * rtl.def (DEFINE_COND_EXEC): New.
* md.texi: Document it. * md.texi: Document it.
......
...@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h" #include "toplev.h"
#include "defaults.h" #include "defaults.h"
#include "ggc.h" #include "ggc.h"
#include "tm_p.h"
#if USE_CPPLIB #if USE_CPPLIB
#include "cpplib.h" #include "cpplib.h"
......
...@@ -43,59 +43,59 @@ extern int reg_or_22bit_operand PARAMS((rtx, enum machine_mode)); ...@@ -43,59 +43,59 @@ extern int reg_or_22bit_operand PARAMS((rtx, enum machine_mode));
extern int shift_count_operand PARAMS((rtx, enum machine_mode)); extern int shift_count_operand PARAMS((rtx, enum machine_mode));
extern int shift_32bit_count_operand PARAMS((rtx, enum machine_mode)); extern int shift_32bit_count_operand PARAMS((rtx, enum machine_mode));
extern int shladd_operand PARAMS((rtx, enum machine_mode)); extern int shladd_operand PARAMS((rtx, enum machine_mode));
extern int fetchadd_operand PARAMS((rtx, enum machine_mode));
extern int reg_or_fp01_operand PARAMS((rtx, enum machine_mode)); extern int reg_or_fp01_operand PARAMS((rtx, enum machine_mode));
extern int normal_comparison_operator PARAMS((rtx, enum machine_mode)); extern int normal_comparison_operator PARAMS((rtx, enum machine_mode));
extern int adjusted_comparison_operator PARAMS((rtx, enum machine_mode)); extern int adjusted_comparison_operator PARAMS((rtx, enum machine_mode));
extern int call_multiple_values_operation PARAMS((rtx, enum machine_mode)); extern int call_multiple_values_operation PARAMS((rtx, enum machine_mode));
#endif
extern int ia64_rap_fp_offset PARAMS((void)); extern void ia64_expand_fetch_and_op PARAMS ((enum fetchop_code,
extern unsigned int ia64_compute_frame_size PARAMS((int)); enum machine_mode, rtx []));
extern void save_restore_insns PARAMS((int)); extern void ia64_expand_op_and_fetch PARAMS ((enum fetchop_code,
extern void ia64_expand_prologue PARAMS((void)); enum machine_mode, rtx []));
extern void ia64_expand_epilogue PARAMS((void));
extern void ia64_function_prologue PARAMS((FILE *, int)); extern void ia64_print_operand_address PARAMS((FILE *, rtx));
extern void ia64_funtion_epilogue PARAMS((FILE *, int)); extern void ia64_print_operand PARAMS((FILE *, rtx, int));
extern int ia64_direct_return PARAMS((void)); extern enum reg_class ia64_secondary_reload_class PARAMS((enum reg_class,
enum machine_mode,
rtx));
extern void ia64_reorg PARAMS((rtx));
#endif /* RTX_CODE */
#ifdef TREE_CODE #ifdef TREE_CODE
extern void ia64_setup_incoming_varargs PARAMS((CUMULATIVE_ARGS, int, tree,
int *, int));
#ifdef RTX_CODE #ifdef RTX_CODE
extern rtx ia64_function_arg PARAMS((CUMULATIVE_ARGS *, enum machine_mode, extern rtx ia64_function_arg PARAMS((CUMULATIVE_ARGS *, enum machine_mode,
tree, int, int)); tree, int, int));
extern void ia64_init_builtins PARAMS((void)); extern rtx ia64_expand_builtin PARAMS((tree, rtx, rtx,
extern rtx ia64_expand_builtin PARAMS((tree, rtx, rtx, enum machine_mode, int)); enum machine_mode, int));
#endif extern void ia64_va_start PARAMS((int, tree, rtx));
extern rtx ia64_va_arg PARAMS((tree, tree));
extern rtx ia64_function_value PARAMS((tree, tree));
#endif /* RTX_CODE */
extern void ia64_setup_incoming_varargs PARAMS((CUMULATIVE_ARGS, int, tree,
int *, int));
extern int ia64_function_arg_partial_nregs PARAMS((CUMULATIVE_ARGS *, extern int ia64_function_arg_partial_nregs PARAMS((CUMULATIVE_ARGS *,
enum machine_mode, enum machine_mode,
tree, int)); tree, int));
extern void ia64_function_arg_advance PARAMS((CUMULATIVE_ARGS *, extern void ia64_function_arg_advance PARAMS((CUMULATIVE_ARGS *,
enum machine_mode, enum machine_mode,
tree, int)); tree, int));
#ifdef RTX_CODE
extern void ia64_va_start PARAMS((int, tree, rtx));
extern rtx ia64_va_arg PARAMS((tree, tree));
#endif
extern int ia64_return_in_memory PARAMS((tree)); extern int ia64_return_in_memory PARAMS((tree));
#ifdef RTX_CODE extern void ia64_asm_output_external PARAMS((FILE *, tree, const char *));
extern rtx ia64_function_value PARAMS((tree, tree));
#endif
#endif
#ifdef RTX_CODE
extern void ia64_print_operand_address PARAMS((FILE *, rtx));
extern void ia64_print_operand PARAMS((FILE *, rtx, int));
extern enum reg_class ia64_secondary_reload_class PARAMS((enum reg_class,
enum machine_mode,
rtx));
#endif
#ifdef TREE_CODE
extern void ia64_asm_output_external PARAMS((FILE *, tree, char *));
#endif
extern void ia64_override_options PARAMS((void));
#ifdef RTX_CODE
extern void ia64_reorg PARAMS((rtx));
#endif
extern int ia64_epilogue_uses PARAMS((int));
#ifdef TREE_CODE
extern int ia64_valid_type_attribute PARAMS((tree, tree, tree, tree)); extern int ia64_valid_type_attribute PARAMS((tree, tree, tree, tree));
extern void ia64_encode_section_info PARAMS((tree)); extern void ia64_encode_section_info PARAMS((tree));
#endif #endif /* TREE_CODE */
extern int ia64_epilogue_uses PARAMS((int));
extern void ia64_expand_prologue PARAMS((void));
extern void ia64_expand_epilogue PARAMS((void));
extern int ia64_direct_return PARAMS((void));
extern int ia64_rap_fp_offset PARAMS((void));
extern void ia64_init_builtins PARAMS((void));
extern void ia64_override_options PARAMS((void));
extern unsigned int ia64_compute_frame_size PARAMS((int));
extern void save_restore_insns PARAMS((int));
extern void ia64_function_prologue PARAMS((FILE *, int));
extern void ia64_funtion_epilogue PARAMS((FILE *, int));
...@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */
#include "function.h" #include "function.h"
#include "ggc.h" #include "ggc.h"
#include "basic-block.h" #include "basic-block.h"
#include "toplev.h"
/* This is used for communication between ASM_OUTPUT_LABEL and /* This is used for communication between ASM_OUTPUT_LABEL and
ASM_OUTPUT_LABELREF. */ ASM_OUTPUT_LABELREF. */
...@@ -199,7 +200,7 @@ setjmp_operand (op, mode) ...@@ -199,7 +200,7 @@ setjmp_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode;
{ {
char *name; const char *name;
int retval = 0; int retval = 0;
if (GET_CODE (op) != SYMBOL_REF) if (GET_CODE (op) != SYMBOL_REF)
...@@ -1779,13 +1780,13 @@ ia64_print_operand (file, x, code) ...@@ -1779,13 +1780,13 @@ ia64_print_operand (file, x, code)
return; return;
case 'S': case 'S':
fprintf (file, HOST_WIDE_INT_PRINT_DEC, exact_log2 (INTVAL (x))); fprintf (file, "%d", exact_log2 (INTVAL (x)));
return; return;
case 'T': case 'T':
if (! TARGET_GNU_AS && GET_CODE (x) == CONST_INT) if (! TARGET_GNU_AS && GET_CODE (x) == CONST_INT)
{ {
fprintf (file, "0x%x", INTVAL (x) & 0xffffffff); fprintf (file, "0x%x", (int) INTVAL (x) & 0xffffffff);
return; return;
} }
break; break;
...@@ -1799,7 +1800,7 @@ ia64_print_operand (file, x, code) ...@@ -1799,7 +1800,7 @@ ia64_print_operand (file, x, code)
fprintf (file, "0xffffffff"); fprintf (file, "0xffffffff");
prefix = ""; prefix = "";
} }
fprintf (file, "%s%x", prefix, INTVAL (x) & 0xffffffff); fprintf (file, "%s%x", prefix, (int) INTVAL (x) & 0xffffffff);
return; return;
} }
break; break;
...@@ -1928,7 +1929,7 @@ void ...@@ -1928,7 +1929,7 @@ void
ia64_asm_output_external (file, decl, name) ia64_asm_output_external (file, decl, name)
FILE *file; FILE *file;
tree decl; tree decl;
char *name; const char *name;
{ {
int save_referenced; int save_referenced;
...@@ -2812,8 +2813,7 @@ ia64_encode_section_info (decl) ...@@ -2812,8 +2813,7 @@ ia64_encode_section_info (decl)
".sbss"))) ".sbss")))
{ {
int size = int_size_in_bytes (TREE_TYPE (decl)); int size = int_size_in_bytes (TREE_TYPE (decl));
char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0); const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
int reloc;
/* ??? We should redeclare CTOR_LIST, DTOR_END so that we don't have to /* ??? We should redeclare CTOR_LIST, DTOR_END so that we don't have to
special case them here. Currently we put them in ctor/dtors sections special case them here. Currently we put them in ctor/dtors sections
...@@ -2852,7 +2852,7 @@ ia64_encode_section_info (decl) ...@@ -2852,7 +2852,7 @@ ia64_encode_section_info (decl)
&& (XSTR (XEXP (DECL_RTL (decl), 0), 0)[0] && (XSTR (XEXP (DECL_RTL (decl), 0), 0)[0]
== SDATA_NAME_FLAG_CHAR)) == SDATA_NAME_FLAG_CHAR))
{ {
char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0); const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
int len = strlen (str); int len = strlen (str);
char *newstr = obstack_alloc (saveable_obstack, len); char *newstr = obstack_alloc (saveable_obstack, len);
...@@ -2901,12 +2901,13 @@ process_set (asm_out_file, pat) ...@@ -2901,12 +2901,13 @@ process_set (asm_out_file, pat)
rtx op1 = XEXP (src, 1); rtx op1 = XEXP (src, 1);
if (op0 == dest && GET_CODE (op1) == CONST_INT) if (op0 == dest && GET_CODE (op1) == CONST_INT)
{ {
fprintf (asm_out_file, "\t.fframe %d\n", -INTVAL (op1)); fputs ("\t.fframe ", asm_out_file);
fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, -INTVAL (op1));
fputc ('\n', asm_out_file);
frame_size = INTVAL (op1); frame_size = INTVAL (op1);
return 1; return 1;
} }
else else if (op0 == dest && GET_CODE (op1) == REG)
if (op0 == dest && GET_CODE (op1) == REG)
{ {
fprintf (asm_out_file, "\t.vframe r%d\n", REGNO (op1)); fprintf (asm_out_file, "\t.vframe r%d\n", REGNO (op1));
frame_size = 0; frame_size = 0;
...@@ -3061,16 +3062,14 @@ process_for_unwind_directive (asm_out_file, insn) ...@@ -3061,16 +3062,14 @@ process_for_unwind_directive (asm_out_file, insn)
|| (flag_exceptions && !exceptions_via_longjmp)) || (flag_exceptions && !exceptions_via_longjmp))
&& RTX_FRAME_RELATED_P (insn)) && RTX_FRAME_RELATED_P (insn))
{ {
rtx code, pat; rtx pat = PATTERN (insn);
pat = PATTERN (insn);
switch (GET_CODE (pat)) switch (GET_CODE (pat))
{ {
case SET: case SET:
{
process_set (asm_out_file, pat); process_set (asm_out_file, pat);
break; break;
}
case PARALLEL: case PARALLEL:
{ {
int par_index; int par_index;
...@@ -3083,6 +3082,9 @@ process_for_unwind_directive (asm_out_file, insn) ...@@ -3083,6 +3082,9 @@ process_for_unwind_directive (asm_out_file, insn)
} }
break; break;
} }
default:
abort ();
} }
} }
} }
...@@ -3432,7 +3434,7 @@ ia64_expand_compare_and_swap (icode, arglist, target, boolcode) ...@@ -3432,7 +3434,7 @@ ia64_expand_compare_and_swap (icode, arglist, target, boolcode)
int boolcode; int boolcode;
{ {
tree arg0, arg1, arg2; tree arg0, arg1, arg2;
rtx newlabel, newlabel2, op0, op1, op2, pat; rtx op0, op1, op2, pat;
enum machine_mode tmode, mode0, mode1, mode2; enum machine_mode tmode, mode0, mode1, mode2;
arg0 = TREE_VALUE (arglist); arg0 = TREE_VALUE (arglist);
...@@ -3517,29 +3519,35 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore) ...@@ -3517,29 +3519,35 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore)
enum machine_mode mode; enum machine_mode mode;
int ignore; int ignore;
{ {
rtx op0, op1, op2, op3, pat; rtx op0, op1, pat;
rtx tmp_reg; rtx tmp_reg;
rtx newlabel, newlabel2; tree arg0, arg1;
tree arg0, arg1, arg2, arg3;
tree arglist = TREE_OPERAND (exp, 1); tree arglist = TREE_OPERAND (exp, 1);
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
int fcode = DECL_FUNCTION_CODE (fndecl); int fcode = DECL_FUNCTION_CODE (fndecl);
enum machine_mode tmode, mode0, mode1, mode2, mode3; enum machine_mode tmode, mode0, mode1;
enum insn_code icode; enum insn_code icode;
int boolcode = 0;
int i; int i;
struct builtin_description *d; struct builtin_description *d;
switch (fcode) switch (fcode)
{ {
case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI: case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI:
return ia64_expand_compare_and_swap (CODE_FOR_val_compare_and_swap_si, arglist, target, 1); return ia64_expand_compare_and_swap (CODE_FOR_val_compare_and_swap_si,
arglist, target, 1);
case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI: case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI:
return ia64_expand_compare_and_swap (CODE_FOR_val_compare_and_swap_si, arglist, target, 0); return ia64_expand_compare_and_swap (CODE_FOR_val_compare_and_swap_si,
arglist, target, 0);
case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI: case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI:
return ia64_expand_compare_and_swap (CODE_FOR_val_compare_and_swap_di, arglist, target, 1); return ia64_expand_compare_and_swap (CODE_FOR_val_compare_and_swap_di,
arglist, target, 1);
case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI: case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI:
return ia64_expand_compare_and_swap (CODE_FOR_val_compare_and_swap_di, arglist, target, 0); return ia64_expand_compare_and_swap (CODE_FOR_val_compare_and_swap_di,
arglist, target, 0);
case IA64_BUILTIN_SYNCHRONIZE: case IA64_BUILTIN_SYNCHRONIZE:
/* Pass a volatile memory operand. */ /* Pass a volatile memory operand. */
tmp_reg = gen_rtx_REG (DImode, GR_REG(0)); tmp_reg = gen_rtx_REG (DImode, GR_REG(0));
...@@ -3623,6 +3631,5 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore) ...@@ -3623,6 +3631,5 @@ ia64_expand_builtin (exp, target, subtarget, mode, ignore)
if (d->code == fcode) if (d->code == fcode)
return ia64_expand_binop_builtin (d->icode, arglist, target); return ia64_expand_binop_builtin (d->icode, arglist, target);
fail:
return 0; return 0;
} }
...@@ -2205,7 +2205,7 @@ do { \ ...@@ -2205,7 +2205,7 @@ do { \
to assemble a single byte containing the number VALUE. */ to assemble a single byte containing the number VALUE. */
#define ASM_OUTPUT_BYTE(STREAM, VALUE) \ #define ASM_OUTPUT_BYTE(STREAM, VALUE) \
fprintf (STREAM, "\t%s\t0x%x\n", ASM_BYTE_OP, (VALUE)) fprintf (STREAM, "\t%s\t0x%x\n", ASM_BYTE_OP, (int)(VALUE) & 0xff)
/* These macros are defined as C string constant, describing the syntax in the /* These macros are defined as C string constant, describing the syntax in the
assembler for grouping arithmetic expressions. */ assembler for grouping arithmetic expressions. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment