<div dir="ltr">I'm not sure how to add annotations to these instructions. But I can tell you that ADC64i32 is created by the last def at the bottom of the ArithBinOp_RF multiclass in X86InstrArithmetic.td.<div><br></div><div>~Craig</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 9, 2020 at 6:10 AM Alain Carlucci via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I'm trying to use the annotation support for the LLVM disassembler, which seems<br>
to be implemented only on ARM and x86.<br>
<br>
It was easy to add annotations also on SystemZ, AArch64 and MIPS (at least<br>
<imm:> and <reg:>) and I'm going to send you soon all the patches.<br>
<br>
But now I'm facing a problem with the annotations in x86: there are some<br>
instructions that emit registers directly from the AsmString written in the<br>
TableGen file.<br>
<br>
For example, llvm/lib/Target/X86/X86InstrInfo.td:1631, this line defines the<br>
instruction with the `al` register hardcoded, which is emitted without markup:<br>
```<br>
def MOV8o32a : Ii32<0xA2, RawFrmMemOffs, (outs), (ins offset32_8:$dst),<br>
                     "mov{b}\t{%al, $dst|$dst, al}", []>, AdSize32;<br>
```<br>
<br>
In this case, I tried to change "al" with "$al" (at first by creating a new<br>
RegisterClass "AL8" with only one register (AL) and forwarding it to MOV8o32a)<br>
but I got a crash while trying to emit the instruction. <br>
And, honestly, creating RegisterClass with only one register doesn't seem to be<br>
the best way to approach this problem.<br>
<br>
For the record, the crash was:<br>
```<br>
Unhandled relocation encoding AL8<br>
Unhandled relocation encoding<br>
UNREACHABLE executed at llvm/llvm/utils/TableGen/X86RecognizableInstr.cpp:1212!<br>
```<br>
<br>
There are instructions like ADC64i32, ADD64i32 that emit an hardcoded register<br>
in the generated file (something like `O << ", %rax"`) in <br>
build/lib/Target/X86/X86GenAsmWriter.inc but I can't find them in the any<br>
tablegen file. <br>
<br>
So I'd like to ask you, can you give me some advice about how to enable<br>
annotations for this kind of instructions?<br>
<br>
Thanks,<br>
Alain<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>