On 8/9/24 5:51 PM, Vineet Gupta wrote:
As you mentioned above: positive values are already handled in
riscv_split_integer after
c104ef4b5eb1 ("RISC-V: improve codegen for large constants with same 32-bit lo and
hi")parts [2]
Weird. I would have swore we weren't seeing good code for those cases.
But checking now it looks happy.
Meaning this is redundant with the code from above commit.
If you prefer these changes (in light of patch 2/2 and/or zbkb changes tending
to this code) IMO that code should be removed.
No strong opinion on which to keep. Given yours are in the tree, let's
keep yours unless we can't find a way to handle the negative constant case.
For negative constants (without zbkb), I think the desired synthesis
would be to first generate the inverted constant which must be positive.
That's going to result in a 4 instruction sequence most of the time.
Then bit flip the result. That's likely still faster than the constant
pool approach and fewer instructions than the current synthesis where we
generate something like:
So let's withdraw this patch and refocus on the negative case.
jeff