[PATCH] D47309: [AArch64][SVE] Asm: Support for DUP (immediate) instructions.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 24 02:01:24 PDT 2018
fhahn added inline comments.
================
Comment at: lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:638
+ Optional<std::pair<int64_t, unsigned> > getShiftedVal() const {
+ Optional<std::pair<int64_t, unsigned> > Res;
+
----------------
You should be able to use `return {}` to return a None value and `return { Val, Width }` to return a value? I think that way the logic could be slightly simplified here.
================
Comment at: lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp:2368
+ // Just in case the optional lsl #0 is used for immediates other than zero.
+ if ((ShiftAmount == 0) && (Imm != 0)) {
+ SMLoc E = Parser.getTok().getLoc();
----------------
Unneeded `()`
================
Comment at: lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h:772
+ if (std::is_same<int8_t, typename std::make_signed<T>::type>::value)
+ return (uint8_t(Imm) == Imm) || (int8_t(Imm) == Imm);
+ else
----------------
no `()` needed here?
================
Comment at: lib/Target/AArch64/MCTargetDesc/AArch64MCCodeEmitter.cpp:516
+unsigned
+AArch64MCCodeEmitter::getImm8OptLsl(const MCInst &MI, unsigned OpIdx,
----------------
any reason we are not using a fixed width type here, like the other getXXX functions around here?
https://reviews.llvm.org/D47309
More information about the llvm-commits
mailing list