Skip to content

Commit

Permalink
check for 32-bit immediate instead
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Oct 15, 2024
1 parent 9679519 commit 665720f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,10 +1158,9 @@ class ARMOperand : public MCParsedAsmOperand {
bool isFPImm() const {
if (!isImm()) return false;
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
if (!CE) return false;
// TODO: Is implicitTrunc correct here?
int Val = ARM_AM::getFP32Imm(
APInt(32, CE->getValue(), /*isSigned=*/true, /*implicitTrunc=*/true));
if (!CE || !isUInt<32>(CE->getValue()))
return false;
int Val = ARM_AM::getFP32Imm(APInt(32, CE->getValue()));
return Val != -1;
}

Expand Down

0 comments on commit 665720f

Please sign in to comment.