mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-13 23:18:58 +00:00
Shorten the FCmp and ICmp mnemonics to 3 letters. Make the parser
disambiguate them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32151 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
87e8ec9a50
commit
9f746f415e
@ -44,10 +44,6 @@ void set_scan_string (const char * str) {
|
||||
llvmAsmlval.type = Instruction::Enum; \
|
||||
return sym
|
||||
|
||||
#define RET_ENUM(type, Enum, sym) \
|
||||
llvmAsmlval.type = Enum; \
|
||||
return sym
|
||||
|
||||
// Construct a token value for an obsolete token
|
||||
#define RET_TY(CTYPE, SYM) \
|
||||
llvmAsmlval.PrimType = CTYPE;\
|
||||
@ -272,30 +268,26 @@ setle { RET_TOK(BinaryOpVal, SetLE, SETLE); }
|
||||
setge { RET_TOK(BinaryOpVal, SetGE, SETGE); }
|
||||
icmp { RET_TOK(OtherOpVal, ICmp, ICMP); }
|
||||
fcmp { RET_TOK(OtherOpVal, FCmp, FCMP); }
|
||||
eq { RET_ENUM(IPredicate, ICmpInst::ICMP_EQ, EQ); }
|
||||
ne { RET_ENUM(IPredicate, ICmpInst::ICMP_NE, NE); }
|
||||
slt { RET_ENUM(IPredicate, ICmpInst::ICMP_SLT, SLT); }
|
||||
sgt { RET_ENUM(IPredicate, ICmpInst::ICMP_SGT, SGT); }
|
||||
sle { RET_ENUM(IPredicate, ICmpInst::ICMP_SLE, SLE); }
|
||||
sge { RET_ENUM(IPredicate, ICmpInst::ICMP_SGE, SGE); }
|
||||
ult { RET_ENUM(IPredicate, ICmpInst::ICMP_ULT, ULT); }
|
||||
ugt { RET_ENUM(IPredicate, ICmpInst::ICMP_UGT, UGT); }
|
||||
ule { RET_ENUM(IPredicate, ICmpInst::ICMP_ULE, ULE); }
|
||||
uge { RET_ENUM(IPredicate, ICmpInst::ICMP_UGE, UGE); }
|
||||
ordeq { RET_ENUM(FPredicate, FCmpInst::FCMP_OEQ, ORDEQ); }
|
||||
ordne { RET_ENUM(FPredicate, FCmpInst::FCMP_ONE, ORDNE); }
|
||||
ordlt { RET_ENUM(FPredicate, FCmpInst::FCMP_OLT, ORDLT); }
|
||||
ordgt { RET_ENUM(FPredicate, FCmpInst::FCMP_OGT, ORDGT); }
|
||||
ordle { RET_ENUM(FPredicate, FCmpInst::FCMP_OLE, ORDLE); }
|
||||
ordge { RET_ENUM(FPredicate, FCmpInst::FCMP_OGE, ORDGE); }
|
||||
ord { RET_ENUM(FPredicate, FCmpInst::FCMP_ORD, ORD); }
|
||||
uno { RET_ENUM(FPredicate, FCmpInst::FCMP_UNO, UNO); }
|
||||
unoeq { RET_ENUM(FPredicate, FCmpInst::FCMP_UEQ, UNOEQ); }
|
||||
unone { RET_ENUM(FPredicate, FCmpInst::FCMP_UNE, UNONE); }
|
||||
unolt { RET_ENUM(FPredicate, FCmpInst::FCMP_ULT, UNOLT); }
|
||||
unogt { RET_ENUM(FPredicate, FCmpInst::FCMP_UGT, UNOGT); }
|
||||
unole { RET_ENUM(FPredicate, FCmpInst::FCMP_ULE, UNOLE); }
|
||||
unoge { RET_ENUM(FPredicate, FCmpInst::FCMP_UGE, UNOGE); }
|
||||
eq { return EQ; }
|
||||
ne { return NE; }
|
||||
slt { return SLT; }
|
||||
sgt { return SGT; }
|
||||
sle { return SLE; }
|
||||
sge { return SGE; }
|
||||
ult { return ULT; }
|
||||
ugt { return UGT; }
|
||||
ule { return ULE; }
|
||||
uge { return UGE; }
|
||||
oeq { return OEQ; }
|
||||
one { return ONE; }
|
||||
olt { return OLT; }
|
||||
ogt { return OGT; }
|
||||
ole { return OLE; }
|
||||
oge { return OGE; }
|
||||
ord { return ORD; }
|
||||
uno { return UNO; }
|
||||
ueq { return UEQ; }
|
||||
une { return UNE; }
|
||||
|
||||
phi { RET_TOK(OtherOpVal, PHI, PHI_TOK); }
|
||||
call { RET_TOK(OtherOpVal, Call, CALL); }
|
||||
|
@ -1076,11 +1076,10 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) {
|
||||
%token <BinaryOpVal> ADD SUB MUL UDIV SDIV FDIV UREM SREM FREM AND OR XOR
|
||||
%token <BinaryOpVal> SETLE SETGE SETLT SETGT SETEQ SETNE // Binary Comparators
|
||||
%token <OtherOpVal> ICMP FCMP
|
||||
%token <IPredicate> EQ NE SLT SGT SLE SGE ULT UGT ULE UGE
|
||||
%type <IPredicate> IPredicates
|
||||
%token <FPredicate> ORDEQ ORDNE ORDLT ORDGT ORDLE ORDGE ORD UNO UNOEQ UNONE
|
||||
%token <FPredicate> UNOLT UNOGT UNOLE UNOGE
|
||||
%type <FPredicate> FPredicates
|
||||
%token EQ NE SLT SGT SLE SGE ULT UGT ULE UGE
|
||||
%token OEQ ONE OLT OGT OLE OGE ORD UNO UEQ UNE
|
||||
|
||||
// Memory Instructions
|
||||
%token <MemOpVal> MALLOC ALLOCA FREE LOAD STORE GETELEMENTPTR
|
||||
@ -1128,9 +1127,25 @@ SetCondOps : SETLE | SETGE | SETLT | SETGT | SETEQ | SETNE;
|
||||
CastOps : TRUNC | ZEXT | SEXT | FPTRUNC | FPEXT | BITCAST |
|
||||
UITOFP | SITOFP | FPTOUI | FPTOSI | INTTOPTR | PTRTOINT;
|
||||
ShiftOps : SHL | LSHR | ASHR;
|
||||
IPredicates : EQ | NE | SLT | SGT | SLE | SGE | ULT | UGT | ULE | UGE ;
|
||||
FPredicates : ORDEQ | ORDNE | ORDLT | ORDGT | ORDLE | ORDGE | ORD | UNO
|
||||
| UNOEQ | UNONE | UNOLT | UNOGT | UNOLE | UNOGE ;
|
||||
IPredicates
|
||||
: EQ { $$ = ICmpInst::ICMP_EQ; } | NE { $$ = ICmpInst::ICMP_NE; }
|
||||
| SLT { $$ = ICmpInst::ICMP_SLT; } | SGT { $$ = ICmpInst::ICMP_SGT; }
|
||||
| SLE { $$ = ICmpInst::ICMP_SLE; } | SGE { $$ = ICmpInst::ICMP_SGE; }
|
||||
| ULT { $$ = ICmpInst::ICMP_ULT; } | UGT { $$ = ICmpInst::ICMP_UGT; }
|
||||
| ULE { $$ = ICmpInst::ICMP_ULE; } | UGE { $$ = ICmpInst::ICMP_UGE; }
|
||||
;
|
||||
|
||||
FPredicates
|
||||
: OEQ { $$ = FCmpInst::FCMP_OEQ; } | ONE { $$ = FCmpInst::FCMP_ONE; }
|
||||
| OLT { $$ = FCmpInst::FCMP_OLT; } | OGT { $$ = FCmpInst::FCMP_OGT; }
|
||||
| OLE { $$ = FCmpInst::FCMP_OLE; } | OGE { $$ = FCmpInst::FCMP_OGE; }
|
||||
| ORD { $$ = FCmpInst::FCMP_ORD; } | UNO { $$ = FCmpInst::FCMP_UNO; }
|
||||
| UEQ { $$ = FCmpInst::FCMP_UEQ; } | UNE { $$ = FCmpInst::FCMP_UNE; }
|
||||
| ULT { $$ = FCmpInst::FCMP_ULT; } | UGT { $$ = FCmpInst::FCMP_UGT; }
|
||||
| ULE { $$ = FCmpInst::FCMP_ULE; } | UGE { $$ = FCmpInst::FCMP_UGE; }
|
||||
| TRUETOK { $$ = FCmpInst::FCMP_TRUE; }
|
||||
| FALSETOK { $$ = FCmpInst::FCMP_FALSE; }
|
||||
;
|
||||
|
||||
// These are some types that allow classification if we only want a particular
|
||||
// thing... for example, only a signed, unsigned, or integral type.
|
||||
|
Loading…
Reference in New Issue
Block a user