#ifdef LEX_AT
identifier_chars['@'] = '@';
#endif
- register_chars[')'] = ')';
- register_chars['('] = '(';
digit_chars['-'] = '-';
identifier_chars['_'] = '_';
identifier_chars['.'] = '.';
r = (const reg_entry *) hash_find (reg_hash, reg_name_given);
+ /* Handle floating point regs, allowing spaces in the (i) part. */
+ if (r == i386_regtab /* %st is first entry of table */)
+ {
+ --s;
+ if (is_space_char (*s))
+ ++s;
+ if (*s == '(')
+ {
+ *p++ = *s++;
+ if (is_space_char (*s))
+ ++s;
+ if (*s >= '0' && *s <= '7')
+ {
+ r = &i386_float_regtab[*s - '0'];
+ *p++ = *s++;
+ if (is_space_char (*s))
+ ++s;
+ if (*s == ')')
+ {
+ *end_op = s + 1;
+ return r;
+ }
+ *p++ = *s;
+ }
+ if (!allow_naked_reg)
+ {
+ *p = '\0';
+ as_bad (_("bad register name `%s'"), reg_name_given);
+ }
+ return (const reg_entry *) NULL;
+ }
+ }
+
if (r == NULL)
{
if (!allow_naked_reg)
/* 386 register table */
static const reg_entry i386_regtab[] = {
+ /* make %st first as we test for it */
+ {"st", FloatReg|FloatAcc, 0},
/* 8 bit regs */
{"al", Reg8|Acc, 0},
{"cl", Reg8|ShiftCount, 1},
{"tr5", Test, 5},
{"tr6", Test, 6},
{"tr7", Test, 7},
- /* float registers */
- {"st(0)", FloatReg|FloatAcc, 0},
- {"st", FloatReg|FloatAcc, 0},
- {"st(1)", FloatReg, 1},
- {"st(2)", FloatReg, 2},
- {"st(3)", FloatReg, 3},
- {"st(4)", FloatReg, 4},
- {"st(5)", FloatReg, 5},
- {"st(6)", FloatReg, 6},
- {"st(7)", FloatReg, 7},
+ /* mmx and simd registers */
{"mm0", RegMMX, 0},
{"mm1", RegMMX, 1},
{"mm2", RegMMX, 2},
{"xmm7", RegXMM, 7}
};
+static const reg_entry i386_float_regtab[] = {
+ {"st(0)", FloatReg|FloatAcc, 0},
+ {"st(1)", FloatReg, 1},
+ {"st(2)", FloatReg, 2},
+ {"st(3)", FloatReg, 3},
+ {"st(4)", FloatReg, 4},
+ {"st(5)", FloatReg, 5},
+ {"st(6)", FloatReg, 6},
+ {"st(7)", FloatReg, 7}
+};
+
#define MAX_REG_NAME_SIZE 8 /* for parsing register names from input */
/* segment stuff */