[PATCH] Add support for negative immediates to TableGen AsmMatcherEmitter
Hal Finkel
hfinkel at anl.gov
Tue Jan 13 16:46:27 PST 2015
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
More information about the llvm-commits
mailing list