On 12/15/24 3:11 AM, Oliver Kozul wrote:


I did not know about the costs of constant synthesis.
I thought that the values of those constants are known at compile time, and therefore their creation would not have an impact on performance. I will definitely take a look at riscv_const_insns and evaluate the synthesis complexity.
On an rv32 system constructing a word sized constant takes at most two instructions (lui+addi). On rv64 it can take as many as 6 instructions (lui+addi+lui+addi+sll+ior). If you dive into riscv_const_insns you'll see a ton of code that's designed to bring down the cost of constant synthesis, particularly on rv64 using various tricks.

Jeff

Reply via email to