[PATCH] D68453: TableGen: Allow 'a+b' in TableGen language
Javed Absar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 4 23:25:37 PDT 2019
javed.absar added a comment.
In D68453#1695855 <https://reviews.llvm.org/D68453#1695855>, @hfinkel wrote:
> In D68453#1695803 <https://reviews.llvm.org/D68453#1695803>, @javed.absar wrote:
>
> > In D68453#1694815 <https://reviews.llvm.org/D68453#1694815>, @hfinkel wrote:
> >
> > > How far down this road can we go? I would like to see infix operators in TableGen because I believe that it will make it easier to use. However, I'm concerned about just adding add as a special case. Of the other similar operators:
> > >
> > > case ADD: Result = "!add"; break;
> > > case MUL: Result = "!mul"; break;
> > > case AND: Result = "!and"; break;
> > > case OR: Result = "!or"; break;
> > > case SHL: Result = "!shl"; break;
> > > case SRA: Result = "!sra"; break;
> > > case SRL: Result = "!srl"; break;
> > > case EQ: Result = "!eq"; break;
> > > case NE: Result = "!ne"; break;
> > > case LE: Result = "!le"; break;
> > > case LT: Result = "!lt"; break;
> > > case GE: Result = "!ge"; break;
> > > case GT: Result = "!gt"; break;
> > >
> > >
> > > how many can we add as infix operators without ambiguities or other difficulties?
> >
> >
> > I have a half baked shunting-algorithm based infix-operator patch to work with cases you mention but that is kind of major work. I thought maybe, as !add is most commonly used, there maybe an appetite for a simple solution like here.
>
>
> To be clear, I'm fine with taking an incremental approach here. It sounds like you've investigated this and there's no major technical impediment, it's just more complicated (and, thus, a more-complicated patch) to deal with all of the operators. Is that correct?
absolutely right, Hal.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68453/new/
https://reviews.llvm.org/D68453
More information about the llvm-commits
mailing list