[LLVMdev] RFC building a target MCAsmParser

Colin LeMahieu colinl at codeaurora.org
Tue Apr 14 12:00:40 PDT 2015


Sure, the first immediate problem we run in to is statements not beginning
with mnemonics.  The assembly syntax uses C-like assignments so most
statements start with a register token, then an equals token, and then the
mnemonic followed by the remaining tokens.

The next issue is with creating instruction bundles.  We enclose a certain
number of instructions in curly braces to signify packet begin/end so this
doesn't fit in to the one line = one instruction rule.

The way to describe sections and metadata is defined though we didn't have
many problems so they're omitted.

I see the X86 target has a matcher for each syntax.  Were there other things
in the grammar that were hard to integrate cleanly?

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Joerg Sonnenberger
Sent: Tuesday, April 14, 2015 1:21 PM
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] RFC building a target MCAsmParser

On Tue, Apr 14, 2015 at 12:58:51PM -0500, Colin LeMahieu wrote:
> We found the Hexagon grammar to be straight forward to implement using 
> plain lex / parse but harder within the MCTargetAsmParser.

Can you go into more detail what exactly you find difficult? X86 already has
the problem of integrating two quite different assembler variants.
Your grammar also seems to lack a number of things like how to specify
sections and similar meta data?

Joerg
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list