[PATCH] D47310: [AArch64][SVE] Asm: Support for ADD (immediate) instructions.

Javed Absar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 24 12:04:24 PDT 2018


javed.absar added inline comments.


================
Comment at: lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:710
 
-    const MCExpr *Expr;
-
-    // An ADD/SUB shifter is either 'lsl #0' or 'lsl #12'.
-    if (isShiftedImm()) {
-      unsigned Shift = ShiftedImm.ShiftAmount;
-      Expr = ShiftedImm.Val;
-      if (Shift != 0 && Shift != 12)
-        return false;
-    } else
-      Expr = getImm();
-
     // Otherwise it should be a real negative immediate in range:
+    if (auto ShiftedVal = getShiftedVal<12>())
----------------
nitpick. ':' not needed 


================
Comment at: lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h:783
+  if (std::is_same<int8_t, typename std::make_signed<T>::type>::value)
+    return uint8_t(Imm) == Imm;
+  else
----------------
nitpick : maybe factor out 

bool Is8Bit = (uint8_t(Imm) == Imm);


https://reviews.llvm.org/D47310





More information about the llvm-commits mailing list