[PATCH] Add support for negative immediates to TableGen AsmMatcherEmitter

Jordy Potman jordypotman at gmail.com
Wed Jan 14 13:05:26 PST 2015


Thanks for the review. I have attached an updated patch which uses
"_MINUS_" instead of "_DASH_". I do not have commit rights so I need
someone to commit it for me.

Thanks,

Jordy

On Wed, Jan 14, 2015 at 1:46 AM, Hal Finkel <hfinkel at anl.gov> wrote:
>
> LGTM, although I'd prefer "_MINUS_" to "_DASH_" (since _MINUS_1 will
likely be easier to interpret than _DASH_1).
>
>  -Hal
>
> ----- Original Message -----
> > From: "Jordy Potman" <jordypotman at gmail.com>
> > To: llvm-commits at cs.uiuc.edu
> > Sent: Sunday, January 11, 2015 11:37:56 AM
> > Subject: [PATCH] Add support for negative immediates to TableGen
 AsmMatcherEmitter
> >
> > For the LLVM backend
> > (https://github.com/ucb-bar/riscv-llvm/tree/riscv-trunk) for the
> > RISC-V architecture (http://riscv.org/) I would like to create an
> > InstAlias with a negative immediate, i.e.:
> >
> > def NOT : InstAlias<"not $dst, $src", (XORI GR32:$dst, GR32:$src,
> > -1)>;
> >
> > However the TableGen AsmMatcherEmitter currently generates invalid
> > enum values for negative immediates:
> >
> > lib/Target/RISCV/RISCVGenAsmMatcher.inc:95:11: error: expected '=
> > constant-expression' or end of enumerator definition
> >   CVT_imm_-1,
> >           ^
> >
> > The attached patch adds support for negative immediates to the
> > TableGen AsmMatcherEmitter.
> >
> > Jordy
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
>
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150114/609185a4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AsmMatcherEmitter-neg-imm.patch
Type: application/octet-stream
Size: 878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150114/609185a4/attachment.obj>


More information about the llvm-commits mailing list