diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_immediate.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_immediate.cpp index 399d293f25649757b8596ae769169da736dfa252..858b40f9fef53abfce71d9e78c16265cc4a28207 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_immediate.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_immediate.cpp @@ -16,18 +16,14 @@ #include "common_utils.h" #include "mpl_logging.h" -#if DEBUG #include #include #include -#endif namespace maplebe { -#if DEBUG static std::set ValidBitmaskImmSet = { #include "valid_bitmask_imm.txt" }; -#endif namespace { constexpr uint32 kMaxBitTableSize = 5; @@ -45,13 +41,12 @@ bool IsBitmaskImmediate(uint64 val, uint32 bitLen) { if ((bitLen == k32BitSize) && (static_cast(val) == -1)) { return false; } -#if DEBUG uint64 val2 = val; if (bitLen == k32BitSize) { val2 = (val2 << k32BitSize) | (val2 & ((1ULL << k32BitSize) - 1)); } bool expectedOutcome = (ValidBitmaskImmSet.find(val2) != ValidBitmaskImmSet.end()); -#endif + if ((val & 0x1) != 0) { /* * we want to work with @@ -72,11 +67,12 @@ bool IsBitmaskImmediate(uint64 val, uint32 bitLen) { /* now check if tmp is a power of 2 or tmpVal==0. */ tmpVal = tmpVal & (tmpVal - 1); if (tmpVal == 0) { -#if DEBUG if (!expectedOutcome) { LogInfo::MapleLogger() << "0x" << std::hex << std::setw(k16ByteSize) << std::setfill('0') << static_cast(val) << "\n"; + return false; } +#if DEBUG ASSERT(expectedOutcome, "incorrect implementation: not valid value but returning true"); #endif /* power of two or zero ; return true */