[PATCH] Add support for negative immediates to TableGen AsmMatcherEmitter

Hal Finkel hfinkel at anl.gov
Wed Jan 14 17:34:32 PST 2015


----- Original Message -----
> From: "Jordy Potman" <jordypotman at gmail.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: llvm-commits at cs.uiuc.edu
> Sent: Wednesday, January 14, 2015 3:05:26 PM
> Subject: Re: [PATCH] Add support for negative immediates to TableGen AsmMatcherEmitter
> 
> 
> 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.
> 

r226073, thanks!

 -Hal

> 
> 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
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list