parent
ddba3289b5
commit
49c0457529
|
@ -17,6 +17,7 @@
|
||||||
#define LLVM_CODEGEN_VALUETYPES_H
|
#define LLVM_CODEGEN_VALUETYPES_H
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include "llvm/Support/DataTypes.h"
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
class Type;
|
class Type;
|
||||||
|
@ -108,6 +109,19 @@ namespace MVT { // MVT = Machine Value Types
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getIntVTBitMask - Return an integer with 1's every place there are bits
|
||||||
|
/// in the specified integer value type.
|
||||||
|
static inline uint64_t getIntVTBitMask(ValueType VT) {
|
||||||
|
assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
|
||||||
|
return ~0ULL >> (64-getSizeInBits(VT));
|
||||||
|
}
|
||||||
|
/// getIntVTSignBit - Return an integer with a 1 in the position of the sign
|
||||||
|
/// bit for the specified integer value type.
|
||||||
|
static inline uint64_t getIntVTSignBit(ValueType VT) {
|
||||||
|
assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
|
||||||
|
return 1ULL << (getSizeInBits(VT)-1);
|
||||||
|
}
|
||||||
|
|
||||||
/// MVT::getValueTypeString - This function returns value type as a string,
|
/// MVT::getValueTypeString - This function returns value type as a string,
|
||||||
/// e.g. "i32".
|
/// e.g. "i32".
|
||||||
const char *getValueTypeString(ValueType VT);
|
const char *getValueTypeString(ValueType VT);
|
||||||
|
|
Loading…
Reference in New Issue