diff options
author | Michael Maitland <michaeltmaitland@gmail.com> | 2022-09-15 17:38:11 -0700 |
---|---|---|
committer | Michael Maitland <michaeltmaitland@gmail.com> | 2022-09-30 12:08:28 -0700 |
commit | 19f8176eb6f557e62080e232ec2ef107ab363dde (patch) | |
tree | 308037d13cd9a47b458d1aed196ca75de7cf92e9 /llvm/lib/TableGen/TGParser.cpp | |
parent | f5c9931fefcab8de07a6c08c39b582fa58859dc9 (diff) | |
download | llvm-19f8176eb6f557e62080e232ec2ef107ab363dde.zip llvm-19f8176eb6f557e62080e232ec2ef107ab363dde.tar.gz llvm-19f8176eb6f557e62080e232ec2ef107ab363dde.tar.bz2 |
[TableGen] Add div bang operator
This patch adds the div bang operator which performs division.
Differential Revision: https://reviews.llvm.org/D134001
Diffstat (limited to 'llvm/lib/TableGen/TGParser.cpp')
-rw-r--r-- | llvm/lib/TableGen/TGParser.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index a574d20..4608d89 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -1159,6 +1159,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { case tgtok::XADD: case tgtok::XSUB: case tgtok::XMUL: + case tgtok::XDIV: case tgtok::XAND: case tgtok::XOR: case tgtok::XXOR: @@ -1187,6 +1188,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { case tgtok::XADD: Code = BinOpInit::ADD; break; case tgtok::XSUB: Code = BinOpInit::SUB; break; case tgtok::XMUL: Code = BinOpInit::MUL; break; + case tgtok::XDIV: Code = BinOpInit::DIV; break; case tgtok::XAND: Code = BinOpInit::AND; break; case tgtok::XOR: Code = BinOpInit::OR; break; case tgtok::XXOR: Code = BinOpInit::XOR; break; @@ -1225,6 +1227,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { case tgtok::XADD: case tgtok::XSUB: case tgtok::XMUL: + case tgtok::XDIV: Type = IntRecTy::get(Records); ArgType = IntRecTy::get(Records); break; @@ -1384,7 +1387,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { Code != BinOpInit::AND && Code != BinOpInit::OR && Code != BinOpInit::XOR && Code != BinOpInit::SRA && Code != BinOpInit::SRL && Code != BinOpInit::SHL && - Code != BinOpInit::MUL) + Code != BinOpInit::MUL && Code != BinOpInit::DIV) ArgType = Resolved; } @@ -2139,6 +2142,7 @@ Init *TGParser::ParseOperationCond(Record *CurRec, RecTy *ItemType) { /// SimpleValue ::= '(' IDValue DagArgList ')' /// SimpleValue ::= CONCATTOK '(' Value ',' Value ')' /// SimpleValue ::= ADDTOK '(' Value ',' Value ')' +/// SimpleValue ::= DIVTOK '(' Value ',' Value ')' /// SimpleValue ::= SUBTOK '(' Value ',' Value ')' /// SimpleValue ::= SHLTOK '(' Value ',' Value ')' /// SimpleValue ::= SRATOK '(' Value ',' Value ')' @@ -2427,6 +2431,7 @@ Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType, case tgtok::XADD: case tgtok::XSUB: case tgtok::XMUL: + case tgtok::XDIV: case tgtok::XNOT: case tgtok::XAND: case tgtok::XOR: |