This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hello! Currently, apart from the core registers (rN), one has to use the raw DWARF register numbers (d0: 256, etc., as per AADWARF) in CFI statements. The intention of this patch is that one is able to consistently use the regular register names for assembler instructions, ARM-specific unwind table instructions, as well as CFI instructions. Aside: GCC currently also uses raw DWARF register numbers, and could be changed to use register names instead, if this patch is accepted. gas/ 2010-03-26 Thomas Schwinge <thomas@codesourcery.com> * config/tc-arm.c (tc_arm_regname_to_dw2regnum): Re-implement in order to also handle non-core registers. diff --git a/binutils-trunk/gas/config/tc-arm.c b/binutils-trunk/gas/config/tc-arm.c index ab50b50..1c30e87 100644 --- a/binutils-trunk/gas/config/tc-arm.c +++ b/binutils-trunk/gas/config/tc-arm.c @@ -19164,12 +19164,51 @@ tc_arm_frame_initial_instructions (void) int tc_arm_regname_to_dw2regnum (char *regname) { - int reg = arm_reg_parse (®name, REG_TYPE_RN); + struct reg_entry *reg = arm_reg_parse_multi (®name); - if (reg == FAIL) + if (!reg) return -1; - return reg; + /* Do not allow a scalar (reg+index) to parse as a register. */ + if (reg->neon && (reg->neon->defined & NTA_HASINDEX)) + return -1; + + /* Handle all registers in REG_NAMES. */ + /* Does not yet handle alternative syntaxes (cf. arm_reg_alt_syntax). */ + /* Offsets are from AADWARF (ARM IHI 0040A, 2006-05-05 / 2009-10-28). */ + switch (reg->type) + { + case REG_TYPE_RN: + return reg->number; + case REG_TYPE_CP: + case REG_TYPE_CN: + return -1; + case REG_TYPE_FN: + return 96 + reg->number; + case REG_TYPE_VFS: + return 64 + reg->number; + case REG_TYPE_VFD: + return 256 + reg->number; + case REG_TYPE_NQ: + case REG_TYPE_VFC: + case REG_TYPE_MVF: + case REG_TYPE_MVD: + case REG_TYPE_MVFX: + case REG_TYPE_MVDX: + case REG_TYPE_MVAX: + case REG_TYPE_DSPSC: + return -1; + case REG_TYPE_MMXWR: + return 112 + reg->number; + case REG_TYPE_MMXWC: + case REG_TYPE_MMXWCG: + case REG_TYPE_XSCALE: + return -1; + default: + /* Missing handler; update from REG_NAMES. */ + as_bad (_("unkown register type for register '%s'"), reg->name); + return -1; + } } #ifdef TE_PE OK to commit? Regards, Thomas
Attachment:
pgp00000.pgp
Description: PGP signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |