GP-3424 Near/far pointer data-type propagation

This commit is contained in:
caheckman 2023-05-05 14:58:49 -04:00
parent 007cfacd6c
commit 3c08b44a1e
21 changed files with 403 additions and 292 deletions

View file

@ -168,8 +168,8 @@ public:
static uintb addressToByte(uintb val,uint4 ws); ///< Scale from addressable units to byte units
static uintb byteToAddress(uintb val,uint4 ws); ///< Scale from byte units to addressable units
static int4 addressToByteInt(int4 val,uint4 ws); ///< Scale int4 from addressable units to byte units
static int4 byteToAddressInt(int4 val,uint4 ws); ///< Scale int4 from byte units to addressable units
static int8 addressToByteInt(int8 val,uint4 ws); ///< Scale int4 from addressable units to byte units
static int8 byteToAddressInt(int8 val,uint4 ws); ///< Scale int4 from byte units to addressable units
static bool compareByIndex(const AddrSpace *a,const AddrSpace *b); ///< Compare two spaces by their index
};
@ -530,21 +530,21 @@ inline uintb AddrSpace::byteToAddress(uintb val,uint4 ws) {
return val/ws;
}
/// Given an int4 offset into an address space based on the addressable unit size (wordsize),
/// Given an int8 offset into an address space based on the addressable unit size (wordsize),
/// convert it into a byte relative offset
/// \param val is the offset to convert
/// \param ws is the number of bytes in the addressable word
/// \return the scaled offset
inline int4 AddrSpace::addressToByteInt(int4 val,uint4 ws) {
inline int8 AddrSpace::addressToByteInt(int8 val,uint4 ws) {
return val*ws;
}
/// Given an int4 offset in an address space based on bytes, convert it
/// Given an int8 offset in an address space based on bytes, convert it
/// into an offset relative to the addressable unit of the space (wordsize)
/// \param val is the offset to convert
/// \param ws is the number of bytes in the addressable word
/// \return the scaled offset
inline int4 AddrSpace::byteToAddressInt(int4 val,uint4 ws) {
inline int8 AddrSpace::byteToAddressInt(int8 val,uint4 ws) {
return val/ws;
}