aboutsummaryrefslogtreecommitdiff
path: root/chapters/ewise_unary.adoc
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2020-12-15 15:41:05 -0800
committerEric Kunze <eric.kunze@arm.com>2020-12-16 14:25:20 -0800
commite5d22a77300643f0a3013ad40ccd2b5b76788b42 (patch)
tree61ccb85014ce007166882c79c690ceae1534f289 /chapters/ewise_unary.adoc
parent5d60c71300ecb78cd59ca30f6383ec7f5527d3c5 (diff)
downloadspecification-e5d22a77300643f0a3013ad40ccd2b5b76788b42.tar.gz
Disambiguate scale_t in RESIZE command
scale_t is already defined globally for the rescaling. Move pseudocode for count_leading_zeros to introduction, and use it in the implementation of CLZ. Change-Id: I2453bce93b6dd25e870b8a010fc62af4c001cbf9
Diffstat (limited to 'chapters/ewise_unary.adoc')
-rw-r--r--chapters/ewise_unary.adoc12
1 files changed, 1 insertions, 11 deletions
diff --git a/chapters/ewise_unary.adoc b/chapters/ewise_unary.adoc
index c64bef7..8cdce3d 100644
--- a/chapters/ewise_unary.adoc
+++ b/chapters/ewise_unary.adoc
@@ -122,17 +122,7 @@ Elementwise count leading zeros operation
for_each (index in shape) {
in_t acc = 0
in_t value1 = tensor_read<in_t>(input1, shape, index)
- if (value1 == 0) {
- acc = 32 // input1_width
- }
- else {
- mask = 1 << (32 - 1) // input1_width - 1
- acc = 0
- while (mask & value1 == 0) {
- mask = mask >> 1
- acc = acc + 1
- }
- }
+ acc = count_leading_zeros(value1)
tensor_write<in_t>(output, shape, index, acc)
}
----