Skip to content

unit IdxComparator

em.coremark/IdxComparator.em
package em.coremark

import ComparatorI

module IdxComparator: ComparatorI

end

def compare(a, b)
    a.val = <int16>((<uint16>a.val & 0xff00) | (0x00ff & <uint16>(a.val >> 8)))
    b.val = <int16>((<uint16>b.val & 0xff00) | (0x00ff & <uint16>(b.val >> 8)))
    return a.idx - b.idx
end