[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 Jul 21 13:20:47 BST 2021


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

--- Comment #2 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
this should be possible to do with vectorised CMP creating
a Vector of CRs.  followed by 3 CR-Predicated VCOMPRESSed
mvs, one with CR.eq, one with CR.gt, the other with CR.lt

from random import randint

def quicksort(array):
    if len(array) < 2:
        return array
    low, same, high = [], [], []
    pivot = array[randint(0, len(array) - 1)]
    for item in array:
        if item < pivot:
            low.append(item)
        elif item == pivot:
            same.append(item)
        elif item > pivot:
            high.append(item)
    return quicksort(low) + same + quicksort(high)

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


More information about the libre-soc-bugs mailing list