qreverse icon indicating copy to clipboard operation
qreverse copied to clipboard

Risc-V and mips support ?

Open eix128 opened this issue 5 years ago • 3 comments

is there any support for risc-v and mips in future ?

eix128 avatar Feb 24 '20 11:02 eix128

Not really... I don't have a MIPS or Risc-V machine to research code on but I am very open to PRs!

Wunkolo avatar Feb 25 '20 05:02 Wunkolo

hmm , what about Qemu VM to test ?

eix128 avatar Feb 26 '20 22:02 eix128

I suppose so. MIPS has a flag that can be enabled in user-space that causes all load/store instructions to use a reverse byte endian, so a pattern I would imagine for a MIPS64 implementation of qReverse would be

Reverse64:
        dsbh    $2,$4
        dshd    $2,$2

which is how __builtin_bswap64 is implemented. So, in theory building qReverse on a gcc compiler targetting MIPS64 would already see speedups. So that work is implicitly already done.

RISC-V doesn't exactly lend itself to a fast in-register byte reverse though I don't think. I've never worked with either and can't think of an instruction that would lend itself for a qReverse acceleration.

Wunkolo avatar Feb 27 '20 00:02 Wunkolo