rvjit: Introduce loongarch64 backend#244
Conversation
|
Coremark results with JIT on Loongson 3A5000 With on the host, |
LoongArch is a RISC ISA developed by Loongson, Co., Ltd., and has defined three variants, LA32R (R stands for "reduced"), LA32S, and LA64. This port only targets LA64 variant, since 32-bit LoongArch hardware is barely available on market, and only serves for embedded/education purpose. So far native linker is intentionally left unimplemented, and small immediate loading and conditional branch generation could be further optimized. This port has succeeded to boot a general RISC-V distribution, and passes the riscv-tests. I also verified the correctness with my downstream RVVM co-simulation patches[1]. Benchmarking with fp-disabled coremark, it achieves 7% of native performance, or 4.7x speed up over the interpreter (1176 v.s. 16666 v.s. 250 iterations/sec). Link: https://github.com/ziyao233/RVVM/tree/cosim # [1] Signed-off-by: Yao Zi <me@ziyao.cc>
ba5047e to
0bf6773
Compare
I assume the results are accidentally swapped with
How complicated would be to add support for this? I have some refactoring work ongoing in ARM64 / RISCV backends, which should expose a set of I will review in more detail soon |
Oops, with (I failed to reproduce the 250 iterations/sec result again lol)
I had a brief look and don't think it would be too complicated, but I'd like to put off some non-essential features so the changes are in a manageable size. And for patching branches/returns I'd probably add another helper function, so I think it would take another 30-70 lines.
Thanks for your time! |

LoongArch is a RISC ISA developed by Loongson, Co., Ltd., and has defined three variants, LA32R (R stands for "reduced"), LA32S, and LA64. This port only targets LA64 variant, since 32-bit LoongArch hardware is barely available on market, and only serves for embedded/education purpose.
So far native linker is intentionally left unimplemented, and small immediate loading and conditional branch generation could be further optimized.
This port has succeeded to boot a general RISC-V distribution, and passes the riscv-tests. I also verified the correctness with my downstream RVVM co-simulation patches[1]. Benchmarking with fp-disabled coremark, it achieves 7% of native performance, or 4.7x speed up over the interpreter (1176 v.s. 16666 v.s. 250 iterations/sec).
Link: https://github.com/ziyao233/RVVM/tree/cosim # [1]