diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp index a782347038275..08e5ccc7bc0be 100644 --- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp +++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp @@ -82,9 +82,9 @@ LoongArchMatInt::InstSeq LoongArchMatInt::generateInstSeq(int64_t Val) { TmpVal1 = Insts[1].Imm; if (N == 3) break; - TmpVal2 = Insts[3].Imm << 52 | TmpVal1; + TmpVal2 = static_cast(Insts[3].Imm) << 52 | TmpVal1; } - TmpVal1 |= Insts[0].Imm << 12; + TmpVal1 |= static_cast(Insts[0].Imm) << 12; break; case LoongArch::ORI: case LoongArch::ADDI_W: