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

tblgen for "Cpu0GenCodeEmitter.inc" failed #9

Open
yaozhongxiao opened this issue Jun 28, 2023 · 0 comments
Open

tblgen for "Cpu0GenCodeEmitter.inc" failed #9

yaozhongxiao opened this issue Jun 28, 2023 · 0 comments

Comments

@yaozhongxiao
Copy link

yaozhongxiao commented Jun 28, 2023

hi, @Jonathan2251:

When I tried to generate the "Cpu0GenCodeEmitter.inc" with tablegen(LLVM Cpu0GenCodeEmitter.inc -gen-emitter), It failed with the following message.

lib/Target/Cpu0/Cpu0InstrInfo.td:1037:5: error: No operand named addr in record JSUB
def JSUB    : JumpLink<0x3b, "jsub">;
    ^
note: Dumping record for previous error:
much more messages ...

Finally, I found the "FJ" in "Cpu0InstrFormats.td" has defined "bits<24> addr;" field,
however, the "class JumpLink" adopt the "$target" as follows.

 let isCall=1, hasDelaySlot=1 in {
   //@JumpLink {
   class JumpLink<bits<8> op, string instr_asm>:
-    FJ<op, (outs), (ins calltarget:$target, variable_ops),
-       !strconcat(instr_asm, "\t$target"), [(Cpu0JmpLink imm:$target)],
        IIBranch> {
 //#if CH >= CH10_1 2
        let DecoderMethod = "DecodeJumpTarget";

class FJ<bits<8> op, dag outs, dag ins, string asmstr, list<dag> pattern,
         InstrItinClass itin>: Cpu0Inst<outs, ins, asmstr, pattern, itin, FrmJ>
{
  bits<24> addr;

  let Opcode = op;

  let Inst{23-0} = addr;
}

After replacing the "$target" to "$addr", tblgen build successfully.

 let isCall=1, hasDelaySlot=1 in {
   //@JumpLink {
   class JumpLink<bits<8> op, string instr_asm>:
-    FJ<op, (outs), (ins calltarget:$target, variable_ops),
-       !strconcat(instr_asm, "\t$target"), [(Cpu0JmpLink imm:$target)],
+    FJ<op, (outs), (ins calltarget:$addr, variable_ops),
+       !strconcat(instr_asm, "\t$addr"), [(Cpu0JmpLink imm:$addr)],
        IIBranch> {
 //#if CH >= CH10_1 2
        let DecoderMethod = "DecodeJumpTarget";

Have you found this issue, or it's just a regression from the llvm project's evolution?

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