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]

Re: [PATCH 13/20] MIPS/GAS: Improve instruction's mnemonic processing


Patches 11 and 12 OK.

>> You could use alloca to create an opcode without the "16" or "32",
>> which would make the error-reporting code simpler.  It's best not
>> to change the user's source line if we can help it.
>
> I have made a complementing adjustment to original code currently present 
> in mips_ip(), making the whole piece much simpler and less fragile.
>
> 2010-12-02  Maciej W. Rozycki  <macro@codesourcery.com>
>
> 	gas/
> 	* config/tc-mips.c (mips_ip): Make a copy of the instruction's
> 	mnemonic and use it for further processing.

This patch doesn't preserve the current behaviour.

The current code treats the text after the "." as the first thing that
should be matched against the format string.  I assume it dates back to
a time when certain types of operand suffix were handled using format
characters.  (Maybe the floating-point condition codes and formats?)
This meant that things like:

	addu.$4,$5,$6

were also acceptable, although of course:

	c.eq.d.$f0,$f2

wasn't.

The patch instead ignores everything after the ".", which means that
we'd accept stuff like:

	addu.foobar $4,$5,$7

(although again not "c.eq.d.foobar").

I think we can simply remove the dot check.  I don't see any testsuite
regressions after doing that.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]