From 0d686a2a8f79600990245b4231e0e013a8de835d Mon Sep 17 00:00:00 2001 From: "Paul A. Clarke" Date: Wed, 13 May 2020 15:41:21 -0500 Subject: [PATCH] Add examples for "match" intrinsics Add examples for - `vec_first_match_index` - `vec_first_match_index_or_eos` - `vec_first_mismatch_index` - `vec_first_mismatch_index_or_eos` Also, `vec_first_match_index` implmentations in this document and in GCC were behaving like `vec_first_match_or_eos_index`. Correct this document. GCC PR94833 was already opened. Fixes #18. Signed-off-by: Paul A. Clarke --- Intrinsics_Reference/ch_vec_reference.xml | 822 +++++++++++++++++++++- 1 file changed, 803 insertions(+), 19 deletions(-) diff --git a/Intrinsics_Reference/ch_vec_reference.xml b/Intrinsics_Reference/ch_vec_reference.xml index 1925ca8..dd6d362 100644 --- a/Intrinsics_Reference/ch_vec_reference.xml +++ b/Intrinsics_Reference/ch_vec_reference.xml @@ -15315,21 +15315,217 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> element index of the position of the first character match in natural element order. If no match, returns the number of characters as an element count in the vector argument. + An example follows: + + + + + + + + + + + + + + + + + + + + + + + + byte index n + + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + 9 + + + 10 + + + 11 + + + 12 + + + 13 + + + 14 + + + 15 + + + + + + + a + + + 00 + + + 10 + + + 20 + + + 30 + + + 40 + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + + + b + + + FF + + + FF + + + FF + + + FF + + + 40 + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + + + r + + + 4 + + + + + + + Endian considerations: The element numbering within a register is left-to-right for big-endian targets, and right-to-left for little-endian targets. - vcmpnezb + vcmpneb vec_first_match_index - vcmpnezh + vcmpneh vec_first_match_index - vcmpnezw + vcmpnew vec_first_match_index @@ -15401,14 +15597,14 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezb t,a,b + vcmpneb t,a,b xxlnor u,t,t vctzlsbb r,u - vcmpnezb t,a,b + vcmpneb t,a,b xxlnor u,t,t vclzlsbb r,u @@ -15429,14 +15625,14 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezb t,a,b + vcmpneb t,a,b xxlnor u,t,t vctzlsbb r,u - vcmpnezb t,a,b + vcmpneb t,a,b xxlnor u,t,t vclzlsbb r,u @@ -15457,7 +15653,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezh t,a,b + vcmpneh t,a,b xxlnor u,t,t vctzlsbb v,u rldicl r,v,63,33 @@ -15465,7 +15661,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezh t,a,b + vcmpneh t,a,b xxlnor u,t,t vclzlsbb v,u rldicl r,v,63,33 @@ -15487,7 +15683,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezh t,a,b + vcmpneh t,a,b xxlnor u,t,t vctzlsbb v,u rldicl r,v,63,33 @@ -15495,7 +15691,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezh t,a,b + vcmpneh t,a,b xxlnor u,t,t vclzlsbb v,u rldicl r,v,63,33 @@ -15517,7 +15713,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezw t,a,b + vcmpnew t,a,b xxlnor u,t,t vctzlsbb v,u rldicl r,v,62,34 @@ -15525,7 +15721,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezw t,a,b + vcmpnew t,a,b xxlnor u,t,t vclzlsbb v,u rldicl r,v,62,34 @@ -15547,7 +15743,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezw t,a,b + vcmpnew t,a,b xxlnor u,t,t vctzlsbb v,u rldicl r,v,62,34 @@ -15555,7 +15751,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> - vcmpnezw t,a,b + vcmpnew t,a,b xxlnor u,t,t vclzlsbb v,u rldicl r,v,62,34 @@ -15590,6 +15786,202 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> either the first character match or an end-of-string (EOS) terminator. If no match or terminator, returns the number of characters as an element count in the vector argument. + An example follows: + + + + + + + + + + + + + + + + + + + + + + + + byte index n + + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + 9 + + + 10 + + + 11 + + + 12 + + + 13 + + + 14 + + + 15 + + + + + + + a + + + 01 + + + 02 + + + 03 + + + 00 + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + + + b + + + FF + + + FF + + + FF + + + FF + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + + + r + + + 3 + + + + + + + Endian considerations: The element numbering within a register is left-to-right for big-endian targets, and right-to-left for little-endian targets. @@ -15928,10 +16320,206 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> role="bold">b, and returns the first position of inequality. - Result value: Returns the - element index of the position of the first character mismatch in - natural element order. If no mismatch, returns the number of - characters as an element count in the vector argument. + Result value: Returns the + element index of the position of the first character mismatch in + natural element order. If no mismatch, returns the number of + characters as an element count in the vector argument. + An example follows: + + + + + + + + + + + + + + + + + + + + + + + + byte index n + + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + 9 + + + 10 + + + 11 + + + 12 + + + 13 + + + 14 + + + 15 + + + + + + + a + + + 00 + + + 01 + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + + + b + + + 00 + + + 02 + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + + + r + + + 1 + + + + + + + Endian considerations: The element numbering within a register is left-to-right for big-endian targets, and right-to-left for little-endian targets. @@ -16191,6 +16779,202 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.vec-ref"> either the first character mismatch or an end-of-string (EOS) terminator. If no mismatch or terminator, returns the number of characters as an element count in the vector argument. + An example follows: + + + + + + + + + + + + + + + + + + + + + + + + byte index n + + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + 9 + + + 10 + + + 11 + + + 12 + + + 13 + + + 14 + + + 15 + + + + + + + a + + + 01 + + + 02 + + + 03 + + + 00 + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + + + b + + + 01 + + + 02 + + + 03 + + + 00 + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + ?? + + + + + r + + + 3 + + + + + + + Endian considerations: The element numbering within a register is left-to-right for big-endian targets, and right-to-left for little-endian targets.