Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple way to enable output of "call" pseudo instruction? #40

Open
sbeard opened this issue Dec 12, 2016 · 0 comments
Open

Simple way to enable output of "call" pseudo instruction? #40

sbeard opened this issue Dec 12, 2016 · 0 comments

Comments

@sbeard
Copy link

sbeard commented Dec 12, 2016

Hello, I am writing an emulator for RISCV using RISCV assembly as an input. I have this working for the GCC assembly output. I like to switch to using LLVM to generate the assembly as working with LLVM is much easier when it comes time to manipulate programs; however I've hit a couple snags.

The last major obstacle I have in switching to LLVM is that it currently generates lui/addi/jalr triples in the assembly rather than the call pseudo instruction. I'm not very familiar with LLVM Machine passes and am having some trouble in switching from the triples to the pseudo op. I've traced things through to the emitCALL function in RISCVISelLowering; however, at by this point the machine IR has already converted to the LLVM IR call into instructions to load the address of the function and then CALLREG64. It seems like I need to go up one more level to where the LLVM IR is converted in this machine IR, but I'm not entirely certain where that happens.

If anyone knows of a simple way to enable this functionality, or can point me in the right direction on how to implement it or figure out where the LLVM IR is initially converted to RISCV Machine IR I would be very grateful.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant