[PATCH] D42294: [AArch64][AsmParser] NFC: Generalize LogicalImm[Not](32|64) code

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 07:34:33 PST 2018


sdesmalen added inline comments.


================
Comment at: lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp:916
+  typename std::make_unsigned<T>::type PrintVal;
+  PrintVal = AArch64_AM::decodeLogicalImmediate(Val, 64);
 
----------------
samparker wrote:
> Shouldn't '64' be dependent on T?
I think you're right... In practice it won't really matter since the cast to PrintVal truncates the pattern to the size of  T (otherwise a pattern is repeated until the whole 64bit value is filled with that pattern), but by always passing '64' we also skip an assert that checks the value to be decoded is sensible.


https://reviews.llvm.org/D42294





More information about the llvm-commits mailing list