Implement legalize_signature for RISC-V.

Add an abi module with code that is probably useful to all ISAs when
implementing this function.

Add a unit() method to RegClassData which can be used to index the
register units in a class.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-02 16:01:56 -08:00
parent 07f459fb93
commit 42e7021865
7 changed files with 180 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ def gen_regclass(rc, fmt):
fmt.line('name: "{}",'.format(rc.name))
fmt.line('index: {},'.format(rc.index))
fmt.line('width: {},'.format(rc.width))
fmt.line('first: {},'.format(rc.bank.first_unit + rc.start))
fmt.line('subclasses: 0x{:x},'.format(rc.subclass_mask()))
mask = ', '.join('0x{:08x}'.format(x) for x in rc.mask())
fmt.line('mask: [{}],'.format(mask))