2000-11-15 Kazu Hirata <kazu@hxi.com>

* 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.
This commit is contained in:
Kazu Hirata
2000-11-16 00:59:49 +00:00
parent cbfe05c4c6
commit 19d63e5d2d
6 changed files with 84 additions and 105 deletions

View File

@ -1,3 +1,12 @@
2000-11-15 Kazu Hirata <kazu@hxi.com>
* 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 <dj@redhat.com> 2000-11-14 DJ Delorie <dj@redhat.com>
* config/tc-v850.c: Support dwarf2. * config/tc-v850.c: Support dwarf2.

View File

@ -19,20 +19,20 @@
Software Foundation, 59 Temple Place - Suite 330, Boston, MA Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */ 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). Written by Steven Haworth (steve@pm.cse.rmit.edu.au).
Bugs & suggestions are completely welcome. This is free software. 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 "as.h"
#include "opcode/tic30.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 operand_special_chars[] = "%$-+(,)*._~/<>&^!:[@]";
static char *ordinal_names[] = static char *ordinal_names[] = {
{"first", "second", "third", "fourth", "fifth"}; "first", "second", "third", "fourth", "fifth"
};
const int md_reloc_size = 0; const int md_reloc_size = 0;
@ -41,19 +41,19 @@ const char line_comment_chars[] = "*";
const char line_separator_chars[] = ""; const char line_separator_chars[] = "";
const char *md_shortopts = ""; const char *md_shortopts = "";
struct option md_longopts[] = struct option md_longopts[] = {
{
{NULL, no_argument, NULL, 0} {NULL, no_argument, NULL, 0}
}; };
size_t md_longopts_size = sizeof (md_longopts); 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 */ /* As in 0f12.456 */
/* or 0d1.2345e12 */ /* or 0d1.2345e12 */
const char FLT_CHARS[] = "fFdDxX"; 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"; const char EXP_CHARS[] = "eE";
/* tables for lexical analysis */ /* 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_identifier_char(x) (identifier_chars[(unsigned char) x])
#define is_digit_char(x) (digit_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} {0, 0, 0}
}; };
@ -85,7 +84,7 @@ const pseudo_typeS md_pseudo_table[] =
#include <stdarg.h> #include <stdarg.h>
int int
debug (const char *string,...) debug (const char *string, ...)
{ {
if (flag_debug) if (flag_debug)
{ {
@ -230,42 +229,32 @@ md_begin ()
#define PC_Register 0x00000000 #define PC_Register 0x00000000
#define PC_Relative 0x02000000 #define PC_Relative 0x02000000
typedef struct typedef struct {
{
unsigned op_type; unsigned op_type;
struct struct {
{ int resolved;
int resolved; unsigned address;
unsigned address; char *label;
char *label; expressionS direct_expr;
expressionS direct_expr; } direct;
} struct {
direct; unsigned mod;
struct int ARnum;
{ unsigned char disp;
unsigned mod; } indirect;
int ARnum; struct {
unsigned char disp; unsigned opcode;
} } reg;
indirect; struct {
struct int resolved;
{ int decimal_found;
unsigned opcode; float f_number;
} int s_number;
reg; unsigned int u_number;
struct char *label;
{ expressionS imm_expr;
int resolved; } immediate;
int decimal_found; } operand;
float f_number;
int s_number;
unsigned int u_number;
char *label;
expressionS imm_expr;
}
immediate;
}
operand;
int tic30_parallel_insn PARAMS ((char *)); int tic30_parallel_insn PARAMS ((char *));
operand *tic30_operand PARAMS ((char *)); operand *tic30_operand PARAMS ((char *));
@ -273,15 +262,14 @@ char *tic30_find_parallel_insn PARAMS ((char *, char *));
template *opcode; template *opcode;
struct tic30_insn struct tic30_insn {
{ template *tm; /* Template of current instruction */
template *tm; /* Template of current instruction */ unsigned opcode; /* Final opcode */
unsigned opcode; /* Final opcode */ int operands; /* Number of given operands */
int operands; /* Number of given operands */ /* Type of operand given in instruction */
/* Type of operand given in instruction */ operand *operand_type[MAX_OPERANDS];
operand *operand_type[MAX_OPERANDS]; unsigned addressing_mode; /* Final addressing mode of instruction */
unsigned addressing_mode; /* Final addressing mode of instruction */ };
};
struct tic30_insn insn; struct tic30_insn insn;
static int found_parallel_insn; static int found_parallel_insn;
@ -813,8 +801,7 @@ md_assemble (line)
debug ("\n"); debug ("\n");
} }
struct tic30_par_insn struct tic30_par_insn {
{
partemplate *tm; /* Template of current parallel instruction */ partemplate *tm; /* Template of current parallel instruction */
int operands[2]; /* Number of given operands for each insn */ int operands[2]; /* Number of given operands for each insn */
/* Type of operand given in instruction */ /* Type of operand given in instruction */

View File

@ -58,8 +58,7 @@ const char FLT_CHARS[] = "fF";
extern void obj_coff_section (); 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 */ { "align", s_align_bytes, 4 }, /* Do byte alignment, default is a 4 byte boundary */
{ "word", cons, 4 }, /* FIXME: Should this be machine independent? */ { "word", cons, 4 }, /* FIXME: Should this be machine independent? */
{ "bss", s_lcomm_bytes, 1 }, { "bss", s_lcomm_bytes, 1 },

View File

@ -46,8 +46,7 @@ static int machine = -1;
static int processor_mask = -1; static int processor_mask = -1;
/* Structure to hold information about predefined registers. */ /* Structure to hold information about predefined registers. */
struct reg_name struct reg_name {
{
const char *name; const char *name;
int value; int value;
}; };
@ -73,8 +72,7 @@ const char EXP_CHARS[] = "eE";
as in 0d1.0. */ as in 0d1.0. */
const char FLT_CHARS[] = "dD"; const char FLT_CHARS[] = "dD";
const relax_typeS md_relax_table[] = const relax_typeS md_relax_table[] = {
{
/* Conditional branches. */ /* Conditional branches. */
{0xff, -0x100, 2, 1}, {0xff, -0x100, 2, 1},
{0x1fffff, -0x200000, 6, 0}, {0x1fffff, -0x200000, 6, 0},
@ -99,8 +97,7 @@ static segT call_table_text_section = NULL;
/* Fixups. */ /* Fixups. */
#define MAX_INSN_FIXUPS (5) #define MAX_INSN_FIXUPS (5)
struct v850_fixup struct v850_fixup {
{
expressionS exp; expressionS exp;
int opindex; int opindex;
bfd_reloc_code_real_type reloc; bfd_reloc_code_real_type reloc;
@ -587,8 +584,7 @@ set_machine (int number)
} }
/* The target specific pseudo-ops which we support. */ /* The target specific pseudo-ops which we support. */
const pseudo_typeS md_pseudo_table[] = const pseudo_typeS md_pseudo_table[] = {
{
{"sdata", v850_sdata, 0}, {"sdata", v850_sdata, 0},
{"tdata", v850_tdata, 0}, {"tdata", v850_tdata, 0},
{"zdata", v850_zdata, 0}, {"zdata", v850_zdata, 0},
@ -617,8 +613,7 @@ const pseudo_typeS md_pseudo_table[] =
static struct hash_control *v850_hash; static struct hash_control *v850_hash;
/* This table is sorted. Suitable for searching by a binary search. */ /* 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 */ { "ep", 30 }, /* ep - element ptr */
{ "gp", 4 }, /* gp - global ptr */ { "gp", 4 }, /* gp - global ptr */
{ "hp", 2 }, /* hp - handler stack ptr */ { "hp", 2 }, /* hp - handler stack ptr */
@ -663,8 +658,7 @@ static const struct reg_name pre_defined_registers[] =
#define REG_NAME_CNT \ #define REG_NAME_CNT \
(sizeof (pre_defined_registers) / sizeof (struct reg_name)) (sizeof (pre_defined_registers) / sizeof (struct reg_name))
static const struct reg_name system_registers[] = static const struct reg_name system_registers[] = {
{
{ "ctbp", 20 }, { "ctbp", 20 },
{ "ctpc", 16 }, { "ctpc", 16 },
{ "ctpsw", 17 }, { "ctpsw", 17 },
@ -681,8 +675,7 @@ static const struct reg_name system_registers[] =
#define SYSREG_NAME_CNT \ #define SYSREG_NAME_CNT \
(sizeof (system_registers) / sizeof (struct reg_name)) (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 }, {"PS", 5 },
{"SR", 0 + 1} {"SR", 0 + 1}
}; };
@ -690,8 +683,7 @@ static const struct reg_name system_list_registers[] =
#define SYSREGLIST_NAME_CNT \ #define SYSREGLIST_NAME_CNT \
(sizeof (system_list_registers) / sizeof (struct reg_name)) (sizeof (system_list_registers) / sizeof (struct reg_name))
static const struct reg_name cc_names[] = static const struct reg_name cc_names[] = {
{
{ "c", 0x1 }, { "c", 0x1 },
{ "e", 0x2 }, { "e", 0x2 },
{ "ge", 0xe }, { "ge", 0xe },
@ -1193,8 +1185,7 @@ parse_register_list (insn, operand)
CONST char *md_shortopts = "m:"; CONST char *md_shortopts = "m:";
struct option md_longopts[] = struct option md_longopts[] = {
{
{NULL, no_argument, NULL, 0} {NULL, no_argument, NULL, 0}
}; };
@ -1319,9 +1310,9 @@ md_atof (type, litp, sizep)
void void
md_convert_frag (abfd, sec, fragP) md_convert_frag (abfd, sec, fragP)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
asection *sec; asection *sec;
fragS *fragP; fragS *fragP;
{ {
subseg_change (sec, 0); subseg_change (sec, 0);
@ -1416,7 +1407,7 @@ md_begin ()
as_bad (_("Unable to determine default target processor from string: %s"), as_bad (_("Unable to determine default target processor from string: %s"),
TARGET_CPU); TARGET_CPU);
v850_hash = hash_new(); v850_hash = hash_new ();
/* Insert unique names into hash table. The V850 instruction set /* Insert unique names into hash table. The V850 instruction set
has many identical opcode names that have different opcodes based has many identical opcode names that have different opcodes based

View File

@ -51,8 +51,8 @@ const char line_comment_chars[] = "!#";
#define OP_BVS 0x70 #define OP_BVS 0x70
void s_longa (); void s_longa ();
const pseudo_typeS md_pseudo_table[] =
{ const pseudo_typeS md_pseudo_table[] = {
{"int", cons, 2}, {"int", cons, 2},
{"word", cons, 2}, {"word", cons, 2},
{"longa", s_longa, 0}, {"longa", s_longa, 0},
@ -71,12 +71,13 @@ static int relax; /* set if -relax seen */
const char EXP_CHARS[] = "eE"; 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 */ /* As in 0f12.456 */
/* or 0d1.2345e12 */ /* or 0d1.2345e12 */
const char FLT_CHARS[] = "rRsSfFdDxXpP"; 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 M; /* M flag */
int X; /* X flag */ int X; /* X flag */

View File

@ -187,15 +187,13 @@ md_begin ()
linkrelax = 1; linkrelax = 1;
} }
struct z8k_exp struct z8k_exp {
{
char *e_beg; char *e_beg;
char *e_end; char *e_end;
expressionS e_exp; expressionS e_exp;
}; };
typedef struct z8k_op typedef struct z8k_op {
{
/* 'b','w','r','q'. */ /* 'b','w','r','q'. */
char regsize; char regsize;
@ -209,9 +207,7 @@ typedef struct z8k_op
/* Any expression. */ /* Any expression. */
expressionS exp; expressionS exp;
} } op_type;
op_type;
static expressionS *da_operand; static expressionS *da_operand;
static expressionS *imm_operand; static expressionS *imm_operand;
@ -402,8 +398,7 @@ regaddr (mode, string)
} }
} }
struct ctrl_names struct ctrl_names {
{
int value; int value;
char *name; char *name;
}; };
@ -453,8 +448,7 @@ get_ctrl_operand (ptr, mode, dst)
return; return;
} }
struct flag_names struct flag_names {
{
int value; int value;
char *name; char *name;
@ -507,15 +501,13 @@ get_flags_operand (ptr, mode, dst)
return; return;
} }
struct interrupt_names struct interrupt_names {
{
int value; int value;
char *name; char *name;
}; };
struct interrupt_names intr_table[] = struct interrupt_names intr_table[] = {
{
0x1, "nvi", 0x1, "nvi",
0x2, "vi", 0x2, "vi",
0x3, "both", 0x3, "both",
@ -556,8 +548,7 @@ get_interrupt_operand (ptr, mode, dst)
return; return;
} }
struct cc_names struct cc_names {
{
int value; int value;
char *name; 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. */ /* 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; #define INSERT(x,y) *x++ = y>>24; *x++ = y>> 16; *x++=y>>8; *x++ =y;
static void static void
build_bytes (this_try, operand) build_bytes (this_try, operand)
opcode_entry_type *this_try; opcode_entry_type *this_try;