riscv / sail-riscv

Sail RISC-V model
https://lists.riscv.org/g/tech-golden-model
Other
467 stars 169 forks source link

Remove unused (f)reg_name_abi functions #479

Closed jordancarlin closed 6 months ago

jordancarlin commented 6 months ago

There seem to be duplicate functions right now for reg and freg names, (f)reg_name_abi and (f)reg_name. These mappings are the same and only (f)reg_name is used, so remove the unused ones.

github-actions[bot] commented 6 months ago

Test Results

712 tests  ±0   712 :white_check_mark: ±0   0s :stopwatch: ±0s   6 suites ±0     0 :zzz: ±0    1 files   ±0     0 :x: ±0 

Results for commit 7aace27d. ± Comparison against base commit 2259041c.

Timmmm commented 6 months ago

I presume the original intent was so that you could assemble e.g. add a0, x10, 5, but I went back to the 5 year old commit that added them and they've always been the same so I don't see any reason to keep them.

Also I feel like to_str() needs to be fixed anyway. Its overloads include both directions of all the mappings so depending on the order in which you compile files to_str(0b00000) can be zero or f0 which is a bit weird. We should probably change the to_str() overloads to use reg_name_backwards, etc. instead of reg_name.

Anyway this looks fine.

jordancarlin commented 6 months ago

Exactly. And the to_str() overload for registers is not currently used in the assembly clauses, reg_name() is being used directly instead.

Timmmm commented 6 months ago

@billmcspadden-riscv I'll merge this if you have no objections?