[llvm] c55e24b - [llvm][LoongArch] Fix BSTRINS_D test failures on 32 bit hosts
David Spickett via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 30 08:43:03 PDT 2024
Author: David Spickett
Date: 2024-08-30T15:42:55Z
New Revision: c55e24b8507d47a8cc04b5d9570e8e3d02be1ca3
URL: https://github.com/llvm/llvm-project/commit/c55e24b8507d47a8cc04b5d9570e8e3d02be1ca3
DIFF: https://github.com/llvm/llvm-project/commit/c55e24b8507d47a8cc04b5d9570e8e3d02be1ca3.diff
LOG: [llvm][LoongArch] Fix BSTRINS_D test failures on 32 bit hosts
eaf87d32754beb5bec10bab517bf56e25575b48e added new code that uses
64 bit types and ULL for constants, mostly, but a few UL snuck in.
UL is still 4 bytes on 32 bit, ULL is 8.
This fixes test failures on 32 bit Arm:
https://lab.llvm.org/buildbot/#/builders/39/builds/1338
Added:
Modified:
llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp
index 1ce1a9845db21c..6ad2c003558a51 100644
--- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp
+++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp
@@ -97,7 +97,7 @@ LoongArchMatInt::InstSeq LoongArchMatInt::generateInstSeq(int64_t Val) {
for (uint64_t Lsb = Msb; Lsb > 0; --Lsb) {
uint64_t LowMask = (1ULL << Lsb) - 1;
uint64_t Mask = HighMask | LowMask;
- uint64_t LsbToZero = TmpVal1 & ((1UL << (Msb - Lsb + 1)) - 1);
+ uint64_t LsbToZero = TmpVal1 & ((1ULL << (Msb - Lsb + 1)) - 1);
uint64_t MsbToLsb = LsbToZero << Lsb;
if ((MsbToLsb | (TmpVal1 & Mask)) == (uint64_t)Val) {
if (Insts[1].Opc == LoongArch::ORI && N == 3)
@@ -107,7 +107,7 @@ LoongArchMatInt::InstSeq LoongArchMatInt::generateInstSeq(int64_t Val) {
return Insts;
}
if (TmpVal2 != 0) {
- LsbToZero = TmpVal2 & ((1UL << (Msb - Lsb + 1)) - 1);
+ LsbToZero = TmpVal2 & ((1ULL << (Msb - Lsb + 1)) - 1);
MsbToLsb = LsbToZero << Lsb;
if ((MsbToLsb | (TmpVal2 & Mask)) == (uint64_t)Val) {
Insts[0] = Insts[1];
More information about the llvm-commits
mailing list