From 8ca90e8fd6bca5eeeb814962780024a87e2c9648 Mon Sep 17 00:00:00 2001 From: "Paul A. Clarke" Date: Thu, 7 May 2020 20:31:16 -0500 Subject: [PATCH] Add example for vec_bperm vec_bperm is a challenge for showing an example using just tables, but I've made an attempt. Three tables are used: - The values of the input vectors *a* and *b*. - A zoomed in view of the last two bytes of *a* and the bit manipulations therein that leads to the intermediate result. - The result vector *r*. Only one example has been provided, but it's getting big. Fixes #14. Signed-off-by: Paul A. Clarke --- Intrinsics_Reference/ch_vec_reference.xml | 547 ++++++++++++++++++++++ 1 file changed, 547 insertions(+) diff --git a/Intrinsics_Reference/ch_vec_reference.xml b/Intrinsics_Reference/ch_vec_reference.xml index f07047b..306d64b 100644 --- a/Intrinsics_Reference/ch_vec_reference.xml +++ b/Intrinsics_Reference/ch_vec_reference.xml @@ -7941,6 +7941,553 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> + An example for input a + of type vector unsigned char follows: + + + + + + + + + + + + + + + + + + + + + + + byte index + + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + 9 + + + 10 + + + 11 + + + 12 + + + 13 + + + 14 + + + 15 + + + + + + + a + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + FF + + + A9 + + + + + b + + + 7F + + + 7E + + + 7D + + + 7C + + + 7B + + + 7A + + + 79 + + + 78 + + + 77 + + + 76 + + + 75 + + + 74 + + + 73 + + + 72 + + + 71 + + + 70 + + + + + + Zoom in to view just the two bytes in a + ([14..15]) containing the bits referenced by the bit indices + b[i] + + + (0 ≤ i < 16), + + + ([7F..70]): + + + + + + + + + + + + + + + + + + + + + + + + + byte index + + + 14 + + + 15 + + + + + bit index + + + 70 + + + 71 + + + 72 + + + 73 + + + 74 + + + 75 + + + 76 + + + 77 + + + 78 + + + 79 + + + 7A + + + 7B + + + 7C + + + 7D + + + 7E + + + 7F + + + + + + + a + + + FF + + + A9 + + + + + bit abit index + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + 1 + + + 0 + + + 1 + + + 0 + + + 0 + + + 1 + + + + + bit ab[i] + + + 1 + + + 0 + + + 0 + + + 1 + + + 0 + + + 1 + + + 0 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + + + intermediate result + + + 95 + + + FF + + + + + + + + + + + + + + + + + + + + + + + + + + + + byte index + + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + 9 + + + 10 + + + 11 + + + 12 + + + 13 + + + 14 + + + 15 + + + + + + + r + + + 00 + + + 00 + + + 00 + + + 00 + + + 00 + + + 00 + + + 95 + + + FF + + + 00 + + + 00 + + + 00 + + + 00 + + + 00 + + + 00 + + + 00 + + + 00 + + + + + + + Endian considerations: All bit and byte numberings within each element in the above description denote big-endian (i.e., left-to-right) order,