aboutsummaryrefslogtreecommitdiff
path: root/chapters/introduction.adoc
diff options
context:
space:
mode:
authorDominic Symes <dominic.symes@arm.com>2022-04-29 16:15:56 +0100
committerDominic Symes <dominic.symes@arm.com>2022-05-03 13:36:22 +0000
commitcb6c6b33cc85d6c40d46b1ee78bcbd6a049017d5 (patch)
tree94988082f976e28f25cc13c0331efd119f83b3f2 /chapters/introduction.adoc
parent5de08d1db3c1de4fddf3f4bb7a286db35cb9f9d1 (diff)
downloadspecification-cb6c6b33cc85d6c40d46b1ee78bcbd6a049017d5.tar.gz
Specify width of integer types
Clarify for types previously definded as int the width assumed by the specification. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: Ied62d4803a4323a600d33cff09752a76ca48f18d
Diffstat (limited to 'chapters/introduction.adoc')
-rw-r--r--chapters/introduction.adoc2
1 files changed, 1 insertions, 1 deletions
diff --git a/chapters/introduction.adoc b/chapters/introduction.adoc
index fe4f724..4263135 100644
--- a/chapters/introduction.adoc
+++ b/chapters/introduction.adoc
@@ -405,7 +405,7 @@ In places where a divide is required, we also use the function below to calculat
scale_t reciprocal_scale(uint32_t value) {
REQUIRE(value > 0);
scale_t scale;
- int k = 32 - count_leading_zeros(value - 1); // (1 << k) / 2 < value <= (1 << k)
+ int32_t k = 32 - count_leading_zeros(value - 1); // (1 << k) / 2 < value <= (1 << k)
int64_t numerator = ((1 << 30) + 1) << k;
scale.multiplier = numerator / value; // (1 << 30) <= multiplier < (1 << 31)
scale.shift = 30 + k;