[Libre-soc-isa] [Bug 996] New: add shaddsw or replace shadduw with shaddsw since i32 indexes are waay more common than u32
    bugzilla-daemon at libre-soc.org 
    bugzilla-daemon at libre-soc.org
       
    Wed Jan 25 21:09:21 GMT 2023
    
    
  
https://bugs.libre-soc.org/show_bug.cgi?id=996
            Bug ID: 996
           Summary: add shaddsw or replace shadduw with shaddsw since i32
                    indexes are waay more common than u32
           Product: Libre-SOC's first SoC
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: CONFIRMED
          Severity: enhancement
          Priority: ---
         Component: Specification
          Assignee: lkcl at lkcl.net
          Reporter: programmerjake at gmail.com
                CC: libre-soc-isa at lists.libre-soc.org
   NLnet milestone: ---
as mentioned in:
https://bugs.libre-soc.org/show_bug.cgi?id=966#c17
> 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.
Note that easy case #2 also covers u32 index variables that the compiler can
prove don't wrap around.
-- 
You are receiving this mail because:
You are on the CC list for the bug.
    
    
More information about the Libre-SOC-ISA
mailing list