[llvm] r174877 - AArch64: Simplify logic in deciding whether bfi is valid

Tim Northover Tim.Northover at arm.com
Mon Feb 11 04:32:18 PST 2013


Author: tnorthover
Date: Mon Feb 11 06:32:18 2013
New Revision: 174877

URL: http://llvm.org/viewvc/llvm-project?rev=174877&view=rev
Log:
AArch64: Simplify logic in deciding whether bfi is valid

Previous code had a confusing comment which was mostly an implementation
detail. This condition corresponds to "lsb up to register width" and "width not
ridiculous".

Modified:
    llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Modified: llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp?rev=174877&r1=174876&r2=174877&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp Mon Feb 11 06:32:18 2013
@@ -1725,12 +1725,7 @@ validateInstruction(MCInst &Inst,
     int64_t ImmR = Inst.getOperand(ImmOps).getImm();
     int64_t ImmS = Inst.getOperand(ImmOps+1).getImm();
 
-    if (ImmR == 0) {
-      // Bitfield inserts are preferred disassembly if ImmS < ImmR. However,
-      // there is this one case where insert is valid syntax but the bfx
-      // disassembly should be used: e.g. "sbfiz w0, w0, #0, #1".
-      return false;
-    } else if (ImmS >= ImmR) {
+    if (ImmR != 0 && ImmS >= ImmR) {
       return Error(Operands[4]->getStartLoc(),
                    "requested insert overflows register");
     }





More information about the llvm-commits mailing list