[llvm-dev] increment in tablegen

Nicolai Hähnle via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 16 00:40:58 PDT 2018


On 15.04.2018 21:23, hameeza ahmed via llvm-dev wrote:
> i have loop index I. I want to increment it by 1. How to do this in 
> registerinfo.td <http://registerinfo.td>. I m trying following but 
> getting error.
> 
> let SubRegIndices = [sub_32bit, sub_32bit_hi], CoveredBySubRegs = 1 in {
> foreach I = 0-255 in
>       {   m=add(I,1);

There are no free-form variables like this, and it's !add. Replacing `m` 
by `!add(I, 1)` in the following should work.

Cheers,
Nicolai


> def R_#J#_REG64b_#I : R_P<"R_"#J#"_R64b_"#I, !shl(I,2), 
> [!cast<R_P>("R_"#J#"_REG32b_"#I), !cast<R_PIM>("R_"#J#"_REG32b_"#m)]>;
> 
> }
> }
> 
> please help. how to increment I (add+1 in I).
> 
> 
> Thank You
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the llvm-dev mailing list