Fix formatting

This commit is contained in:
Nick Clifton 2000-07-08 18:13:58 +00:00
parent 227aeb0758
commit c4aa876b91
2 changed files with 72 additions and 71 deletions

View File

@ -1,3 +1,7 @@
2000-07-08 Kazu Hirata <kazu@hxi.com>
* config/tc-sh.c: Fix formatting.
2000-07-07 Kazu Hirata <kazu@hxi.com> 2000-07-07 Kazu Hirata <kazu@hxi.com>
* config/tc-sh.c: Fix comments. * config/tc-sh.c: Fix comments.

View File

@ -602,7 +602,8 @@ parse_reg (src, mode, reg)
return 0; return 0;
} }
static symbolS *dot() static symbolS *
dot ()
{ {
const char *fake; const char *fake;
@ -613,12 +614,9 @@ static symbolS *dot()
now_seg, now_seg,
(valueT) frag_now_fix (), (valueT) frag_now_fix (),
frag_now); frag_now);
} }
static char *
static
char *
parse_exp (s, op) parse_exp (s, op)
char *s; char *s;
sh_operand_info *op; sh_operand_info *op;
@ -636,7 +634,6 @@ parse_exp (s, op)
return new; return new;
} }
/* The many forms of operand: /* The many forms of operand:
Rn Register direct Rn Register direct
@ -654,11 +651,9 @@ parse_exp (s, op)
disp:12 disp:12
#imm8 #imm8
pr, gbr, vbr, macl, mach pr, gbr, vbr, macl, mach
*/ */
static static char *
char *
parse_at (src, op) parse_at (src, op)
char *src; char *src;
sh_operand_info *op; sh_operand_info *op;
@ -728,11 +723,12 @@ parse_at (src, op)
} }
else if (mode == A_PC) else if (mode == A_PC)
{ {
/* Turn a plain @(4,pc) into @(.+4,pc) */ /* Turn a plain @(4,pc) into @(.+4,pc). */
if (op->immediate.X_op == O_constant) { if (op->immediate.X_op == O_constant)
op->immediate.X_add_symbol = dot(); {
op->immediate.X_op = O_symbol; op->immediate.X_add_symbol = dot();
} op->immediate.X_op = O_symbol;
}
op->type = A_DISP_PC; op->type = A_DISP_PC;
} }
else else
@ -822,8 +818,7 @@ get_operand (ptr, op)
} }
} }
static static char *
char *
get_operands (info, args, operand) get_operands (info, args, operand)
sh_opcode_info *info; sh_opcode_info *info;
char *args; char *args;
@ -884,8 +879,7 @@ get_operands (info, args, operand)
addressing modes, return the opcode which matches the opcodes addressing modes, return the opcode which matches the opcodes
provided. */ provided. */
static static sh_opcode_info *
sh_opcode_info *
get_specific (opcode, operands) get_specific (opcode, operands)
sh_opcode_info *opcode; sh_opcode_info *opcode;
sh_operand_info *operands; sh_operand_info *operands;
@ -893,6 +887,7 @@ get_specific (opcode, operands)
sh_opcode_info *this_try = opcode; sh_opcode_info *this_try = opcode;
char *name = opcode->name; char *name = opcode->name;
int n = 0; int n = 0;
while (opcode->name) while (opcode->name)
{ {
this_try = opcode++; this_try = opcode++;
@ -979,7 +974,7 @@ get_specific (opcode, operands)
goto fail; goto fail;
break; break;
case A_REG_B: case A_REG_B:
if (user->type != arg) if (user->type != arg)
goto fail; goto fail;
reg_b = user->reg; reg_b = user->reg;
@ -1160,7 +1155,8 @@ get_specific (opcode, operands)
goto fail; goto fail;
valid_arch &= this_try->arch; valid_arch &= this_try->arch;
return this_try; return this_try;
fail:; fail:
;
} }
return 0; return 0;
@ -1181,7 +1177,6 @@ check (operand, low, high)
return operand->X_add_number; return operand->X_add_number;
} }
static void static void
insert (where, how, pcrel, op) insert (where, how, pcrel, op)
char *where; char *where;
@ -1261,7 +1256,7 @@ insert_loop_bounds (output, operand)
Hence a 9 digit number should be enough to count all REPEATs. */ Hence a 9 digit number should be enough to count all REPEATs. */
name = alloca (11); name = alloca (11);
sprintf (name, "_R%x", count++ & 0x3fffffff); sprintf (name, "_R%x", count++ & 0x3fffffff);
end_sym = symbol_new (name, undefined_section, 0, &zero_address_frag); end_sym = symbol_new (name, undefined_section, 0, &zero_address_frag);
/* Make this a local symbol. */ /* Make this a local symbol. */
#ifdef OBJ_COFF #ifdef OBJ_COFF
SF_SET_LOCAL (end_sym); SF_SET_LOCAL (end_sym);
@ -1323,7 +1318,7 @@ build_Mytes (opcode, operand)
case REG_NM: case REG_NM:
nbuf[index] = reg_n | (reg_m >> 2); nbuf[index] = reg_n | (reg_m >> 2);
break; break;
case REG_B: case REG_B:
nbuf[index] = reg_b | 0x08; nbuf[index] = reg_b | 0x08;
break; break;
case IMM0_4BY4: case IMM0_4BY4:
@ -1378,14 +1373,16 @@ build_Mytes (opcode, operand)
} }
} }
} }
if (! target_big_endian) { if (!target_big_endian)
output[1] = (nbuf[0] << 4) | (nbuf[1]); {
output[0] = (nbuf[2] << 4) | (nbuf[3]); output[1] = (nbuf[0] << 4) | (nbuf[1]);
} output[0] = (nbuf[2] << 4) | (nbuf[3]);
else { }
output[0] = (nbuf[0] << 4) | (nbuf[1]); else
output[1] = (nbuf[2] << 4) | (nbuf[3]); {
} output[0] = (nbuf[0] << 4) | (nbuf[1]);
output[1] = (nbuf[2] << 4) | (nbuf[3]);
}
} }
/* Find an opcode at the start of *STR_P in the hash table, and set /* Find an opcode at the start of *STR_P in the hash table, and set
@ -1890,7 +1887,7 @@ struct option md_longopts[] =
{"dsp", no_argument, NULL, OPTION_DSP}, {"dsp", no_argument, NULL, OPTION_DSP},
{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);
int int
md_parse_option (c, arg) md_parse_option (c, arg)
@ -1927,7 +1924,7 @@ void
md_show_usage (stream) md_show_usage (stream)
FILE *stream; FILE *stream;
{ {
fprintf(stream, _("\ fprintf (stream, _("\
SH options:\n\ SH options:\n\
-little generate little endian code\n\ -little generate little endian code\n\
-relax alter jump instructions for long displacements\n\ -relax alter jump instructions for long displacements\n\
@ -1957,7 +1954,6 @@ struct sh_count_relocs
symbol. When using BFD_ASSEMBLER, this is called via symbol. When using BFD_ASSEMBLER, this is called via
bfd_map_over_sections. */ bfd_map_over_sections. */
/*ARGSUSED*/
static void static void
sh_count_relocs (abfd, sec, data) sh_count_relocs (abfd, sec, data)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
@ -1987,7 +1983,6 @@ sh_count_relocs (abfd, sec, data)
/* Handle the count relocs for a particular section. When using /* Handle the count relocs for a particular section. When using
BFD_ASSEMBLER, this is called via bfd_map_over_sections. */ BFD_ASSEMBLER, this is called via bfd_map_over_sections. */
/*ARGSUSED*/
static void static void
sh_frob_section (abfd, sec, ignore) sh_frob_section (abfd, sec, ignore)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
@ -2174,8 +2169,9 @@ md_convert_frag (headers, seg, fragP)
(unsigned long) fragP->fr_address, (unsigned long) fragP->fr_address,
S_GET_NAME (fragP->fr_symbol)); S_GET_NAME (fragP->fr_symbol));
#if 0 /* This code works, but generates poor code and the compiler #if 0
should never produce a sequence that requires it to be used. */ /* This code works, but generates poor code and the compiler
should never produce a sequence that requires it to be used. */
/* A jump wont fit in 12 bits, make code which looks like /* A jump wont fit in 12 bits, make code which looks like
bra foo bra foo
@ -2185,21 +2181,21 @@ md_convert_frag (headers, seg, fragP)
*/ */
int t = buffer[0] & 0x10; int t = buffer[0] & 0x10;
buffer[highbyte] = 0xa0; /* branch over move and disp */ buffer[highbyte ] = 0xa0; /* branch over move and disp */
buffer[lowbyte] = 3; buffer[lowbyte ] = 3;
buffer[highbyte+2] = 0xd0 | JREG; /* Build mov insn */ buffer[highbyte + 2] = 0xd0 | JREG; /* Build mov insn */
buffer[lowbyte+2] = 0x00; buffer[lowbyte + 2] = 0x00;
buffer[highbyte+4] = 0; /* space for 32 bit jump disp */ buffer[highbyte + 4] = 0; /* space for 32 bit jump disp */
buffer[lowbyte+4] = 0; buffer[lowbyte + 4] = 0;
buffer[highbyte+6] = 0; buffer[highbyte + 6] = 0;
buffer[lowbyte+6] = 0; buffer[lowbyte + 6] = 0;
buffer[highbyte+8] = 0x40 | JREG; /* Build jmp @JREG */ buffer[highbyte + 8] = 0x40 | JREG; /* Build jmp @JREG */
buffer[lowbyte+8] = t ? 0xb : 0x2b; buffer[lowbyte + 8] = t ? 0xb : 0x2b;
buffer[highbyte+10] = 0x20; /* build nop */ buffer[highbyte + 10] = 0x20; /* build nop */
buffer[lowbyte+10] = 0x0b; buffer[lowbyte + 10] = 0x0b;
/* Make reloc for the long disp. */ /* Make reloc for the long disp. */
fix_new (fragP, fix_new (fragP,
@ -2297,8 +2293,9 @@ md_convert_frag (headers, seg, fragP)
(unsigned long) fragP->fr_address, (unsigned long) fragP->fr_address,
S_GET_NAME (fragP->fr_symbol)); S_GET_NAME (fragP->fr_symbol));
#if 0 /* This code works, but generates poor code, and the compiler #if 0
should never produce a sequence that requires it to be used. */ /* This code works, but generates poor code, and the compiler
should never produce a sequence that requires it to be used. */
/* A bcond won't fit and it won't go into a 12 bit /* A bcond won't fit and it won't go into a 12 bit
displacement either, the code sequence looks like: displacement either, the code sequence looks like:
@ -2637,7 +2634,7 @@ md_apply_fix (fixP, val)
Note that adding further restrictions may invalidate Note that adding further restrictions may invalidate
reasonable looking assembly code, such as ``and -0x1,r0''. */ reasonable looking assembly code, such as ``and -0x1,r0''. */
max = 0xff; max = 0xff;
min = - 0xff; min = -0xff;
*buf++ = val; *buf++ = val;
break; break;
@ -2684,7 +2681,7 @@ md_apply_fix (fixP, val)
break; break;
case BFD_RELOC_32: case BFD_RELOC_32:
if (! target_big_endian) if (!target_big_endian)
{ {
*buf++ = val >> 0; *buf++ = val >> 0;
*buf++ = val >> 8; *buf++ = val >> 8;