[PATCH] D14018: [mips][ias] Range check uimm4 operands and fixed a bug this revealed.

Vasileios Kalintiris via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 26 10:13:32 PDT 2015


vkalintiris accepted this revision.
vkalintiris added a comment.
This revision is now accepted and ready to land.

LGTM.


================
Comment at: lib/Target/Mips/AsmParser/MipsAsmParser.cpp:3297-3306
@@ -3296,8 +3296,12 @@
     return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), "expected '0'");
+  case Match_UImm1_0:
+    return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), "expected 1-bit unsigned immediate");
   case Match_UImm2_0:
     return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), "expected 2-bit unsigned immediate");
   case Match_UImm2_1:
     return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), "expected immediate in range 1 .. 4");
   case Match_UImm3_0:
     return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), "expected 3-bit unsigned immediate");
+  case Match_UImm4_0:
+    return Error(RefineErrorLoc(IDLoc, Operands, ErrorInfo), "expected 4-bit unsigned immediate");
   }
----------------
Similarly with the previous review requests, we should split the lines larger than 80-cols.


http://reviews.llvm.org/D14018





More information about the llvm-commits mailing list