diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp --- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -855,7 +855,7 @@ if (!isShiftedImm() && (!isImm() || !isa(getImm()))) return DiagnosticPredicateTy::NoMatch; - bool IsByte = std::is_same>::value; + bool IsByte = sizeof(T) == 1; if (auto ShiftedImm = getShiftedVal<8>()) if (!(IsByte && ShiftedImm->second) && AArch64_AM::isSVECpyImm(uint64_t(ShiftedImm->first) @@ -872,7 +872,7 @@ if (!isShiftedImm() && (!isImm() || !isa(getImm()))) return DiagnosticPredicateTy::NoMatch; - bool IsByte = std::is_same>::value; + bool IsByte = sizeof(T) == 1; if (auto ShiftedImm = getShiftedVal<8>()) if (!(IsByte && ShiftedImm->second) && AArch64_AM::isSVEAddSubImm(ShiftedImm->first diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h --- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h +++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h @@ -763,10 +763,10 @@ bool IsImm8 = int8_t(Imm) == Imm; bool IsImm16 = int16_t(Imm & ~0xff) == Imm; - if (std::is_same>::value) + if (sizeof(T) == 1) return IsImm8 || uint8_t(Imm) == Imm; - if (std::is_same>::value) + if (sizeof(T) == 2) return IsImm8 || IsImm16 || uint16_t(Imm & ~0xff) == Imm; return IsImm8 || IsImm16; @@ -775,8 +775,8 @@ /// Returns true if Imm is valid for ADD/SUB. template static inline bool isSVEAddSubImm(int64_t Imm) { - bool IsInt8t = std::is_same>::value; - return uint8_t(Imm) == Imm || (!IsInt8t && uint16_t(Imm & ~0xff) == Imm); + bool IsByte = sizeof(T) == 1; + return uint8_t(Imm) == Imm || (!IsByte && uint16_t(Imm & ~0xff) == Imm); } /// Return true if Imm is valid for DUPM and has no single CPY/DUP equivalent.