From 19d63e5d2d20b6f1264092d27d9780181c333fa7 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 16 Nov 2000 00:59:49 +0000 Subject: [PATCH] 2000-11-15 Kazu Hirata * config/tc-tic30.c: Fix formatting. * config/tc-tic80.c: Likewise. * config/tc-v850.c: Likewise. * config/tc-vax.c: Likewise. * config/tc-w65.c: Likewise. * config/tc-z8k.c: Likewise. --- gas/ChangeLog | 9 ++++ gas/config/tc-tic30.c | 107 +++++++++++++++++++----------------------- gas/config/tc-tic80.c | 3 +- gas/config/tc-v850.c | 35 +++++--------- gas/config/tc-w65.c | 9 ++-- gas/config/tc-z8k.c | 26 ++++------ 6 files changed, 84 insertions(+), 105 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 7555a346e3c..22451505855 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2000-11-15 Kazu Hirata + + * config/tc-tic30.c: Fix formatting. + * config/tc-tic80.c: Likewise. + * config/tc-v850.c: Likewise. + * config/tc-vax.c: Likewise. + * config/tc-w65.c: Likewise. + * config/tc-z8k.c: Likewise. + 2000-11-14 DJ Delorie * config/tc-v850.c: Support dwarf2. diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c index 5254080f0fa..e11cb33467d 100644 --- a/gas/config/tc-tic30.c +++ b/gas/config/tc-tic30.c @@ -19,20 +19,20 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* - Texas Instruments TMS320C30 machine specific gas. +/* Texas Instruments TMS320C30 machine specific gas. Written by Steven Haworth (steve@pm.cse.rmit.edu.au). Bugs & suggestions are completely welcome. This is free software. - Please help us make it better. - */ + Please help us make it better. */ #include "as.h" #include "opcode/tic30.h" -/* put here all non-digit non-letter charcters that may occur in an operand */ +/* Put here all non-digit non-letter charcters that may occur in an + operand. */ static char operand_special_chars[] = "%$-+(,)*._~/<>&^!:[@]"; -static char *ordinal_names[] = -{"first", "second", "third", "fourth", "fifth"}; +static char *ordinal_names[] = { + "first", "second", "third", "fourth", "fifth" +}; const int md_reloc_size = 0; @@ -41,19 +41,19 @@ const char line_comment_chars[] = "*"; const char line_separator_chars[] = ""; const char *md_shortopts = ""; -struct option md_longopts[] = -{ +struct option md_longopts[] = { {NULL, no_argument, NULL, 0} }; size_t md_longopts_size = sizeof (md_longopts); -/* Chars that mean this number is a floating point constant */ +/* Chars that mean this number is a floating point constant. */ /* As in 0f12.456 */ /* or 0d1.2345e12 */ const char FLT_CHARS[] = "fFdDxX"; -/* Chars that can be used to separate mant from exp in floating point nums */ +/* Chars that can be used to separate mant from exp in floating point + nums. */ const char EXP_CHARS[] = "eE"; /* tables for lexical analysis */ @@ -72,8 +72,7 @@ static char digit_chars[256]; #define is_identifier_char(x) (identifier_chars[(unsigned char) x]) #define is_digit_char(x) (digit_chars[(unsigned char) x]) -const pseudo_typeS md_pseudo_table[] = -{ +const pseudo_typeS md_pseudo_table[] = { {0, 0, 0} }; @@ -85,7 +84,7 @@ const pseudo_typeS md_pseudo_table[] = #include int -debug (const char *string,...) +debug (const char *string, ...) { if (flag_debug) { @@ -230,42 +229,32 @@ md_begin () #define PC_Register 0x00000000 #define PC_Relative 0x02000000 -typedef struct -{ +typedef struct { unsigned op_type; - struct - { - int resolved; - unsigned address; - char *label; - expressionS direct_expr; - } - direct; - struct - { - unsigned mod; - int ARnum; - unsigned char disp; - } - indirect; - struct - { - unsigned opcode; - } - reg; - struct - { - int resolved; - int decimal_found; - float f_number; - int s_number; - unsigned int u_number; - char *label; - expressionS imm_expr; - } - immediate; -} -operand; + struct { + int resolved; + unsigned address; + char *label; + expressionS direct_expr; + } direct; + struct { + unsigned mod; + int ARnum; + unsigned char disp; + } indirect; + struct { + unsigned opcode; + } reg; + struct { + int resolved; + int decimal_found; + float f_number; + int s_number; + unsigned int u_number; + char *label; + expressionS imm_expr; + } immediate; +} operand; int tic30_parallel_insn PARAMS ((char *)); operand *tic30_operand PARAMS ((char *)); @@ -273,15 +262,14 @@ char *tic30_find_parallel_insn PARAMS ((char *, char *)); template *opcode; -struct tic30_insn - { - template *tm; /* Template of current instruction */ - unsigned opcode; /* Final opcode */ - int operands; /* Number of given operands */ - /* Type of operand given in instruction */ - operand *operand_type[MAX_OPERANDS]; - unsigned addressing_mode; /* Final addressing mode of instruction */ - }; +struct tic30_insn { + template *tm; /* Template of current instruction */ + unsigned opcode; /* Final opcode */ + int operands; /* Number of given operands */ + /* Type of operand given in instruction */ + operand *operand_type[MAX_OPERANDS]; + unsigned addressing_mode; /* Final addressing mode of instruction */ +}; struct tic30_insn insn; static int found_parallel_insn; @@ -813,8 +801,7 @@ md_assemble (line) debug ("\n"); } -struct tic30_par_insn -{ +struct tic30_par_insn { partemplate *tm; /* Template of current parallel instruction */ int operands[2]; /* Number of given operands for each insn */ /* Type of operand given in instruction */ diff --git a/gas/config/tc-tic80.c b/gas/config/tc-tic80.c index fa1ae047ac5..00752600b55 100644 --- a/gas/config/tc-tic80.c +++ b/gas/config/tc-tic80.c @@ -58,8 +58,7 @@ const char FLT_CHARS[] = "fF"; extern void obj_coff_section (); -const pseudo_typeS md_pseudo_table[] = -{ +const pseudo_typeS md_pseudo_table[] = { { "align", s_align_bytes, 4 }, /* Do byte alignment, default is a 4 byte boundary */ { "word", cons, 4 }, /* FIXME: Should this be machine independent? */ { "bss", s_lcomm_bytes, 1 }, diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index 74b0c0e7064..584579ab15a 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -46,8 +46,7 @@ static int machine = -1; static int processor_mask = -1; /* Structure to hold information about predefined registers. */ -struct reg_name -{ +struct reg_name { const char *name; int value; }; @@ -73,8 +72,7 @@ const char EXP_CHARS[] = "eE"; as in 0d1.0. */ const char FLT_CHARS[] = "dD"; -const relax_typeS md_relax_table[] = -{ +const relax_typeS md_relax_table[] = { /* Conditional branches. */ {0xff, -0x100, 2, 1}, {0x1fffff, -0x200000, 6, 0}, @@ -99,8 +97,7 @@ static segT call_table_text_section = NULL; /* Fixups. */ #define MAX_INSN_FIXUPS (5) -struct v850_fixup -{ +struct v850_fixup { expressionS exp; int opindex; bfd_reloc_code_real_type reloc; @@ -587,8 +584,7 @@ set_machine (int number) } /* The target specific pseudo-ops which we support. */ -const pseudo_typeS md_pseudo_table[] = -{ +const pseudo_typeS md_pseudo_table[] = { {"sdata", v850_sdata, 0}, {"tdata", v850_tdata, 0}, {"zdata", v850_zdata, 0}, @@ -617,8 +613,7 @@ const pseudo_typeS md_pseudo_table[] = static struct hash_control *v850_hash; /* This table is sorted. Suitable for searching by a binary search. */ -static const struct reg_name pre_defined_registers[] = -{ +static const struct reg_name pre_defined_registers[] = { { "ep", 30 }, /* ep - element ptr */ { "gp", 4 }, /* gp - global ptr */ { "hp", 2 }, /* hp - handler stack ptr */ @@ -663,8 +658,7 @@ static const struct reg_name pre_defined_registers[] = #define REG_NAME_CNT \ (sizeof (pre_defined_registers) / sizeof (struct reg_name)) -static const struct reg_name system_registers[] = -{ +static const struct reg_name system_registers[] = { { "ctbp", 20 }, { "ctpc", 16 }, { "ctpsw", 17 }, @@ -681,8 +675,7 @@ static const struct reg_name system_registers[] = #define SYSREG_NAME_CNT \ (sizeof (system_registers) / sizeof (struct reg_name)) -static const struct reg_name system_list_registers[] = -{ +static const struct reg_name system_list_registers[] = { {"PS", 5 }, {"SR", 0 + 1} }; @@ -690,8 +683,7 @@ static const struct reg_name system_list_registers[] = #define SYSREGLIST_NAME_CNT \ (sizeof (system_list_registers) / sizeof (struct reg_name)) -static const struct reg_name cc_names[] = -{ +static const struct reg_name cc_names[] = { { "c", 0x1 }, { "e", 0x2 }, { "ge", 0xe }, @@ -1193,8 +1185,7 @@ parse_register_list (insn, operand) CONST char *md_shortopts = "m:"; -struct option md_longopts[] = -{ +struct option md_longopts[] = { {NULL, no_argument, NULL, 0} }; @@ -1319,9 +1310,9 @@ md_atof (type, litp, sizep) void md_convert_frag (abfd, sec, fragP) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; - fragS *fragP; + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; + fragS *fragP; { subseg_change (sec, 0); @@ -1416,7 +1407,7 @@ md_begin () as_bad (_("Unable to determine default target processor from string: %s"), TARGET_CPU); - v850_hash = hash_new(); + v850_hash = hash_new (); /* Insert unique names into hash table. The V850 instruction set has many identical opcode names that have different opcodes based diff --git a/gas/config/tc-w65.c b/gas/config/tc-w65.c index 62d278bb5b5..bd66f41af0c 100644 --- a/gas/config/tc-w65.c +++ b/gas/config/tc-w65.c @@ -51,8 +51,8 @@ const char line_comment_chars[] = "!#"; #define OP_BVS 0x70 void s_longa (); -const pseudo_typeS md_pseudo_table[] = -{ + +const pseudo_typeS md_pseudo_table[] = { {"int", cons, 2}, {"word", cons, 2}, {"longa", s_longa, 0}, @@ -71,12 +71,13 @@ static int relax; /* set if -relax seen */ const char EXP_CHARS[] = "eE"; -/* Chars that mean this number is a floating point constant */ +/* Chars that mean this number is a floating point constant. */ /* As in 0f12.456 */ /* or 0d1.2345e12 */ const char FLT_CHARS[] = "rRsSfFdDxXpP"; -static struct hash_control *opcode_hash_control; /* Opcode mnemonics */ +/* Opcode mnemonics */ +static struct hash_control *opcode_hash_control; int M; /* M flag */ int X; /* X flag */ diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c index fcccfda7388..58c85eada0c 100644 --- a/gas/config/tc-z8k.c +++ b/gas/config/tc-z8k.c @@ -187,15 +187,13 @@ md_begin () linkrelax = 1; } -struct z8k_exp -{ +struct z8k_exp { char *e_beg; char *e_end; expressionS e_exp; }; -typedef struct z8k_op -{ +typedef struct z8k_op { /* 'b','w','r','q'. */ char regsize; @@ -209,9 +207,7 @@ typedef struct z8k_op /* Any expression. */ expressionS exp; -} - -op_type; +} op_type; static expressionS *da_operand; static expressionS *imm_operand; @@ -402,8 +398,7 @@ regaddr (mode, string) } } -struct ctrl_names -{ +struct ctrl_names { int value; char *name; }; @@ -453,8 +448,7 @@ get_ctrl_operand (ptr, mode, dst) return; } -struct flag_names -{ +struct flag_names { int value; char *name; @@ -507,15 +501,13 @@ get_flags_operand (ptr, mode, dst) return; } -struct interrupt_names -{ +struct interrupt_names { int value; char *name; }; -struct interrupt_names intr_table[] = -{ +struct interrupt_names intr_table[] = { 0x1, "nvi", 0x2, "vi", 0x3, "both", @@ -556,8 +548,7 @@ get_interrupt_operand (ptr, mode, dst) return; } -struct cc_names -{ +struct cc_names { int value; char *name; @@ -1002,6 +993,7 @@ apply_fix (ptr, type, operand, size) /* Now we know what sort of opcodes it is. Let's build the bytes. */ #define INSERT(x,y) *x++ = y>>24; *x++ = y>> 16; *x++=y>>8; *x++ =y; + static void build_bytes (this_try, operand) opcode_entry_type *this_try; -- 2.30.2