HexagonMCInstrInfo.cpp [plain text]
#include "HexagonMCInstrInfo.h"
#include "HexagonBaseInfo.h"
#include "llvm/MC/MCInstrInfo.h"
namespace llvm {
MCInstrDesc const &HexagonMCInstrInfo::getDesc(MCInstrInfo const &MCII,
MCInst const &MCI) {
return (MCII.get(MCI.getOpcode()));
}
int HexagonMCInstrInfo::getMaxValue(MCInstrInfo const &MCII,
MCInst const &MCI) {
const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
unsigned isSigned =
(F >> HexagonII::ExtentSignedPos) & HexagonII::ExtentSignedMask;
unsigned bits = (F >> HexagonII::ExtentBitsPos) & HexagonII::ExtentBitsMask;
if (isSigned) return ~(-1U << (bits - 1));
else
return ~(-1U << bits);
}
}