Fix getMSB function to only return 0 or 1

This commit is contained in:
Themis Demetriades 2024-06-06 13:47:01 +01:00
parent c2844ce0ec
commit 77cea8730a

View File

@ -86,7 +86,7 @@ inline static dword getMSBPos(a64inst_regType regType) {
// Returns the MSB of the given value assuming it's of the size stored in the given register type
inline static uint8_t getMSB(dword value, a64inst_regType regType) {
return value >> getMSBPos(regType);
return (value >> getMSBPos(regType)) & 1u;
}
// Updates N and Z condition codes given the machine and a result value