[Libre-soc-isa] [Bug 966] create shift-and-add instruction

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Nov 6 11:53:26 GMT 2022


https://bugs.libre-soc.org/show_bug.cgi?id=966

--- Comment #17 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Jacob Lifshay from comment #16)
> realistically if we're adding only one of shaddsw/shadduw, we should add
> shaddsw because a C compiler can trivially use it with array[int_index],
> whereas shadduw requires the compiler to first prove the index isn't ever
> negative, which is often difficult (all the easy cases are already covered
> by ld/st's immediate or by shadd).

those easy cases are:
1. the compiler can prove the index is a constant, in which case just using
ld/st immediate is sufficient.
2. the compiler can promote all uses of the index variable to a 64-bit value
throughout the code thereby avoiding needing any sign extensions (a common
optimization compilers already do), in which case it can just use shadd.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Libre-SOC-ISA mailing list