aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorkoscrob <[email protected]>2024-02-09 15:16:04 +0100
committerkoscrob <[email protected]>2024-02-09 15:16:04 +0100
commit08fe5c8325343e93d41a589b89e360317ef887a4 (patch)
tree328bd2fa14ad42739d32d39e2e9d99e51829db90
parent49c83263a818f0c2e722ba86a75ba3966bd7d128 (diff)
downloadxbyak-08fe5c8325343e93d41a589b89e360317ef887a4.tar.gz
xbyak-08fe5c8325343e93d41a589b89e360317ef887a4.zip
FIX: extractBit() off-by-one issue.
Currently while extracting bits, bit "end" is excluded from the result while, based on usage, it is expected to be included.
-rw-r--r--xbyak/xbyak_util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h
index e90af65..e491cc4 100644
--- a/xbyak/xbyak_util.h
+++ b/xbyak/xbyak_util.h
@@ -177,7 +177,7 @@ private:
}
uint32_t extractBit(uint32_t val, uint32_t base, uint32_t end)
{
- return (val >> base) & ((1u << (end - base)) - 1);
+ return (val >> base) & ((1u << (end + 1 - base)) - 1);
}
void setNumCores()
{