X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-spu.c;h=24969c97abd55515a8c812ca95ca7747498a152c;hb=0c608d6b62f9164203685ab125b4b3ad113eb26e;hp=0d94f325fe7bee281ffbf6da417cb3dd912d400d;hpb=8fdcc58daafe1153d2edf18a2f106d2b247e1f01;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c index 0d94f325fe..24969c97ab 100644 --- a/gas/config/tc-spu.c +++ b/gas/config/tc-spu.c @@ -1,6 +1,6 @@ /* spu.c -- Assembler for the IBM Synergistic Processing Unit (SPU) - Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2006-2016 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,11 +22,11 @@ #include "as.h" #include "safe-ctype.h" #include "subsegs.h" -#include "dwarf2dbg.h" +#include "dwarf2dbg.h" const struct spu_opcode spu_opcodes[] = { #define APUOP(TAG,MACFORMAT,OPCODE,MNEMONIC,ASMFORMAT,DEP,PIPE) \ - { MACFORMAT, (OPCODE) << (32-11), MNEMONIC, ASMFORMAT }, + { MACFORMAT, (OPCODE ## u) << (32-11), MNEMONIC, ASMFORMAT }, #define APUOPFB(TAG,MACFORMAT,OPCODE,FB,MNEMONIC,ASMFORMAT,DEP,PIPE) \ { MACFORMAT, ((OPCODE) << (32-11)) | ((FB) << (32-18)), MNEMONIC, ASMFORMAT }, #include "opcode/spu-insns.h" @@ -101,8 +101,6 @@ const pseudo_typeS md_pseudo_table[] = /* Likewise for eqv. */ {"eqv", NULL, 0}, {".eqv", s_set, -1}, - {"file", (void (*) (int)) dwarf2_directive_file, 0 }, - {"loc", dwarf2_directive_loc, 0}, {0,0,0} }; @@ -158,7 +156,7 @@ static int emulate_apuasm; static int use_dd2 = 1; int -md_parse_option (int c, char *arg ATTRIBUTE_UNUSED) +md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED) { switch (c) { @@ -247,17 +245,17 @@ insn_fmt_string (struct spu_opcode *format) for (i = 1; i <= format->arg[0]; i++) { int arg = format->arg[i]; - char *exp; - if (i > 1 && arg != A_P && format->arg[i-1] != A_P) + const char *exp; + if (i > 1 && arg != A_P && format->arg[i-1] != A_P) buf[len++] = ','; if (arg == A_P) exp = "("; else if (arg < A_P) exp = i == syntax_error_arg ? "REG" : "reg"; - else + else exp = i == syntax_error_arg ? "IMM" : "imm"; len += sprintf (&buf[len], "%s", exp); - if (i > 1 && format->arg[i-1] == A_P) + if (i > 1 && format->arg[i-1] == A_P) buf[len++] = ')'; } buf[len] = 0; @@ -365,7 +363,7 @@ md_assemble (char *op) /* if this instruction requires labels mark it for later */ for (i = 0; i < MAX_RELOCS; i++) - if (insn.reloc_arg[i] >= 0) + if (insn.reloc_arg[i] >= 0) { fixS *fixP; bfd_reloc_code_real_type reloc = insn.reloc[i]; @@ -506,7 +504,7 @@ get_reg (const char *param, struct spu_insn *insn, int arg, int accept_expr) saw_prefix = 1; param++; } - + if (arg == A_H) /* Channel */ { if ((param[0] == 'c' || param[0] == 'C') @@ -622,7 +620,7 @@ get_imm (const char *param, struct spu_insn *insn, int arg) i.e. for code loaded at address 0 $toc will be 0. */ param += 4; } - + if (*param == '$') { /* Symbols can start with $, but if this symbol matches a register @@ -634,7 +632,7 @@ get_imm (const char *param, struct spu_insn *insn, int arg) if (np) syntax_error_param = np; } - + save_ptr = input_line_pointer; input_line_pointer = (char *) param; expression (&insn->exp[reloc_i]); @@ -663,12 +661,12 @@ get_imm (const char *param, struct spu_insn *insn, int arg) if (emulate_apuasm) { - /* Convert the value to a format we expect. */ + /* Convert the value to a format we expect. */ val <<= arg_encode[arg].rshift; if (arg == A_U7A) val = 173 - val; else if (arg == A_U7B) - val = 155 - val; + val = 155 - val; } if (high) @@ -694,7 +692,7 @@ get_imm (const char *param, struct spu_insn *insn, int arg) if (arg == A_U7A) val = 173 - val; else if (arg == A_U7B) - val = 155 - val; + val = 155 - val; /* Branch hints have a split encoding. Do the bottom part. */ if (arg == A_S11 || arg == A_S11I) @@ -718,7 +716,7 @@ get_imm (const char *param, struct spu_insn *insn, int arg) return param; } -char * +const char * md_atof (int type, char *litP, int *sizeP) { return ieee_md_atof (type, litP, sizeP, TRUE); @@ -865,8 +863,8 @@ arelent * tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) { arelent *reloc; - reloc = (arelent *) xmalloc (sizeof (arelent)); - reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + reloc = XNEW (arelent); + reloc->sym_ptr_ptr = XNEW (asymbol *); if (fixp->fx_addsy) *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); else if (fixp->fx_subsy)