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

Use it in current LLVM #3

Open
thetemplar opened this issue Nov 13, 2022 · 3 comments
Open

Use it in current LLVM #3

thetemplar opened this issue Nov 13, 2022 · 3 comments

Comments

@thetemplar
Copy link

Hi,
i am trying to merge this TriCore target into the current version of llvm.
I fixed some minor changes, but am stuck at here:

ADJCALLSTACKDOWN changed, so I had to add $amt2:

// Pseudo Instructions
//===----------------------------------------------------------------------===//

let Defs = [A10], Uses = [A10] in {
def ADJCALLSTACKDOWN : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),
                                    "# ADJCALLSTACKDOWN $amt1",
                                    [(callseq_start timm:$amt1, timm:$amt2)]>;
def ADJCALLSTACKUP   : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),
                                    "# ADJCALLSTACKUP $amt1",
                                    [(callseq_end timm:$amt1, timm:$amt2)]>;
}

This now leads to this error:

Included from /home/graul/test/llvm-project/llvm/lib/Target/TriCore/TriCore.td:25:
/home/graul/test/llvm-project/llvm/lib/Target/TriCore/TriCoreInstrInfo.td:242:5: error: In ADJCALLSTACKDOWN: Could not infer all types in pattern!
def ADJCALLSTACKDOWN : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),
    ^

But after hours if comparing it to existing/working projects, I still do not know what the problem here is.

I know you did not work on this for several years, but do you have an idea anyway?

Thanks!

@sidneyp
Copy link
Collaborator

sidneyp commented Nov 14, 2022

Hi,

That is so nice you are doing that! I think I can still help.
I believe the problem is in the definition of "callseq_start" that you didn't update too.

Here is the location where you should change: SDT_TriCoreCallSeqStart

Hope it works!

@XVilka
Copy link

XVilka commented Jun 21, 2023

@thetemplar the full support of Tricore was added into the mainstream capstone: https://github.com/capstone-engine/capstone/tree/next/arch/TriCore
Many of TableGen files were updated. Even though we targeted only disassembly, it should be helpful for the code generation as well, if you plan to work on this in the future.

Feel free to try and report any bugs if there are any, pull requests are welcome too.

See also TriDis/ditricore#2 (comment)

@XVilka
Copy link

XVilka commented Jul 6, 2023

@imbillow sent a draft PR with those updated files. If there is anyone who wants continue this work - they could use them as a base: #4

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

3 participants