[PATCH] D107259: [Arm] Add assert in T2 Imm7s code emitter

Simon Wallis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 31 00:17:28 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf417b660eefd: [Arm] Add assert in T2 Imm7s code emitter (authored by simonwallis2).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107259/new/

https://reviews.llvm.org/D107259

Files:
  llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp


Index: llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
===================================================================
--- llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
+++ llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp
@@ -1138,6 +1138,7 @@
   // representation for the complex operand in the .td file. This isn't just
   // style, unfortunately. As-is, we can't represent the distinct encoding
   // for #-0.
+  assert(((Imm8 & 0x3) == 0) && "Not a valid immediate!");
   uint32_t Binary = (Imm8 >> 2) & 0xff;
   // Immediate is always encoded as positive. The 'U' bit controls add vs sub.
   if (isAdd)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107259.369641.patch
Type: text/x-patch
Size: 631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210831/fb07c3e1/attachment.bin>


More information about the llvm-commits mailing list