diff options
Diffstat (limited to 'gas/config/tc-tic54x.c')
-rw-r--r-- | gas/config/tc-tic54x.c | 652 |
1 files changed, 167 insertions, 485 deletions
diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c index 823015a..68d541a 100644 --- a/gas/config/tc-tic54x.c +++ b/gas/config/tc-tic54x.c @@ -1,5 +1,5 @@ /* tc-tic54x.c -- Assembly code for the Texas Instruments TMS320C54X - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Timothy Wall (twall@cygnus.com) @@ -222,125 +222,14 @@ static struct hash_control *misc_symbol_hash; } \ while (0) -static void tic54x_emit_char PARAMS ((char)); -static fragS * frag_prev PARAMS ((fragS *, segT)); -static fragS * bit_offset_frag PARAMS ((fragS *, segT)); -static int frag_bit_offset PARAMS ((fragS *, segT)); -static char * parse_expression PARAMS ((char *, expressionS *)); -static void tic54x_asg PARAMS ((int)); -static void tic54x_eval PARAMS ((int)); -static void tic54x_bss PARAMS ((int)); -static void stag_add_field_symbols PARAMS ((struct stag *, const char *, bfd_vma, symbolS *, const char *)); -static void stag_add_field PARAMS ((struct stag *, const char *, bfd_vma, struct stag *)); -static void tic54x_struct PARAMS ((int)); -static void tic54x_endstruct PARAMS ((int)); -static void tic54x_tag PARAMS ((int)); -static void tic54x_struct_field PARAMS ((int)); -static void tic54x_cons PARAMS ((int)); -static void tic54x_remove_local_label PARAMS ((const char *, PTR)); -static void tic54x_clear_local_labels PARAMS ((int)); -static void tic54x_sect PARAMS ((int)); -static void tic54x_space PARAMS ((int)); -static void tic54x_usect PARAMS ((int)); -static enum cpu_version lookup_version PARAMS ((const char *)); -static void set_cpu PARAMS ((enum cpu_version)); -static void tic54x_version PARAMS ((int)); -static void tic54x_float_cons PARAMS ((int)); -static void tic54x_stringer PARAMS ((int)); -static void tic54x_p2align PARAMS ((int)); -static void tic54x_align_words PARAMS ((int)); -static void tic54x_field PARAMS ((int)); -static int tic54x_initialized_section PARAMS ((segT)); -static void tic54x_clink PARAMS ((int)); -static void tic54x_set_default_include PARAMS ((int)); -static void tic54x_include PARAMS ((int)); -static void tic54x_message PARAMS ((int)); -static void tic54x_label PARAMS ((int)); -static void tic54x_mmregs PARAMS ((int)); -static void tic54x_loop PARAMS ((int)); -static void tic54x_endloop PARAMS ((int)); -static void tic54x_break PARAMS ((int)); -static void set_address_mode PARAMS ((int)); -static void tic54x_address_mode PARAMS ((int)); -static void tic54x_sblock PARAMS ((int)); -static void tic54x_set PARAMS ((int)); -static void tic54x_fclist PARAMS ((int)); -static void tic54x_sslist PARAMS ((int)); -static void tic54x_var PARAMS ((int)); -static void tic54x_mlib PARAMS ((int)); -static int subsym_symlen PARAMS ((char *, char *)); -static int subsym_symcmp PARAMS ((char *, char *)); -static int subsym_firstch PARAMS ((char *, char *)); -static int subsym_lastch PARAMS ((char *, char *)); -static int subsym_isdefed PARAMS ((char *, char *)); -static int subsym_ismember PARAMS ((char *, char *)); -static int subsym_iscons PARAMS ((char *, char *)); -static int subsym_isname PARAMS ((char *, char *)); -static int subsym_isreg PARAMS ((char *, char *)); -static int subsym_structsz PARAMS ((char *, char *)); -static int subsym_structacc PARAMS ((char *, char *)); -static float math_ceil PARAMS ((float, float)); -static float math_cvi PARAMS ((float, float)); -static float math_floor PARAMS ((float, float)); -static float math_fmod PARAMS ((float, float)); -static float math_int PARAMS ((float, float)); -static float math_round PARAMS ((float, float)); -static float math_sgn PARAMS ((float, float)); -static float math_trunc PARAMS ((float, float)); -static float math_acos PARAMS ((float, float)); -static float math_asin PARAMS ((float, float)); -static float math_atan PARAMS ((float, float)); -static float math_atan2 PARAMS ((float, float)); -static float math_cosh PARAMS ((float, float)); -static float math_cos PARAMS ((float, float)); -static float math_cvf PARAMS ((float, float)); -static float math_exp PARAMS ((float, float)); -static float math_fabs PARAMS ((float, float)); -static float math_ldexp PARAMS ((float, float)); -static float math_log10 PARAMS ((float, float)); -static float math_log PARAMS ((float, float)); -static float math_max PARAMS ((float, float)); -static float math_min PARAMS ((float, float)); -static float math_pow PARAMS ((float, float)); -static float math_sin PARAMS ((float, float)); -static float math_sinh PARAMS ((float, float)); -static float math_sqrt PARAMS ((float, float)); -static float math_tan PARAMS ((float, float)); -static float math_tanh PARAMS ((float, float)); -static int is_accumulator PARAMS ((struct opstruct *)); -static int get_operands PARAMS ((struct opstruct operands[], char *)); -static int is_immediate PARAMS ((struct opstruct *)); -static int is_absolute PARAMS ((struct opstruct *)); -static int is_indirect PARAMS ((struct opstruct *)); -static int is_dual PARAMS ((struct opstruct *)); -static int is_mmreg PARAMS ((struct opstruct *)); -static int is_type PARAMS ((struct opstruct *, enum optype)); -static int operands_match PARAMS ((tic54x_insn *, struct opstruct *, int, const enum optype *, int, int)); -static int encode_dmad PARAMS ((tic54x_insn *, struct opstruct *, int)); -static int encode_address PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_indirect PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_integer PARAMS ((tic54x_insn *, struct opstruct *, int, int, int, unsigned short)); -static int encode_condition PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_cc3 PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_arx PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_cc2 PARAMS ((tic54x_insn *, struct opstruct *)); -static int encode_operand PARAMS ((tic54x_insn *, enum optype, struct opstruct *)); -static void emit_insn PARAMS ((tic54x_insn *)); -static int build_insn PARAMS ((tic54x_insn *)); -static int optimize_insn PARAMS ((tic54x_insn *)); -static int tic54x_parse_insn PARAMS ((tic54x_insn *, char *)); -static int next_line_shows_parallel PARAMS ((char *)); -static int tic54x_parse_parallel_insn_firstline PARAMS ((tic54x_insn *, char *)); -static int tic54x_parse_parallel_insn_lastline PARAMS ((tic54x_insn *, char *)); -static char * subsym_get_arg PARAMS ((char *, char *, char **, int)); -static void subsym_create_or_replace PARAMS ((char *, char *)); -static char * subsym_lookup PARAMS ((char *, int)); -static char * subsym_substitute PARAMS ((char *, int)); + +static void subsym_create_or_replace (char *, char *); +static char *subsym_lookup (char *, int); +static char *subsym_substitute (char *, int); void -md_show_usage (stream) - FILE *stream; +md_show_usage (FILE *stream) { fprintf (stream, _("C54x-specific command line options:\n")); fprintf (stream, _("-mfar-mode | -mf Use extended addressing\n")); @@ -352,8 +241,7 @@ md_show_usage (stream) /* Output a single character (upper octect is zero). */ static void -tic54x_emit_char (c) - char c; +tic54x_emit_char (char c) { expressionS exp; @@ -365,9 +253,7 @@ tic54x_emit_char (c) /* Walk backwards in the frag chain. */ static fragS * -frag_prev (frag, seg) - fragS *frag; - segT seg; +frag_prev (fragS *frag, segT seg) { segment_info_type *seginfo = seg_info (seg); fragS *fragp; @@ -380,9 +266,7 @@ frag_prev (frag, seg) } static fragS * -bit_offset_frag (frag, seg) - fragS *frag; - segT seg; +bit_offset_frag (fragS *frag, segT seg) { while (frag != NULL) { @@ -400,9 +284,7 @@ bit_offset_frag (frag, seg) none. .field/.space/.bes may leave words partially allocated. */ static int -frag_bit_offset (frag, seg) - fragS *frag; - segT seg; +frag_bit_offset (fragS *frag, segT seg) { frag = bit_offset_frag (frag, seg); @@ -416,9 +298,7 @@ frag_bit_offset (frag, seg) expression. */ static char * -parse_expression (str, exp) - char *str; - expressionS * exp; +parse_expression (char *str, expressionS *exp) { char *s; char *tmp; @@ -438,8 +318,7 @@ parse_expression (str, exp) unsupported. */ static void -tic54x_asg (x) - int x ATTRIBUTE_UNUSED; +tic54x_asg (int x ATTRIBUTE_UNUSED) { int c; char *name; @@ -500,8 +379,7 @@ tic54x_asg (x) table, since that's what works best. */ static void -tic54x_eval (x) - int x ATTRIBUTE_UNUSED; +tic54x_eval (int x ATTRIBUTE_UNUSED) { char c; int value; @@ -577,8 +455,7 @@ tic54x_eval (x) (not yet implemented). */ static void -tic54x_bss (x) - int x ATTRIBUTE_UNUSED; +tic54x_bss (int x ATTRIBUTE_UNUSED) { char c; char *name; @@ -667,12 +544,11 @@ tic54x_bss (x) } static void -stag_add_field_symbols (stag, path, base_offset, rootsym, root_stag_name) - struct stag *stag; - const char *path; - bfd_vma base_offset; - symbolS *rootsym; - const char *root_stag_name; +stag_add_field_symbols (struct stag *stag, + const char *path, + bfd_vma base_offset, + symbolS *rootsym, + const char *root_stag_name) { char prefix[strlen (path) + 2]; struct stag_field *field = stag->field; @@ -725,11 +601,10 @@ stag_add_field_symbols (stag, path, base_offset, rootsym, root_stag_name) complete dereferencing symbols to the symbol table. */ static void -stag_add_field (parent, name, offset, stag) - struct stag *parent; - const char *name; - bfd_vma offset; - struct stag *stag; +stag_add_field (struct stag *parent, + const char *name, + bfd_vma offset, + struct stag *stag) { struct stag_field *sfield = xmalloc (sizeof (struct stag_field)); @@ -761,8 +636,7 @@ stag_add_field (parent, name, offset, stag) Start defining structure offsets (symbols in absolute section). */ static void -tic54x_struct (arg) - int arg; +tic54x_struct (int arg) { int start_offset = 0; int is_union = arg; @@ -842,8 +716,7 @@ tic54x_struct (arg) of the structure. */ static void -tic54x_endstruct (is_union) - int is_union; +tic54x_endstruct (int is_union) { int size; const char *path = @@ -908,8 +781,7 @@ tic54x_endstruct (is_union) format on the existing allocated space. */ static void -tic54x_tag (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_tag (int ignore ATTRIBUTE_UNUSED) { char *name = input_line_pointer; int c = get_symbol_end (); @@ -968,8 +840,7 @@ tic54x_tag (ignore) and .word. */ static void -tic54x_struct_field (type) - int type; +tic54x_struct_field (int type) { int size; int count = 1; @@ -1088,8 +959,7 @@ tic54x_struct_field (type) /* Handle .byte, .word. .int, .long and all variants. */ static void -tic54x_cons (type) - int type; +tic54x_cons (int type) { unsigned int c; int octets; @@ -1227,8 +1097,7 @@ tic54x_cons (type) these, so we ignore the type here. */ void -tic54x_global (type) - int type; +tic54x_global (int type) { char *name; int c; @@ -1262,19 +1131,16 @@ tic54x_global (type) /* Remove the symbol from the local label hash lookup. */ static void -tic54x_remove_local_label (key, value) - const char *key; - PTR value ATTRIBUTE_UNUSED; +tic54x_remove_local_label (const char *key, void *value ATTRIBUTE_UNUSED) { - PTR *elem = hash_delete (local_label_hash[macro_level], key, FALSE); + void *elem = hash_delete (local_label_hash[macro_level], key, FALSE); free (elem); } /* Reset all local labels. */ static void -tic54x_clear_local_labels (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_clear_local_labels (int ignored ATTRIBUTE_UNUSED) { hash_traverse (local_label_hash[macro_level], tic54x_remove_local_label); } @@ -1293,8 +1159,7 @@ tic54x_clear_local_labels (ignored) */ static void -tic54x_sect (arg) - int arg; +tic54x_sect (int arg) { ILLEGAL_WITHIN_STRUCT (); @@ -1355,8 +1220,7 @@ tic54x_sect (arg) cribbed from s_space. */ static void -tic54x_space (arg) - int arg; +tic54x_space (int arg) { expressionS exp; char *p = 0; @@ -1487,8 +1351,7 @@ tic54x_space (arg) Has no effect on the current section. */ static void -tic54x_usect (x) - int x ATTRIBUTE_UNUSED; +tic54x_usect (int x ATTRIBUTE_UNUSED) { char c; char *name; @@ -1584,8 +1447,7 @@ tic54x_usect (x) } static enum cpu_version -lookup_version (ver) - const char *ver; +lookup_version (const char *ver) { enum cpu_version version = VNONE; @@ -1606,8 +1468,7 @@ lookup_version (ver) } static void -set_cpu (version) - enum cpu_version version; +set_cpu (enum cpu_version version) { cpu = version; if (version == V545LP || version == V546LP) @@ -1634,8 +1495,7 @@ set_cpu (version) static int cpu_needs_set = 1; static void -tic54x_version (x) - int x ATTRIBUTE_UNUSED; +tic54x_version (int x ATTRIBUTE_UNUSED) { enum cpu_version version = VNONE; enum cpu_version old_version = cpu; @@ -1678,8 +1538,7 @@ tic54x_version (x) /* 'f' = float, 'x' = xfloat, 'd' = double, 'l' = ldouble. */ static void -tic54x_float_cons (type) - int type; +tic54x_float_cons (int type) { if (current_stag != 0) tic54x_struct_field ('f'); @@ -1709,8 +1568,7 @@ tic54x_float_cons (type) and encoded into the correct octets. */ static void -tic54x_stringer (type) - int type; +tic54x_stringer (int type) { unsigned int c; char *start; @@ -1797,15 +1655,13 @@ tic54x_stringer (type) } static void -tic54x_p2align (arg) - int arg ATTRIBUTE_UNUSED; +tic54x_p2align (int arg ATTRIBUTE_UNUSED) { as_bad (_("p2align not supported on this target")); } static void -tic54x_align_words (arg) - int arg; +tic54x_align_words (int arg) { /* Only ".align" with no argument is allowed within .struct/.union. */ int count = arg; @@ -1837,8 +1693,7 @@ tic54x_align_words (arg) /* Initialize multiple-bit fields withing a single word of memory. */ static void -tic54x_field (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_field (int ignore ATTRIBUTE_UNUSED) { expressionS exp; int size = 16; @@ -1961,8 +1816,7 @@ tic54x_field (ignore) available yet. seg_info ()->bss is the next best thing. */ static int -tic54x_initialized_section (seg) - segT seg; +tic54x_initialized_section (segT seg) { return !seg_info (seg)->bss; } @@ -1975,8 +1829,7 @@ tic54x_initialized_section (seg) Name is required for uninitialized sections. */ static void -tic54x_clink (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_clink (int ignored ATTRIBUTE_UNUSED) { segT seg = now_seg; @@ -2023,8 +1876,7 @@ tic54x_clink (ignored) set to "." instead. */ static void -tic54x_set_default_include (dot) - int dot; +tic54x_set_default_include (int dot) { char *dir = "."; char *tmp = NULL; @@ -2069,8 +1921,7 @@ tic54x_set_default_include (dot) Entering/exiting included/copied file clears all local labels. */ static void -tic54x_include (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_include (int ignored ATTRIBUTE_UNUSED) { char newblock[] = " .newblock\n"; char *filename; @@ -2113,8 +1964,7 @@ tic54x_include (ignored) } static void -tic54x_message (type) - int type; +tic54x_message (int type) { char *msg; char c; @@ -2160,8 +2010,7 @@ tic54x_message (type) run address (vma). */ static void -tic54x_label (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_label (int ignored ATTRIBUTE_UNUSED) { char *name = input_line_pointer; symbolS *symbolP; @@ -2182,8 +2031,7 @@ tic54x_label (ignored) absolute local symbols. */ static void -tic54x_mmregs (ignored) - int ignored ATTRIBUTE_UNUSED; +tic54x_mmregs (int ignored ATTRIBUTE_UNUSED) { symbol *sym; @@ -2202,8 +2050,7 @@ tic54x_mmregs (ignored) Count defaults to 1024. */ static void -tic54x_loop (count) - int count; +tic54x_loop (int count) { ILLEGAL_WITHIN_STRUCT (); @@ -2217,8 +2064,7 @@ tic54x_loop (count) /* Normally, endloop gets eaten by the preceding loop. */ static void -tic54x_endloop (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_endloop (int ignore ATTRIBUTE_UNUSED) { as_bad (_("ENDLOOP without corresponding LOOP")); ignore_rest_of_line (); @@ -2227,8 +2073,7 @@ tic54x_endloop (ignore) /* .break [condition]. */ static void -tic54x_break (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_break (int ignore ATTRIBUTE_UNUSED) { int cond = 1; @@ -2243,8 +2088,7 @@ tic54x_break (ignore) } static void -set_address_mode (mode) - int mode; +set_address_mode (int mode) { amode = mode; if (mode == far_mode) @@ -2259,8 +2103,7 @@ set_address_mode (mode) static int address_mode_needs_set = 1; static void -tic54x_address_mode (mode) - int mode; +tic54x_address_mode (int mode) { if (assembly_begun && amode != (unsigned) mode) { @@ -2283,8 +2126,7 @@ tic54x_address_mode (mode) Designate initialized sections for blocking. */ static void -tic54x_sblock (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_sblock (int ignore ATTRIBUTE_UNUSED) { int c = ','; @@ -2341,8 +2183,7 @@ tic54x_sblock (ignore) symbols assigned with .set/.equ may not be redefined. */ static void -tic54x_set (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_set (int ignore ATTRIBUTE_UNUSED) { symbolS *symbolP; char *name; @@ -2376,8 +2217,7 @@ tic54x_set (ignore) List false conditional blocks. */ static void -tic54x_fclist (show) - int show; +tic54x_fclist (int show) { if (show) listing &= ~LISTING_NOCOND; @@ -2387,8 +2227,7 @@ tic54x_fclist (show) } static void -tic54x_sslist (show) - int show; +tic54x_sslist (int show) { ILLEGAL_WITHIN_STRUCT (); @@ -2399,8 +2238,7 @@ tic54x_sslist (show) Define a substitution string to be local to a macro. */ static void -tic54x_var (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_var (int ignore ATTRIBUTE_UNUSED) { static char empty[] = ""; char *name; @@ -2448,8 +2286,7 @@ tic54x_var (ignore) FIXME need to try the source file directory as well. */ static void -tic54x_mlib (ignore) - int ignore ATTRIBUTE_UNUSED; +tic54x_mlib (int ignore ATTRIBUTE_UNUSED) { char *filename; char *path; @@ -2638,9 +2475,7 @@ const pseudo_typeS md_pseudo_table[] = }; int -md_parse_option (c, arg) - int c; - char *arg; +md_parse_option (int c, char *arg) { switch (c) { @@ -2690,7 +2525,7 @@ md_parse_option (c, arg) deleting the local label hash between macro invocations. */ void -tic54x_macro_start () +tic54x_macro_start (void) { ++macro_level; subsym_hash[macro_level] = hash_new (); @@ -2698,8 +2533,7 @@ tic54x_macro_start () } void -tic54x_macro_info (macro) - const macro_entry *macro; +tic54x_macro_info (const macro_entry *macro) { const formal_entry *entry; @@ -2720,7 +2554,7 @@ tic54x_macro_info (macro) /* Get rid of this macro's .var's, arguments, and local labels. */ void -tic54x_macro_end () +tic54x_macro_end (void) { hash_die (subsym_hash[macro_level]); subsym_hash[macro_level] = NULL; @@ -2730,9 +2564,7 @@ tic54x_macro_end () } static int -subsym_symlen (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_symlen (char *a, char *ignore ATTRIBUTE_UNUSED) { return strlen (a); } @@ -2740,9 +2572,7 @@ subsym_symlen (a, ignore) /* Compare symbol A to string B. */ static int -subsym_symcmp (a, b) - char *a; - char *b; +subsym_symcmp (char *a, char *b) { return strcmp (a, b); } @@ -2751,9 +2581,7 @@ subsym_symcmp (a, b) assumes b is an integer char value as a string. Index is one-based. */ static int -subsym_firstch (a, b) - char *a; - char *b; +subsym_firstch (char *a, char *b) { int val = atoi (b); char *tmp = strchr (a, val); @@ -2764,9 +2592,7 @@ subsym_firstch (a, b) /* Similar to firstch, but returns index of last occurrence of B in A. */ static int -subsym_lastch (a, b) - char *a; - char *b; +subsym_lastch (char *a, char *b) { int val = atoi (b); char *tmp = strrchr (a, val); @@ -2778,9 +2604,7 @@ subsym_lastch (a, b) symbol table). */ static int -subsym_isdefed (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_isdefed (char *a, char *ignore ATTRIBUTE_UNUSED) { symbolS *symbolP = symbol_find (a); @@ -2792,9 +2616,7 @@ subsym_isdefed (a, ignore) symbols, unsubstituted. */ static int -subsym_ismember (sym, list) - char *sym; - char *list; +subsym_ismember (char *sym, char *list) { char *elem, *ptr, *listv; @@ -2832,9 +2654,7 @@ subsym_ismember (sym, list) 5 if decimal. */ static int -subsym_iscons (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_iscons (char *a, char *ignore ATTRIBUTE_UNUSED) { expressionS exp; @@ -2873,9 +2693,7 @@ subsym_iscons (a, ignore) /* Return 1 if A is a valid symbol name. Expects string input. */ static int -subsym_isname (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_isname (char *a, char *ignore ATTRIBUTE_UNUSED) { if (!is_name_beginner (*a)) return 0; @@ -2893,9 +2711,7 @@ subsym_isname (a, ignore) Note this does not recognize "A" or "B" accumulators. */ static int -subsym_isreg (a, ignore) - char *a; - char *ignore ATTRIBUTE_UNUSED; +subsym_isreg (char *a, char *ignore ATTRIBUTE_UNUSED) { if (hash_find (reg_hash, a)) return 1; @@ -2907,9 +2723,7 @@ subsym_isreg (a, ignore) /* Return the structure size, given the stag. */ static int -subsym_structsz (name, ignore) - char *name; - char *ignore ATTRIBUTE_UNUSED; +subsym_structsz (char *name, char *ignore ATTRIBUTE_UNUSED) { struct stag *stag = (struct stag *) hash_find (stag_hash, name); @@ -2927,145 +2741,110 @@ subsym_structsz (name, ignore) return zero, we punt and return zero. */ static int -subsym_structacc (stag_name, ignore) - char *stag_name ATTRIBUTE_UNUSED; - char *ignore ATTRIBUTE_UNUSED; +subsym_structacc (char *stag_name ATTRIBUTE_UNUSED, + char *ignore ATTRIBUTE_UNUSED) { return 0; } static float -math_ceil (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_ceil (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) ceil (arg1); } static float -math_cvi (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_cvi (float arg1, float ignore ATTRIBUTE_UNUSED) { return (int) arg1; } static float -math_floor (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_floor (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) floor (arg1); } static float -math_fmod (arg1, arg2) - float arg1; - float arg2; +math_fmod (float arg1, float arg2) { return (int) arg1 % (int) arg2; } static float -math_int (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_int (float arg1, float ignore ATTRIBUTE_UNUSED) { return ((float) ((int) arg1)) == arg1; } static float -math_round (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_round (float arg1, float ignore ATTRIBUTE_UNUSED) { return arg1 > 0 ? (int) (arg1 + 0.5) : (int) (arg1 - 0.5); } static float -math_sgn (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_sgn (float arg1, float ignore ATTRIBUTE_UNUSED) { return (arg1 < 0) ? -1 : (arg1 ? 1 : 0); } static float -math_trunc (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_trunc (float arg1, float ignore ATTRIBUTE_UNUSED) { return (int) arg1; } static float -math_acos (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_acos (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) acos (arg1); } static float -math_asin (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_asin (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) asin (arg1); } static float -math_atan (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_atan (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) atan (arg1); } static float -math_atan2 (arg1, arg2) - float arg1; - float arg2; +math_atan2 (float arg1, float arg2) { return (float) atan2 (arg1, arg2); } static float -math_cosh (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_cosh (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) cosh (arg1); } static float -math_cos (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_cos (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) cos (arg1); } static float -math_cvf (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_cvf (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) arg1; } static float -math_exp (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_exp (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) exp (arg1); } static float -math_fabs (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_fabs (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) fabs (arg1); } @@ -3073,89 +2852,67 @@ math_fabs (arg1, ignore) /* expr1 * 2^expr2. */ static float -math_ldexp (arg1, arg2) - float arg1; - float arg2; +math_ldexp (float arg1, float arg2) { return arg1 * (float) pow (2.0, arg2); } static float -math_log10 (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_log10 (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) log10 (arg1); } static float -math_log (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_log (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) log (arg1); } static float -math_max (arg1, arg2) - float arg1; - float arg2; +math_max (float arg1, float arg2) { return (arg1 > arg2) ? arg1 : arg2; } static float -math_min (arg1, arg2) - float arg1; - float arg2; +math_min (float arg1, float arg2) { return (arg1 < arg2) ? arg1 : arg2; } static float -math_pow (arg1, arg2) - float arg1; - float arg2; +math_pow (float arg1, float arg2) { return (float) pow (arg1, arg2); } static float -math_sin (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_sin (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) sin (arg1); } static float -math_sinh (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_sinh (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) sinh (arg1); } static float -math_sqrt (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_sqrt (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) sqrt (arg1); } static float -math_tan (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_tan (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) tan (arg1); } static float -math_tanh (arg1, ignore) - float arg1; - float ignore ATTRIBUTE_UNUSED; +math_tanh (float arg1, float ignore ATTRIBUTE_UNUSED) { return (float) tanh (arg1); } @@ -3164,7 +2921,7 @@ math_tanh (arg1, ignore) typedef struct { char *name; - int (*proc) PARAMS ((char *, char *)); + int (*proc) (char *, char *); int nargs; } subsym_proc_entry; @@ -3188,7 +2945,7 @@ static const subsym_proc_entry subsym_procs[] = typedef struct { char *name; - float (*proc) PARAMS ((float, float)); + float (*proc) (float, float); int nargs; int int_return; } math_proc_entry; @@ -3230,7 +2987,7 @@ static const math_proc_entry math_procs[] = }; void -md_begin () +md_begin (void) { template *tm; symbol *sym; @@ -3339,8 +3096,7 @@ md_begin () } static int -is_accumulator (operand) - struct opstruct *operand; +is_accumulator (struct opstruct *operand) { return strcasecmp (operand->buf, "a") == 0 || strcasecmp (operand->buf, "b") == 0; @@ -3351,9 +3107,7 @@ is_accumulator (operand) the next array. */ static int -get_operands (operands, line) - struct opstruct operands[]; - char *line; +get_operands (struct opstruct operands[], char *line) { char *lptr = line; int numexp = 0; @@ -3482,8 +3236,7 @@ get_operands (operands, line) /* Predicates for different operand types. */ static int -is_immediate (operand) - struct opstruct *operand; +is_immediate (struct opstruct *operand) { return *operand->buf == '#'; } @@ -3492,8 +3245,7 @@ is_immediate (operand) and must *not* have the '#' prefix. */ static int -is_absolute (operand) - struct opstruct *operand; +is_absolute (struct opstruct *operand) { return operand->exp.X_op == O_constant && !is_immediate (operand); } @@ -3501,8 +3253,7 @@ is_absolute (operand) /* Is this an indirect operand? */ static int -is_indirect (operand) - struct opstruct *operand; +is_indirect (struct opstruct *operand) { return operand->buf[0] == '*'; } @@ -3510,8 +3261,7 @@ is_indirect (operand) /* Is this a valid dual-memory operand? */ static int -is_dual (operand) - struct opstruct *operand; +is_dual (struct opstruct *operand) { if (is_indirect (operand) && strncasecmp (operand->buf, "*ar", 3) == 0) { @@ -3531,8 +3281,7 @@ is_dual (operand) } static int -is_mmreg (operand) - struct opstruct *operand; +is_mmreg (struct opstruct *operand) { return (is_absolute (operand) || is_immediate (operand) @@ -3540,9 +3289,7 @@ is_mmreg (operand) } static int -is_type (operand, type) - struct opstruct *operand; - enum optype type; +is_type (struct opstruct *operand, enum optype type) { switch (type) { @@ -3646,13 +3393,12 @@ is_type (operand, type) } static int -operands_match (insn, operands, opcount, refoptype, minops, maxops) - tic54x_insn *insn; - struct opstruct *operands; - int opcount; - const enum optype *refoptype; - int minops; - int maxops; +operands_match (tic54x_insn *insn, + struct opstruct *operands, + int opcount, + const enum optype *refoptype, + int minops, + int maxops) { int op = 0, refop = 0; @@ -3715,10 +3461,7 @@ operands_match (insn, operands, opcount, refoptype, minops, maxops) 2 for the upper 7 bits of a 23-bit address (LDX). */ static int -encode_dmad (insn, operand, xpc_code) - tic54x_insn *insn; - struct opstruct *operand; - int xpc_code; +encode_dmad (tic54x_insn *insn, struct opstruct *operand, int xpc_code) { int op = 1 + insn->is_lkaddr; @@ -3779,9 +3522,7 @@ encode_dmad (insn, operand, xpc_code) /* 7-bit direct address encoding. */ static int -encode_address (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_address (tic54x_insn *insn, struct opstruct *operand) { /* Assumes that dma addresses are *always* in word 0 of the opcode. */ insn->opcode[0].addr_expr = operand->exp; @@ -3802,9 +3543,7 @@ encode_address (insn, operand) } static int -encode_indirect (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_indirect (tic54x_insn *insn, struct opstruct *operand) { int arf; int mod; @@ -3876,13 +3615,12 @@ encode_indirect (insn, operand) } static int -encode_integer (insn, operand, which, min, max, mask) - tic54x_insn *insn; - struct opstruct *operand; - int which; - int min; - int max; - unsigned short mask; +encode_integer (tic54x_insn *insn, + struct opstruct *operand, + int which, + int min, + int max, + unsigned short mask) { long parse, integer; @@ -3937,9 +3675,7 @@ encode_integer (insn, operand, which, min, max, mask) } static int -encode_condition (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_condition (tic54x_insn *insn, struct opstruct *operand) { symbol *cc = (symbol *) hash_find (cc_hash, operand->buf); if (!cc) @@ -3999,9 +3735,7 @@ encode_condition (insn, operand) } static int -encode_cc3 (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_cc3 (tic54x_insn *insn, struct opstruct *operand) { symbol *cc3 = (symbol *) hash_find (cc3_hash, operand->buf); int value = cc3 ? cc3->value : operand->exp.X_add_number << 8; @@ -4016,9 +3750,7 @@ encode_cc3 (insn, operand) } static int -encode_arx (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_arx (tic54x_insn *insn, struct opstruct *operand) { int arf = strlen (operand->buf) >= 3 ? operand->buf[2] - '0' : -1; @@ -4032,9 +3764,7 @@ encode_arx (insn, operand) } static int -encode_cc2 (insn, operand) - tic54x_insn *insn; - struct opstruct *operand; +encode_cc2 (tic54x_insn *insn, struct opstruct *operand) { symbol *cc2 = (symbol *) hash_find (cc2_hash, operand->buf); @@ -4048,10 +3778,7 @@ encode_cc2 (insn, operand) } static int -encode_operand (insn, type, operand) - tic54x_insn *insn; - enum optype type; - struct opstruct *operand; +encode_operand (tic54x_insn *insn, enum optype type, struct opstruct *operand) { int ext = (insn->tm->flags & FL_EXT) != 0; @@ -4274,8 +4001,7 @@ encode_operand (insn, type, operand) } static void -emit_insn (insn) - tic54x_insn *insn; +emit_insn (tic54x_insn *insn) { int i; flagword oldflags = bfd_get_section_flags (stdoutput, now_seg); @@ -4308,8 +4034,7 @@ emit_insn (insn) return the total number of words used by the instruction. */ static int -build_insn (insn) - tic54x_insn *insn; +build_insn (tic54x_insn *insn) { int i; @@ -4359,8 +4084,7 @@ build_insn (insn) } static int -optimize_insn (insn) - tic54x_insn *insn; +optimize_insn (tic54x_insn *insn) { /* Optimize some instructions, helping out the brain-dead programmer. */ #define is_zero(op) ((op).exp.X_op == O_constant && (op).exp.X_add_number == 0) @@ -4453,9 +4177,7 @@ optimize_insn (insn) /* Find a matching template if possible, and get the operand strings. */ static int -tic54x_parse_insn (insn, line) - tic54x_insn *insn; - char *line; +tic54x_parse_insn (tic54x_insn *insn, char *line) { insn->tm = (template *) hash_find (op_hash, insn->mnemonic); if (!insn->tm) @@ -4502,8 +4224,7 @@ static int parallel_on_next_line_hint = 0; Look for a subsequent line starting with "||". */ static int -next_line_shows_parallel (next_line) - char *next_line; +next_line_shows_parallel (char *next_line) { /* Look for the second half. */ while (ISSPACE (*next_line)) @@ -4514,9 +4235,7 @@ next_line_shows_parallel (next_line) } static int -tic54x_parse_parallel_insn_firstline (insn, line) - tic54x_insn *insn; - char *line; +tic54x_parse_parallel_insn_firstline (tic54x_insn *insn, char *line) { insn->tm = (template *) hash_find (parop_hash, insn->mnemonic); if (!insn->tm) @@ -4547,9 +4266,7 @@ tic54x_parse_parallel_insn_firstline (insn, line) /* Parse the second line of a two-line parallel instruction. */ static int -tic54x_parse_parallel_insn_lastline (insn, line) - tic54x_insn *insn; - char *line; +tic54x_parse_parallel_insn_lastline (tic54x_insn *insn, char *line) { int valid_mnemonic = 0; @@ -4587,11 +4304,7 @@ tic54x_parse_parallel_insn_lastline (insn, line) replacement on the value. */ static char * -subsym_get_arg (line, terminators, str, nosub) - char *line; - char *terminators; - char **str; - int nosub; +subsym_get_arg (char *line, char *terminators, char **str, int nosub) { char *ptr = line; char *endp; @@ -4654,9 +4367,7 @@ subsym_get_arg (line, terminators, str, nosub) that's compatible w/TI's assembler. */ static void -subsym_create_or_replace (name, value) - char *name; - char *value; +subsym_create_or_replace (char *name, char *value) { int i; @@ -4679,9 +4390,7 @@ subsym_create_or_replace (name, value) outwards. */ static char * -subsym_lookup (name, nest_level) - char *name; - int nest_level; +subsym_lookup (char *name, int nest_level) { char *value = hash_find (subsym_hash[nest_level], name); @@ -4699,9 +4408,7 @@ subsym_lookup (name, nest_level) If FORCED is set, look for forced substitutions of the form ':SYMBOL:'. */ static char * -subsym_substitute (line, forced) - char * line; - int forced; +subsym_substitute (char *line, int forced) { /* For each apparent symbol, see if it's a substitution symbol, and if so, replace it in the input. */ @@ -5060,7 +4767,7 @@ subsym_substitute (line, forced) returns the new buffer limit. */ void -tic54x_start_line_hook () +tic54x_start_line_hook (void) { char *line, *endp; char *replacement = NULL; @@ -5132,8 +4839,7 @@ tic54x_start_line_hook () machine dependent instruction. This function is supposed to emit the frags/bytes it assembles to. */ void -md_assemble (line) - char *line; +md_assemble (char *line) { static int repeat_slot = 0; static int delay_slots = 0; /* How many delay slots left to fill? */ @@ -5299,7 +5005,7 @@ md_assemble (line) a ".file" symbol. */ void -tic54x_adjust_symtab () +tic54x_adjust_symtab (void) { if (symbol_rootP == NULL || S_GET_STORAGE_CLASS (symbol_rootP) != C_FILE) @@ -5327,8 +5033,7 @@ tic54x_unrecognized_line (int c) FIXME -- obviously this isn't done yet. These locals still show up in the symbol table. */ void -tic54x_define_label (sym) - symbolS *sym; +tic54x_define_label (symbolS *sym) { /* Just in case we need this later; note that this is not necessarily the same thing as line_label... @@ -5342,8 +5047,7 @@ tic54x_define_label (sym) /* Try to parse something that normal parsing failed at. */ symbolS * -tic54x_undefined_symbol (name) - char *name; +tic54x_undefined_symbol (char *name) { symbol *sym; @@ -5375,9 +5079,8 @@ tic54x_undefined_symbol (name) it. */ int -tic54x_parse_name (name, exp) - char *name ATTRIBUTE_UNUSED; - expressionS *exp ATTRIBUTE_UNUSED; +tic54x_parse_name (char *name ATTRIBUTE_UNUSED, + expressionS *exp ATTRIBUTE_UNUSED) { return 0; } @@ -5391,9 +5094,7 @@ md_atof (int type, char *literalP, int *sizeP) } arelent * -tc_gen_reloc (section, fixP) - asection *section; - fixS *fixP; +tc_gen_reloc (asection *section, fixS *fixP) { arelent *rel; bfd_reloc_code_real_type code = fixP->fx_r_type; @@ -5424,11 +5125,7 @@ tc_gen_reloc (section, fixP) /* Handle cons expressions. */ void -tic54x_cons_fix_new (frag, where, octets, exp) - fragS *frag; - int where; - int octets; - expressionS *exp; +tic54x_cons_fix_new (fragS *frag, int where, int octets, expressionS *exp) { bfd_reloc_code_real_type r; @@ -5460,10 +5157,7 @@ tic54x_cons_fix_new (frag, where, octets, exp) If fixp->fx_addsy is non-NULL, we'll have to generate a reloc entry. */ void -md_apply_fix (fixP, valP, seg) - fixS *fixP; - valueT * valP; - segT seg ATTRIBUTE_UNUSED; +md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; valueT val = * valP; @@ -5514,16 +5208,13 @@ md_apply_fix (fixP, valP, seg) don't need to do anything here, since BFD does the proper encoding. */ valueT -md_section_align (segment, section_size) - segT segment ATTRIBUTE_UNUSED; - valueT section_size; +md_section_align (segT segment ATTRIBUTE_UNUSED, valueT section_size) { return section_size; } long -md_pcrel_from (fixP) - fixS *fixP ATTRIBUTE_UNUSED; +md_pcrel_from (fixS *fixP ATTRIBUTE_UNUSED) { return 0; } @@ -5532,10 +5223,7 @@ md_pcrel_from (fixP) first. */ void -tic54x_number_to_chars (buf, val, n) - char *buf; - valueT val; - int n; +tic54x_number_to_chars (char *buf, valueT val, int n) { if (n != 4) number_to_chars_littleendian (buf, val, n); @@ -5547,9 +5235,8 @@ tic54x_number_to_chars (buf, val, n) } int -tic54x_estimate_size_before_relax (frag, seg) - fragS *frag ATTRIBUTE_UNUSED; - segT seg ATTRIBUTE_UNUSED; +tic54x_estimate_size_before_relax (fragS *frag ATTRIBUTE_UNUSED, + segT seg ATTRIBUTE_UNUSED) { return 0; } @@ -5558,9 +5245,7 @@ tic54x_estimate_size_before_relax (frag, seg) to symbols being in different frags. return number of octets added. */ int -tic54x_relax_frag (frag, stretch) - fragS *frag; - long stretch ATTRIBUTE_UNUSED; +tic54x_relax_frag (fragS *frag, long stretch ATTRIBUTE_UNUSED) { symbolS *sym = frag->fr_symbol; int growth = 0; @@ -5659,10 +5344,9 @@ tic54x_relax_frag (frag, stretch) } void -tic54x_convert_frag (abfd, seg, frag) - bfd *abfd ATTRIBUTE_UNUSED; - segT seg ATTRIBUTE_UNUSED; - fragS *frag; +tic54x_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, + segT seg ATTRIBUTE_UNUSED, + fragS *frag) { /* Offset is in bytes. */ frag->fr_offset = (frag->fr_next->fr_address @@ -5688,9 +5372,7 @@ tic54x_convert_frag (abfd, seg, frag) Don't allow labels to start with '.' */ int -tic54x_start_label (c, rest) - int c; - char *rest; +tic54x_start_label (int c, char *rest) { /* If within .struct/.union, no auto line labels, please. */ if (current_stag != NULL) |