keystone icon indicating copy to clipboard operation
keystone copied to clipboard

[Feature Request] Plans for Supporting riscv64 Arch?

Open XieJiSS opened this issue 2 years ago • 2 comments

I'm wondering if it's possible for keystone to add riscv64 (or namely, riscv64gc) support. The underlying llvm layer has already supported it, but I've noticed that the codes are not ported to https://github.com/keystone-engine/keystone/tree/master/llvm/lib/Target yet.

Some more information:

RISC-V is a modular ISA, meaning that it only has a mandatory base, and everything else is an extension. riscv64gc, taken as the baseline for most distrios where they simply claim this as "supporting RISCV64". Basically, it means "RISC-V 64-bit, extensions G and C", with the G extension being a shorthand for some other extensions:

  • M (integer multiplication and division)
  • A (atomics)
  • F (single-precision floats)
  • D (double-precision floats)
  • "Zifencei" ("fence" instruction)
  • "Zicsr" (CSR instructions)
  • And the I base integer instructions (which are always required)

The C instruction is for "compressed" instructions, making the most popular integer operations 16-bits (instead of 32-bit)

XieJiSS avatar Feb 10 '22 06:02 XieJiSS

dup of #491

Xeonacid avatar Feb 12 '22 09:02 Xeonacid

Thanks for your interest. I'm already trying to work on it but I'm a little busy...

wtdcode avatar Feb 15 '22 10:02 wtdcode

Closed as completed, thanks the brilliant work of #549 !

wtdcode avatar May 19 '23 22:05 wtdcode

No rush at all, but I was wondering if keystone has any plan to release a new version with the recently added RISC-V support. It's been three years since the last release.

And to make keystone buildable on riscv64 linux, I think it is needed to update the config.guess file here: https://github.com/keystone-engine/keystone/blob/master/llvm/cmake/config.guess . Old config.guess script can't detect riscv64 linux, relevant log: https://archriscv.felixc.at/.status/log.htm?url=logs/keystone/keystone-0.9.2-5.log

kxxt avatar Nov 27 '23 13:11 kxxt

I once started working on a release several months ago because as you saw several things are broken but due to time limitation it was not done yet. Apologize for the delay.

I'm on a rush for several DDL recently so I hope to get this down early next year.

wtdcode avatar Nov 27 '23 13:11 wtdcode