[Libre-soc-bugs] [Bug 659] SVP64 demo / unit test of CRM data-dependent ffirst mode implementing insertion sort

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Oct 5 20:20:03 BST 2022


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

--- Comment #5 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
inverting the order:

def insertion_sort(array):
    lim = len(array)-1
    for i in range(lim,-1,-1):
        key_item = array[i]
        j = i + 1
        while j <= lim and array[j] > key_item:
            array[j - 1] = array[j]
            j += 1
        array[j - 1] = key_item
    return array

    ctr = alen-1
loop:
    setvl r3, ctr
    sv.mv/m=1<<r3 key, *array   # get key item

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


More information about the libre-soc-bugs mailing list