[patch 3/4] nios2 assembler cleanup

Sandra Loosemore sandra@codesourcery.com
Thu Oct 23 03:25:00 GMT 2014


This patch reworks the Nios II assembler with the end goal of making it 
easier to support new instruction formats and encodings and improve 
abstraction.  The major changes here are:

- Use of new instruction word accessor macros introduced in part 1 of 
this series.

- The existing code dispatched to functions to assemble instructions 
matching a particular argument pattern -- e.g. "d,s,t" for an 
instruction with 3 register arguments.  With many new instruction 
formats in the works, this approach didn't scale up well.  Now there are 
separate functions for assembling e.g. "d", "s", and "t" arguments 
individually into the instruction word, which use a switch on the 
instruction format to DTRT.

- Checking and encoding of register arguments has been consolidated into 
the new argument assembly functions instead of being being split with 
part happening in the tokenizer.

- Likewise handling for optional arguments has been taken out of the 
tokenizer and now uses information from the instruction descriptor 
instead of hard-coded lookup.

- Hard-coded constants have been removed in several other places as well.

-Sandra

-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-refactor-gas.log
Type: text/x-log
Size: 2271 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20141023/db460219/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-refactor-gas.patch
Type: text/x-patch
Size: 52659 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20141023/db460219/attachment-0001.bin>


More information about the Binutils mailing list