Open rez5427 opened 3 weeks ago
Mappings can only call other mappings because they have to be reversible and functions don't necessarily have an inverse. Most of the other assembly mappings use, for example, hex_bits_signed_5
for immediate integers. Could you try that? I'm not sure if there are decimal equivalents.
In this case I think you could have a mapping:
mapping zcmp_spimm_assembly_4_7_32 : bits(2) <-> string = {
0b00 <-> "-16",
0b01 <-> "-32",
0b10 <-> "-48",
0b11 <-> "-64",
}
and call this from the assembly mapping for rlist
values 5-7 (not sure about 4?). You could define others for the other spimm
mappings for 8-b, c-e and f? This would help a bit but it's still a bit verbose. You might be able to get more clever with some arithmetic.
I want to implement cm.push, but I've encountered a challenge: using mapping to assemble this instruction would take hundreds of lines. Any suggestions?