Closed orbiri closed 2 months ago
Awesome!
Since @orbiri pointed this out, I also want to say that the current CIR assembly syntax is not consistent across all operations. Besides the problem of parenthesis around operands, another inconsistency is how we represent the types of operands and results:
cir.binop(add, %0, %1) : !u64i
cir.cmp(eq, %0, %1) : !s32i, !cir.bool
cir.shift(left, %0 : !u64i, %1 : !s32i) -> !u64i
cir.ptr_diff(%0, %1) : !cir.ptr<!u64i> -> !u64i
I think we may need some "style guide" stuff to close the gap between different style choices and give CIR a consistent assembly syntax style. I don't know if the MLIR community has similar style guide; we may refer to that if it exists.
Thanks for bring more info, I'm down for having something like a style guide (if anyone is willing to write a doc for the webpage that'd be great). @orbiri also made some comments about this in the discord channel (just in case you haven't seen).
@orbiri since your PR landed we should probably close this one and open a new one for the overall asm style consistency.
Created, closing.
I'm taking a look at that. Writing tests with constants needed required too much effort :)