According to the docs here:
you should be able to specify an FPA register in ARM .save directives,
like the following:
sfmfd f4, 1, [sp]!
.save f4, 1
These directives are usually generated by g++. However, if you attempt
to assemble this, using "gas -mfpu=fpa", you'll get:
test.s: Assembler messages:
test.s:2: Error: expected , <constant>
This is because gas apparently doesn't skip the register name when
looking for the following comma.
The function s_arm_unwind_save(), in gas/config/tc-arm.c, peeks ahead
to parse the type of register that follows a .save directive, using
arm_reg_parse_mult(). When it finds a known register, it uses its
type to call the appropriate handler for that type.
Unfortunately, for FPA registers, it calls s_arm_unwind_save_fpa()
*without* advancing the input_line_pointer to just afer the register
name. Since the first thing s_arm_unwind_save_fpa() expects to find
is a comma, it will always fail, with: "expected , <constant>".
Since arm_reg_parse_multi() already advanced the peek pointer to just
after the register name, just setting input_line_pointer to peek is a
nice, one-line fix.
Created attachment 2225 [details]
Test case for .save of an FPA register
Created attachment 2226 [details]
Fix for properly parsing .save directives with an FPA register
Thanks for reporting this problem and providing the patch to fix it. I have
checked your patch in, along with the changelog entry below and I have also
added a testcase to the ARM specific section of the gas tests to make sure that
this problem does not resurface.
2008-02-14 Dimitry Andric <firstname.lastname@example.org>
* config/tc-arm.c (s_arm_unwind_save): Advance the input line
pointer past the comma after parsing a floating point register