[LLVMdev] string input for the integrated assembler

Joerg Sonnenberger joerg at britannica.bec.de
Wed Mar 18 10:50:48 PDT 2015

On Wed, Mar 18, 2015 at 10:06:38AM -0700, Steve King wrote:
> On Tue, Mar 17, 2015 at 6:14 PM, Tim Northover <t.p.northover at gmail.com> wrote:
> >> As a simplification, the compiler deals almost exclusively in pseudo
> >> instructions.  By x86 analogy, using pseudos to unfold a TEST32rm into
> >> MOV32rm + TEST32rr means I can skip the complex operand fitting effort
> >> needed to pick specific machine instructions.  There are many such
> >> examples where handling real instructions would become a gross
> >> overload.
> >>
> >> One drawback of this approach is that the integrated assembler
> >> receives only unexpanded pseudos as input, which fails.  So, my target
> >> must generate .s files and assemble as a separate step.
> >
> > It sounds like you're doing the expansion directly in the InstPrinter.
> I probably used the term 'expansion' incorrectly.  Pseudos go 1:1 into
> .s files, then MCTargetAsmParser does its job.  This class nicely
> consolidates tblgen's auto-generated operand fitting logic, which for
> me is quite a blob of code.  Should use of the integrated assembler
> require targets to pick all machine instructions some other way?  If
> the answer should be no, then handling pseudos via their AsmString
> feels like a tidy answer.

Please stop talking abouot "AsmString", that really makes no sense. It
is really hard to help you if you go back to an approach that is
difficult to understand and from what we can understand, completely
wrong. It also doesn't help that the questions so far are pretty much
without meat. E.g. no example of what your "high-level" assembler
mnemonic looks like and how the resulting instructions look like.


More information about the llvm-dev mailing list