[rs6000] Bug fixes for the Power 9 stxvl and lxvl instructions.

Message ID 1516132634.9398.11.camel@us.ibm.com
State New
Headers show
Series
  • [rs6000] Bug fixes for the Power 9 stxvl and lxvl instructions.
Related show

Commit Message

Carl Love Jan. 16, 2018, 7:57 p.m.
GCC maintainers:

The following patch contains fixes for the stxvl and lxvl instructions
and XL_LEN_R builtin that were found while adding additional Power 9
test cases for the various load and store builtins.  The new tests in
builtins-5-p9-runnable.c and builtins-6-p9-runnable.c are included that
exposed the bugs.

The test cases have been run and verified by hand on Power 9 without
error.  The full regressions on Power 8 LE, Power 8 BE and Power 9 are
currently running.

Please let me know if the patch is acceptable provided the regression
testing completes cleanly.  Thanks.

                                 Carl Love


-----------------------------------------------------------------------


gcc/ChangeLog:

2018-01-16 Carl Love  <cel@us.ibm.com>
	* config/rs6000/vsx.md (define_expand xl_len_r,
	define_expand stxvl, define_expand *stxvl): Add match_dup
	argument.

gcc/testsuite/ChangeLog:

2018-01-16  Carl Love  <cel@us.ibm.com>
	* gcc.target/powerpc/builtins-6-p9-runnable.c: Add additional tests.
	Add debug print statements.
	* gcc.target/powerpc/builtins-5-p9-runnable.c: Add test to do
	16 byte vector load followed by a partial vector load.
---
 gcc/config/rs6000/rs6000-builtin.def               |    4 +-
 gcc/config/rs6000/vsx.md                           |   26 +-
 .../gcc.target/powerpc/builtins-5-p9-runnable.c    |  150 +-
 .../gcc.target/powerpc/builtins-6-p9-runnable.c    | 1759 ++++++++++++--------
 4 files changed, 1214 insertions(+), 725 deletions(-)

-- 
2.11.0

Comments

Segher Boessenkool Jan. 16, 2018, 11:05 p.m. | #1
Hi!

On Tue, Jan 16, 2018 at 11:57:14AM -0800, Carl Love wrote:
> The following patch contains fixes for the stxvl and lxvl instructions

> and XL_LEN_R builtin that were found while adding additional Power 9

> test cases for the various load and store builtins.  The new tests in

> builtins-5-p9-runnable.c and builtins-6-p9-runnable.c are included that

> exposed the bugs.


> gcc/ChangeLog:

> 

> 2018-01-16 Carl Love  <cel@us.ibm.com>

> 	* config/rs6000/vsx.md (define_expand xl_len_r,

> 	define_expand stxvl, define_expand *stxvl): Add match_dup

> 	argument.


You should mention the rs6000-builtin.def change, too.  It is, uh,
important :-)  And maybe some words about the other changes in vsx.md?

> gcc/testsuite/ChangeLog:

> 

> 2018-01-16  Carl Love  <cel@us.ibm.com>

> 	* gcc.target/powerpc/builtins-6-p9-runnable.c: Add additional tests.

> 	Add debug print statements.

> 	* gcc.target/powerpc/builtins-5-p9-runnable.c: Add test to do

> 	16 byte vector load followed by a partial vector load.



> --- a/gcc/config/rs6000/vsx.md

> +++ b/gcc/config/rs6000/vsx.md

> @@ -4624,10 +4624,12 @@ (define_expand "first_mismatch_or_eos_index_<mode>"

>  ;; Load VSX Vector with Length

>  (define_expand "lxvl"

>    [(set (match_dup 3)

> -        (match_operand:DI 2 "register_operand"))

> +        (ashift:DI (match_operand:DI 2 "register_operand")

> +                   (const_int 56)))

>     (set (match_operand:V16QI 0 "vsx_register_operand")

>  	(unspec:V16QI

>  	 [(match_operand:DI 1 "gpc_reg_operand")

> +          (mem:V16QI (match_dup 1))


Please use a tab instead of eight spaces at the start of line.  (Twice
here, once in lxvll -- well two tabs on one line there).

Looks great otherwise.  Okay for trunk with those nits fixed (if the tests
work out, of course).  Thanks!


Segher

Patch

diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
index 0f7da6a4a..b17036c5a 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -2197,8 +2197,8 @@  BU_P9V_OVERLOAD_2 (VIEDP,	"insert_exp_dp")
 BU_P9V_OVERLOAD_2 (VIESP,	"insert_exp_sp")
 
 /* 2 argument vector functions added in ISA 3.0 (power9).  */
-BU_P9V_64BIT_VSX_2 (LXVL,	"lxvl",		CONST,	lxvl)
-BU_P9V_64BIT_VSX_2 (XL_LEN_R,	"xl_len_r",	CONST,  xl_len_r)
+BU_P9V_64BIT_VSX_2 (LXVL,	"lxvl",		PURE,	lxvl)
+BU_P9V_64BIT_VSX_2 (XL_LEN_R,	"xl_len_r",	PURE,	xl_len_r)
 
 BU_P9V_AV_2 (VEXTUBLX, "vextublx",		CONST,	vextublx)
 BU_P9V_AV_2 (VEXTUBRX, "vextubrx",		CONST,	vextubrx)
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index 0323e866f..03f8ec2d6 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -4624,10 +4624,12 @@  (define_expand "first_mismatch_or_eos_index_<mode>"
 ;; Load VSX Vector with Length
 (define_expand "lxvl"
   [(set (match_dup 3)
-        (match_operand:DI 2 "register_operand"))
+        (ashift:DI (match_operand:DI 2 "register_operand")
+                   (const_int 56)))
    (set (match_operand:V16QI 0 "vsx_register_operand")
 	(unspec:V16QI
 	 [(match_operand:DI 1 "gpc_reg_operand")
+          (mem:V16QI (match_dup 1))
 	  (match_dup 3)]
 	 UNSPEC_LXVL))]
   "TARGET_P9_VECTOR && TARGET_64BIT"
@@ -4639,16 +4641,17 @@  (define_insn "*lxvl"
   [(set (match_operand:V16QI 0 "vsx_register_operand" "=wa")
 	(unspec:V16QI
 	 [(match_operand:DI 1 "gpc_reg_operand" "b")
-	  (match_operand:DI 2 "register_operand" "+r")]
+	  (mem:V16QI (match_dup 1))
+	  (match_operand:DI 2 "register_operand" "r")]
 	 UNSPEC_LXVL))]
   "TARGET_P9_VECTOR && TARGET_64BIT"
-  "sldi %2,%2, 56\; lxvl %x0,%1,%2"
-  [(set_attr "length" "8")
-   (set_attr "type" "vecload")])
+  "lxvl %x0,%1,%2"
+  [(set_attr "type" "vecload")])
 
 (define_insn "lxvll"
   [(set (match_operand:V16QI 0 "vsx_register_operand" "=wa")
 	(unspec:V16QI [(match_operand:DI 1 "gpc_reg_operand" "b")
+                       (mem:V16QI (match_dup 1))
 		       (match_operand:DI 2 "register_operand" "r")]
 		      UNSPEC_LXVLL))]
   "TARGET_P9_VECTOR"
@@ -4677,6 +4680,7 @@  (define_expand "xl_len_r"
 (define_insn "stxvll"
   [(set (mem:V16QI (match_operand:DI 1 "gpc_reg_operand" "b"))
 	(unspec:V16QI [(match_operand:V16QI 0 "vsx_register_operand" "wa")
+		       (mem:V16QI (match_dup 1))
 		       (match_operand:DI 2 "register_operand" "r")]
 	              UNSPEC_STXVLL))]
   "TARGET_P9_VECTOR"
@@ -4686,10 +4690,12 @@  (define_insn "stxvll"
 ;; Store VSX Vector with Length
 (define_expand "stxvl"
   [(set (match_dup 3)
-	(match_operand:DI 2 "register_operand"))
+	(ashift:DI (match_operand:DI 2 "register_operand")
+		   (const_int 56)))
    (set (mem:V16QI (match_operand:DI 1 "gpc_reg_operand"))
 	(unspec:V16QI
 	 [(match_operand:V16QI 0 "vsx_register_operand")
+	  (mem:V16QI (match_dup 1))
 	  (match_dup 3)]
 	 UNSPEC_STXVL))]
   "TARGET_P9_VECTOR && TARGET_64BIT"
@@ -4701,12 +4707,12 @@  (define_insn "*stxvl"
   [(set (mem:V16QI (match_operand:DI 1 "gpc_reg_operand" "b"))
 	(unspec:V16QI
 	 [(match_operand:V16QI 0 "vsx_register_operand" "wa")
-	  (match_operand:DI 2 "register_operand" "+r")]
+	  (mem:V16QI (match_dup 1))
+	  (match_operand:DI 2 "register_operand" "r")]
 	 UNSPEC_STXVL))]
   "TARGET_P9_VECTOR && TARGET_64BIT"
-  "sldi %2,%2,56\;stxvl %x0,%1,%2"
-  [(set_attr "length" "8")
-   (set_attr "type" "vecstore")])
+  "stxvl %x0,%1,%2"
+  [(set_attr "type" "vecstore")])
 
 ;; Expand for builtin xst_len_r
 (define_expand "xst_len_r"
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c
index ad3947196..69b9aa80b 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-5-p9-runnable.c
@@ -36,8 +36,7 @@  int main() {
    unsigned char *address;
    vector unsigned char *datap;
    
-   vector unsigned char vec_uc_expected1, vec_uc_expected2,
-      vec_uc_result1, vec_uc_result2;
+   vector unsigned char vec_uc_expected1, vec_uc_result1;
    vector int data_int;
    
    for (i=0; i<100; i++)
@@ -77,26 +76,26 @@  int main() {
 
    /* VEC_XL_LEN_R */
    size = 8;
-   vec_uc_result2 = vec_xl_len_r(data_uc, size);
+   vec_uc_result1 = vec_xl_len_r(data_uc, size);
 
-   vec_uc_expected2 = (vector unsigned char){8, 7, 6, 5, 4, 3, 2, 1,
+   vec_uc_expected1 = (vector unsigned char){8, 7, 6, 5, 4, 3, 2, 1,
 					     0, 0, 0, 0, 0, 0, 0, 0,};
    
-   if (result_wrong (vec_uc_expected2, vec_uc_result2))
+   if (result_wrong (vec_uc_expected1, vec_uc_result1))
      {
 #ifdef DEBUG
        printf("Error: result does not match expected result\n");
-       printf("vec_xl_len_r(%d): vec_uc_expected2[0] to vec_uc_expected2[15]\n",
+       printf("vec_xl_len_r(%d): vec_uc_expected1[0] to vec_uc_expected1[15]\n",
 	  size);
    
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_expected2[i]);
+	 printf(" %d,", vec_uc_expected1[i]);
 
-       printf("\nvec_xl_len_r(%d): vec_uc_result2[0] to vec_uc_result2[15]\n",
+       printf("\nvec_xl_len_r(%d): vec_uc_result1[0] to vec_uc_result1[15]\n",
 	      size);
    
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_result2[i]);
+	 printf(" %d,", vec_uc_result1[i]);
 
        printf("\n\n");
 #else
@@ -106,26 +105,26 @@  int main() {
        
 
    size = 4;
-   vec_uc_result2 = vec_xl_len_r(data_uc, size);
+   vec_uc_result1 = vec_xl_len_r(data_uc, size);
 
-   vec_uc_expected2 = (vector unsigned char){ 4, 3, 2, 1, 0, 0, 0, 0,
+   vec_uc_expected1 = (vector unsigned char){ 4, 3, 2, 1, 0, 0, 0, 0,
                                               0, 0, 0, 0, 0, 0, 0, 0 };
    
-   if (result_wrong (vec_uc_expected2, vec_uc_result2))
+   if (result_wrong (vec_uc_expected1, vec_uc_result1))
      {
 #ifdef DEBUG
        printf("Error: result does not match expected result\n");
-       printf("vec_xl_len_r(%d): vec_uc_expected2[0] to vec_uc_expected2[15]\n",
+       printf("vec_xl_len_r(%d): vec_uc_expected1[0] to vec_uc_expected1[15]\n",
 	    size);
    
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_expected2[i]);
+	 printf(" %d,", vec_uc_expected1[i]);
 
-       printf("\nvec_xl_len_r(%d): vec_uc_result2[0] to vec_uc_result2[15]\n",
+       printf("\nvec_xl_len_r(%d): vec_uc_result1[0] to vec_uc_result1[15]\n",
 	      size);
    
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_result2[i]);
+	 printf(" %d,", vec_uc_result1[i]);
 
        printf("\n\n");
 #else
@@ -134,25 +133,25 @@  int main() {
      }
 
    size = 2;
-   vec_uc_result2 = vec_xl_len_r(data_uc, size);
+   vec_uc_result1 = vec_xl_len_r(data_uc, size);
 
-   vec_uc_expected2 = (vector unsigned char){ 2, 1, 0, 0, 0, 0, 0, 0,
+   vec_uc_expected1 = (vector unsigned char){ 2, 1, 0, 0, 0, 0, 0, 0,
                                               0, 0, 0, 0, 0, 0, 0, 0 };
    
-   if (result_wrong (vec_uc_expected2, vec_uc_result2))
+   if (result_wrong (vec_uc_expected1, vec_uc_result1))
      {
 #ifdef DEBUG
        printf("Error: result does not match expected result\n");
-       printf("vec_xl_len_r(%d): vec_uc_expected2[0] to vec_uc_expected2[15]\n",
+       printf("vec_xl_len_r(%d): vec_uc_expected1[0] to vec_uc_expected1[15]\n",
 	      size);
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_expected2[i]);
+	 printf(" %d,", vec_uc_expected1[i]);
 
-       printf("\nvec_xl_len_r(%d) vec_uc_result2[0] to vec_uc_result2[15]\n",
+       printf("\nvec_xl_len_r(%d) vec_uc_result1[0] to vec_uc_result1[15]\n",
 	      size);
    
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_result2[i]);
+	 printf(" %d,", vec_uc_result1[i]);
 
        printf("\n\n");
 #else
@@ -162,33 +161,33 @@  int main() {
 
 
    /* VEC_XST_LEN */
-   vec_uc_expected2 = (vector unsigned char){ 1, 2, 0, 0, 0, 0, 0, 0,
+   vec_uc_expected1 = (vector unsigned char){ 1, 2, 0, 0, 0, 0, 0, 0,
                                               0, 0, 0, 0, 0, 0, 0, 0 };
    store_data_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
 					   9, 10, 11, 12, 13, 14, 15, 16 };
    size = 2;
 
    for (i=0; i<16; i++)
-     vec_uc_result2[i] = 0;
+     vec_uc_result1[i] = 0;
    
-   address = &vec_uc_result2[0];
+   address = &vec_uc_result1[0];
    vec_xst_len (store_data_uc, address, size);
 
-   if (result_wrong (vec_uc_expected2, vec_uc_result2))
+   if (result_wrong (vec_uc_expected1, vec_uc_result1))
      {
 #ifdef DEBUG
        printf("Error: result does not match expected result\n");
-       printf("vec_xst_len (%d) vec_uc_result2[0] to vec_uc_result2[15]\n",
+       printf("vec_xst_len (%d) vec_uc_result1[0] to vec_uc_result1[15]\n",
 	      size);
 
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_expected2[i]);
+	 printf(" %d,", vec_uc_expected1[i]);
 
        printf("\nvec_xst_len (%d) store_data_uc[0] to store_data_uc[15]\n",
 	      size);
 
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_result2[i]);
+	 printf(" %d,", vec_uc_result1[i]);
 
        printf("\n\n");
 #else
@@ -196,34 +195,34 @@  int main() {
 #endif
      }
 
-   vec_uc_expected2 = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
+   vec_uc_expected1 = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
                                               9, 10, 11, 12, 13, 14, 0, 0 };
    store_data_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
 					   9, 10, 11, 12, 13, 14, 15, 16 };
    size = 14;
 
    for (i=0; i<16; i++)
-     vec_uc_result2[i] = 0;
+     vec_uc_result1[i] = 0;
 
-   address = &vec_uc_result2[0];
+   address = &vec_uc_result1[0];
 
    vec_xst_len (store_data_uc, address, size);
    
-   if (result_wrong (vec_uc_expected2, vec_uc_result2))
+   if (result_wrong (vec_uc_expected1, vec_uc_result1))
      {
 #ifdef DEBUG
        printf("Error: result does not match expected result\n");
-       printf("vec_xst_len (%d) vec_uc_result2[0] to vec_uc_result2[15]\n",
+       printf("vec_xst_len (%d) vec_uc_result1[0] to vec_uc_result1[15]\n",
 	      size);
 
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_expected2[i]);
+	 printf(" %d,", vec_uc_expected1[i]);
 
        printf("\nvec_xst_len (%d) store_data_uc[0] to store_data_uc[15]\n",
 	      size);
 
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_result2[i]);
+	 printf(" %d,", vec_uc_result1[i]);
 
        printf("\n\n");
 #else
@@ -232,6 +231,40 @@  int main() {
      }
 
    /* VEC_XST_LEN_R */
+   vec_uc_expected1 = (vector unsigned char){ 16, 15, 14, 13, 12, 11, 10, 9,
+					      8, 7, 6, 5, 4, 3, 2, 1 };
+   store_data_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
+					   9, 10, 11, 12, 13, 14, 15, 16 };
+   vec_uc_result1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0, 
+					    0, 0, 0, 0, 0, 0, 0, 0 };
+
+   size = 16;
+
+   address = &vec_uc_result1[0];
+
+   vec_xst_len_r(store_data_uc, address, size);
+
+   if (result_wrong (vec_uc_expected1, vec_uc_result1))
+     {
+#ifdef DEBUG
+       printf("Error: result does not match expected result\n");
+       printf("vec_xst_len_r(%d) vec_uc_expected1[0] to vec_uc_expected1[15]\n",
+	      size);
+   
+       for (i=0; i<16; i++)
+	 printf(" %d,", vec_uc_expected1[i]);
+
+       printf("\nvec_xst_len_r(%d) result[0] to result[15]\n", size);
+
+       for (i=0; i<16; i++)
+	 printf(" %d,", vec_uc_result1[i]);
+
+       printf("\n\n");
+#else
+       abort();
+#endif
+     }
+
    vec_uc_expected1 = (vector unsigned char){ 2, 1, 0, 0, 0, 0, 0, 0,
                                               0, 0, 0, 0, 0, 0, 0, 0 };
    store_data_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
@@ -241,9 +274,6 @@  int main() {
 
    size = 2;
 
-   for (i=0; i<16; i++)
-     vec_uc_result1[i] = 0;
-
    address = &vec_uc_result1[0];
 
    vec_xst_len_r(store_data_uc, address, size);
@@ -269,6 +299,39 @@  int main() {
 #endif
      }
 
+   vec_uc_expected1 = (vector unsigned char){ 16, 15, 14, 13, 12, 11, 10, 9,
+                                              8, 7, 6, 5, 4, 3, 2, 1 };
+   store_data_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8,
+					   9, 10, 11, 12, 13, 14, 15, 16 };
+   vec_uc_result1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0, 
+					    0, 0, 0, 0, 0, 0, 0, 0 };
+
+   size = 16;
+
+   address = &vec_uc_result1[0];
+
+   vec_xst_len_r(store_data_uc, address, size);
+
+   if (result_wrong (vec_uc_expected1, vec_uc_result1))
+     {
+#ifdef DEBUG
+       printf("Error: result does not match expected result\n");
+       printf("vec_xst_len_r(%d) vec_uc_expected1[0] to vec_uc_expected1[15]\n",
+	  size);
+   
+       for (i=0; i<16; i++)
+	 printf(" %d,", vec_uc_expected1[i]);
+
+       printf("\nvec_xst_len_r(%d) result[0] to result[15]\n", size);
+
+       for (i=0; i<16; i++)
+	 printf(" %d,", vec_uc_result1[i]);
+
+       printf("\n\n");
+#else
+       abort();
+#endif
+     }
 
    vec_uc_expected1 = (vector unsigned char){ 14, 13, 12, 11, 10, 9, 8, 7,
                                               6, 5, 4, 3, 2, 1, 0, 0 };
@@ -279,9 +342,6 @@  int main() {
 
    size = 14;
 
-   for (i=0; i<16; i++)
-     vec_uc_result1[i] = 0;
-
    address = &vec_uc_result1[0];
 
    vec_xst_len_r(store_data_uc, address, size);
@@ -290,11 +350,11 @@  int main() {
      {
 #ifdef DEBUG
        printf("Error: result does not match expected result\n");
-       printf("vec_xst_len_r(%d) vec_uc_expected2[0] to vec_uc_expected2[15]\n",
+       printf("vec_xst_len_r(%d) vec_uc_expected1[0] to vec_uc_expected1[15]\n",
 	  size);
    
        for (i=0; i<16; i++)
-	 printf(" %d,", vec_uc_expected2[i]);
+	 printf(" %d,", vec_uc_expected1[i]);
 
        printf("\nvec_xst_len_r(%d) result[0] to result[15]\n", size);
 
diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c
index 9319a3727..ed3974abc 100644
--- a/gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c
+++ b/gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c
@@ -7,1040 +7,1463 @@ 
 #include <inttypes.h>
 #include <altivec.h> // vector
 
+#define TRUE 1
+#define FALSE 0
+
 #ifdef DEBUG
 #include <stdio.h>
 #endif
 
 void abort (void);
 
-int main() {
-   vector signed char char_src1, char_src2;
-   vector unsigned char uchar_src1, uchar_src2;
-   vector signed short int short_src1, short_src2;
-   vector unsigned short int ushort_src1, ushort_src2;
-   vector signed int int_src1, int_src2;
-   vector unsigned int uint_src1, uint_src2;
-   unsigned int result, expected_result;
-
-   /* Tests for: vec_first_match_index() */
-   /* char */
-   char_src1 = (vector signed char) {-1, 2, 3, 4, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {-1, 2, 3, 20, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 0;
-
-   result = vec_first_match_index (char_src1, char_src2);
-
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: char first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+int result_wrong_sc (vector signed char vec_expected,
+		     vector signed char vec_actual)
+{
+  int i;
 
-   char_src1 = (vector signed char) {1, 2, 3, 4, 5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {-1, -2, -3, -4, -5, -6, -7, -8,
-				     -9, -10, -11, -12, -13, -14, -15, -16};
-   expected_result = 16;
+  for (i = 0; i < 16; i++)
+    if (vec_expected[i] != vec_actual[i])
+      return TRUE;
 
-   result = vec_first_match_index (char_src1, char_src2);
+  return FALSE;
+}
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: char first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+int result_wrong_uc (vector unsigned char vec_expected,
+		     vector unsigned char vec_actual)
+{
+  int i;
 
-   uchar_src1 = (vector unsigned char) {0, 2, 3, 4, 5, 6, 7, 8,
-					9, 10, 11, 12, 13, 14, 15, 16};
-   uchar_src2 = (vector unsigned char) {1, 0, 3, 4, 5, 6, 7, 8,
-					9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 2;
+  for (i = 0; i < 16; i++)
+    if (vec_expected[i] != vec_actual[i])
+      return TRUE;
 
-   result = vec_first_match_index (uchar_src1, uchar_src2);
+  return FALSE;
+}
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: uchar first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+int result_wrong_us (vector unsigned short vec_expected,
+		     vector unsigned short vec_actual)
+{
+  int i;
 
-   uchar_src1 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					10, 11, 12, 13, 14, 15, 16, 17};
-   uchar_src2 = (vector unsigned char) {3, 4, 5, 6, 7, 8, 9, 10,
-					11, 12, 13, 14, 15, 16, 17, 18};
-   expected_result = 16;
+  for (i = 0; i < 8; i++)
+    if (vec_expected[i] != vec_actual[i])
+      return TRUE;
 
-   result = vec_first_match_index (uchar_src1, uchar_src2);
+  return FALSE;
+}
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: uchar first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+int result_wrong_ss (vector signed short vec_expected,
+		     vector signed short vec_actual)
+{
+  int i;
 
-   /* short int */
-   short_src1 = (vector short int) {10, -20, -30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {-10, 20, 30, 40, 50, 60, 70, 80};
+  for (i = 0; i < 8; i++)
+    if (vec_expected[i] != vec_actual[i])
+      return TRUE;
 
-   expected_result = 3;
+  return FALSE;
+}
 
-   result = vec_first_match_index (short_src1, short_src2);
+int result_wrong_ui (vector unsigned int vec_expected,
+		     vector unsigned int vec_actual)
+{
+  int i;
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: short int first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
+  for (i = 0; i < 4; i++)
+    if (vec_expected[i] != vec_actual[i])
+      return TRUE;
 
-   short_src1 = (vector short int) {10, 20, 30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {0, 0, 0, 0, 0, 0, 0, 0};
+  return FALSE;
+}
 
-   expected_result = 8;
+int result_wrong_ull (vector unsigned long long vec_expected,
+		      vector unsigned long long vec_actual)
+{
+  int i;
 
-   result = vec_first_match_index (short_src1, short_src2);
+  for (i = 0; i < 2; i++)
+    if (vec_expected[i] != vec_actual[i])
+      return TRUE;
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: short int first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+  return FALSE;
+}
 
-   ushort_src1 = (vector short unsigned int) {0, 0, 0, 0, 0, 60, 70, 0};
-   ushort_src2 = (vector short unsigned int) {10, 20, 30, 40, 50, 60, 70, 80};
+int result_wrong_sll (vector signed long long vec_expected,
+		      vector signed long long vec_actual)
+{
+  int i;
 
-   expected_result = 5;
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_expected[i] != vec_actual[i])
+        return TRUE;
+    }
 
-   result = vec_first_match_index (ushort_src1, ushort_src2);
+  return FALSE;
+}
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: ushort int first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+int result_wrong_si (vector signed int vec_expected,
+		     vector signed int vec_actual)
+{
+  int i;
 
-   ushort_src1 = (vector short unsigned int) {-20, 30, -40, 50,
-					      60, -70, 80, -90};
-   ushort_src2 = (vector short unsigned int) {20, -30, 40, -50,
-					      -60, 70, -80, 90};
+  for (i = 0; i < 4; i++)
+    if (vec_expected[i] != vec_actual[i])
+      return TRUE;
 
-   expected_result = 8;
+  return FALSE;
+}
 
-   result = vec_first_match_index (ushort_src1, ushort_src2);
+int result_wrong_u128 (vector __uint128_t vec_expected,
+		       vector __uint128_t vec_actual)
+{
+  int i;
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: ushort int first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+  if (vec_expected[0] != vec_actual[0])
+    return TRUE;
 
-   /* int */
-   int_src1 = (vector int) {1, 2, 3, 4};
-   int_src2 = (vector int) {10, 20, 30, 4};
+  return FALSE;
+}
 
-   expected_result = 3;
+int result_wrong_s128 (vector __int128_t vec_expected,
+		       vector __int128_t vec_actual)
+{
+  int i;
 
-   result = vec_first_match_index (int_src1, int_src2);
+  if (vec_expected[0] != vec_actual[0])
+    return TRUE;
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: int first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+  return FALSE;
+}
+
+int result_wrong_d (vector double vec_expected,
+		    vector double vec_actual)
+{
+  int i;
+
+  for (i = 0; i < 2; i++)
+    if (vec_expected[i] != vec_actual[i])
+      return TRUE;
+
+  return FALSE;
+}
 
-   int_src1 = (vector int) {1, 2, 3, 4};
-   int_src2 = (vector int) {4, 3, 2, 1};
+int result_wrong_f (vector float vec_expected,
+		    vector float vec_actual)
+{
+  int i;
 
-   expected_result = 4;
+  for (i = 0; i < 4; i++)
+    if (vec_expected[i] != vec_actual[i])
+      return TRUE;
 
-   result = vec_first_match_index (int_src1, int_src2);
+  return FALSE;
+}
 
-   if (result != expected_result)
 #ifdef DEBUG
-      printf("Error: int first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+void print_sc (vector signed char vec_expected,
+	       vector signed char vec_actual)
+{
+  int i;
 
-   uint_src1 = (vector unsigned int) {1, 2, 3, 4};
-   uint_src2 = (vector unsigned int) {11, 2, 33, 4};
+  printf("expected signed char data\n");
+  for (i = 0; i < 16; i++)
+    printf(" %d,", vec_expected[i]);
 
-   expected_result = 1;
+  printf("\nactual signed char data\n");
+  for (i = 0; i < 16; i++)
+    printf(" %d,", vec_actual[i]);
+  printf("\n");
+}
 
-   result = vec_first_match_index (uint_src1, uint_src2);
+void print_uc (vector unsigned char vec_expected,
+	       vector unsigned char vec_actual)
+{
+  int i;
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: uint first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+  printf("expected signed char data\n");
+  for (i = 0; i < 16; i++)
+    printf(" %d,", vec_expected[i]);
 
-   uint_src1 = (vector unsigned int) {1, 2, 3, 4};
-   uint_src2 = (vector unsigned int) {2, 3, 4, 5};
+  printf("\nactual signed char data\n");
+  for (i = 0; i < 16; i++)
+    printf(" %d,", vec_actual[i]);
+  printf("\n");
+}
 
-   expected_result = 4;
+void print_us (vector unsigned short vec_expected,
+	       vector unsigned short vec_actual)
+{
+  int i;
 
-   result = vec_first_match_index (uint_src1, uint_src2);
+  printf("expected unsigned short data\n");
+  for (i = 0; i < 8; i++)
+    printf(" %d,", vec_expected[i]);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: uint first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+  printf("\nactual unsigned short data\n");
+  for (i = 0; i < 8; i++)
+    printf(" %d,", vec_actual[i]);
+  printf("\n");
+}
 
-   /* Tests for: vec_first_mismatch_index() */
-   /* char */
-   char_src1 = (vector signed char) {-1, 2, 3, 4, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {-1, 2, 3, 20, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 3;
+void print_ss (vector signed short vec_expected,
+	       vector signed short vec_actual)
+{
+  int i;
 
-   result = vec_first_mismatch_index (char_src1, char_src2);
+  printf("expected signed short data\n");
+  for (i = 0; i < 8; i++)
+    printf(" %d,", vec_expected[i]);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: char first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+  printf("\nactual signed short data\n");
+  for (i = 0; i < 8; i++)
+    printf(" %d,", vec_actual[i]);
+  printf("\n");
+}
 
-   char_src1 = (vector signed char) {1, 2, 3, 4, 5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {1, 2, 3, 4, 5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 16;
+void print_ui (vector unsigned int vec_expected,
+	       vector unsigned int vec_actual)
+{
+  int i;
 
-   result = vec_first_mismatch_index (char_src1, char_src2);
+  printf("expected unsigned int data\n");
+  for (i = 0; i < 4; i++)
+    printf(" %d,", vec_expected[i]);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: char first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
+  printf("\nactual unsigned int data\n");
+  for (i = 0; i < 4; i++)
+    printf(" %d,", vec_actual[i]);
+  printf("\n");
+}
 
-   uchar_src1 = (vector unsigned char) {1, 2, 3, 4, 5, 6, 7, 8,
-					9, 10, 11, 12, 13, 14, 15, 16};
-   uchar_src2 = (vector unsigned char) {1, 0, 3, 4, 5, 6, 7, 8,
-					9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 1;
+void print_si (vector signed int vec_expected,
+	       vector signed int vec_actual)
+{
+  int i;
 
-   result = vec_first_mismatch_index (uchar_src1, uchar_src2);
+  printf("expected signed int data\n");
+  for (i = 0; i < 4; i++)
+    printf(" %d,", vec_expected[i]);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: uchar first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
+  printf("\nactual signed int data\n");
+  for (i = 0; i < 4; i++)
+    printf(" %d,", vec_actual[i]);
+  printf("\n");
+}
+
+void print_ull (vector unsigned long long vec_expected,
+		vector unsigned long long vec_actual)
+{
+  int i;
+
+  printf("expected unsigned long long data\n");
+  for (i = 0; i < 2; i++)
+    printf(" %llu,", vec_expected[i]);
+
+  printf("\nactual unsigned long long data\n");
+  for (i = 0; i < 2; i++)
+    printf(" %llu,", vec_actual[i]);
+  printf("\n");
+}
+
+void print_sll (vector signed long long vec_expected,
+		vector signed long long vec_actual)
+{
+  int i;
+
+  printf("expected signed long long data\n");
+  for (i = 0; i < 2; i++)
+    printf(" %lld,", vec_expected[i]);
+
+  printf("\nactual signed long long data\n");
+  for (i = 0; i < 2; i++)
+    printf(" %lld,", vec_actual[i]);
+  printf("\n");
+}
+
+void print_u128 (vector __uint128_t vec_expected,
+		 vector __uint128_t vec_actual)
+{
+  printf("expected uint128 data\n");
+  printf(" %llu%llu\n", (unsigned long long)(vec_expected[0] >> 64),
+	 (unsigned long long)(vec_expected[0] & 0xFFFFFFFFFFFFFFFF));
+
+  printf("\nactual uint128 data\n");
+  printf(" %llu%llu\n", (unsigned long long)(vec_actual[0] >> 64),
+	 (unsigned long long)(vec_actual[0] & 0xFFFFFFFFFFFFFFFF));
+}
+
+void print_s128 (vector __int128 vec_expected,
+		 vector __int128 vec_actual)
+{
+  printf("expected int128 data\n");
+  printf(" %lld%llu\n", (signed long long)(vec_expected[0] >> 64),
+	 (unsigned long long)(vec_expected[0] & 0xFFFFFFFFFFFFFFFF));
+
+  printf("\nactual int128 data\n");
+  printf(" %lld%llu\n", (signed long long)(vec_actual[0] >> 64),
+	 (unsigned long long)(vec_actual[0] & 0xFFFFFFFFFFFFFFFF));
+}
+
+void print_d (vector double vec_expected,
+	      vector double vec_actual)
+{
+  int i;
+
+  printf("expected double data\n");
+  for (i = 0; i < 2; i++)
+    printf(" %f,", vec_expected[i]);
+
+  printf("\nactual double data\n");
+  for (i = 0; i < 2; i++)
+    printf(" %f,", vec_actual[i]);
+  printf("\n");
+}
+
+void print_f (vector float vec_expected,
+	      vector float vec_actual)
+{
+  int i;
+
+  printf("expected float data\n");
+  for (i = 0; i < 4; i++)
+    printf(" %f,", vec_expected[i]);
+
+  printf("\nactual float data\n");
+  for (i = 0; i < 4; i++)
+    printf(" %f,", vec_actual[i]);
+  printf("\n");
+}
 #endif
 
-   uchar_src1 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					10, 11, 12, 13, 14, 15, 16};
-   uchar_src2 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					0, 11, 12, 13, 14, 15, 16};
-   expected_result = 8;
+int main() {
+  int i, j;
+  size_t len;
+  signed char data_c[100];
+  vector signed char input_c;
+  unsigned char data_uc[100];
+  vector unsigned char input_uc;
+
+  signed short int data_ssi[100];
+  vector signed short int input_ssi;
+  unsigned short int data_usi[100];
+  vector unsigned short int input_usi;
+
+  signed int data_si[100];
+  vector signed int input_si;
+  unsigned int data_ui[100];
+  vector unsigned int input_ui;
+
+  signed long long data_sll[100];
+  vector signed long long  input_sll;
+  unsigned long long data_ull[100];
+  vector unsigned long long int input_ull;
+
+  float data_f[100];
+  vector float input_f;
+  double data_d[100];
+  vector double input_d;
+  __uint128_t data_u128[100];
+  vector __uint128_t input_u128;
+  __int128_t data_128[100];
+  vector __int128_t input_128;
+
+  vector signed char store_data_sc;
+  vector unsigned char store_data_uc;
+  vector signed int store_data_si;
+  vector unsigned int store_data_ui;
+  vector __int128_t store_data_s128;
+  vector __uint128_t store_data_u128;
+  vector signed long long int store_data_sll;
+  vector unsigned long long int store_data_ull;
+  vector signed short store_data_ss;
+  vector unsigned short store_data_us;
+  vector double store_data_d;
+  vector float store_data_f;
+
+  signed char *address_sc;
+  unsigned char *address_uc;
+  signed int *address_si;
+  unsigned int *address_ui;
+  __int128_t *address_s128;
+  __uint128_t *address_u128;
+  signed long long int *address_sll;
+  unsigned long long int *address_ull;
+  signed short int *address_ss;
+  unsigned short int *address_us;
+  double *address_d;
+  float *address_f;
+
+  vector unsigned char *datap;
+
+  vector unsigned char vec_uc_expected1, vec_uc_result1;
+  vector signed char vec_sc_expected1, vec_sc_result1;
+  vector signed int vec_si_expected1, vec_si_result1;
+  vector unsigned int vec_ui_expected1, vec_ui_result1;
+  vector __int128_t vec_s128_expected1, vec_s128_result1;
+  vector __uint128_t vec_u128_expected1, vec_u128_result1;
+  vector signed long long int vec_sll_expected1, vec_sll_result1;
+  vector unsigned long long int vec_ull_expected1, vec_ull_result1;
+  vector signed short int vec_ss_expected1, vec_ss_result1;
+  vector unsigned short int vec_us_expected1, vec_us_result1;
+  vector double vec_d_expected1, vec_d_result1;
+  vector float vec_f_expected1, vec_f_result1;
+
+  signed long long disp;
+
+  /* VEC_XST_LEN, ISA 3.0 */
+  len = 16;
+  vec_sc_expected1 = (vector signed char){ -7, -6, -5, -4, -3, -2, -1, 0,
+					   1, 2, 3, 4, 5, 6, 7, 8 };
+  store_data_sc = (vector signed char){ -7, -6, -5, -4, -3, -2, -1, 0,
+					1, 2, 3, 4, 5, 6, 7, 8 };
+  vec_sc_result1 = (vector signed char){ 0, 0, 0, 0, 0, 0, 0, 0,
+                                         0, 0, 0, 0, 0, 0, 0, 0 };
 
-   result = vec_first_mismatch_index (uchar_src1, uchar_src2);
+  address_sc = &vec_sc_result1[0];
+
+  vec_xst_len (store_data_sc, address_sc, len);
 
-   if (result != expected_result)
+  if (result_wrong_sc (vec_sc_expected1, vec_sc_result1))
+    {
 #ifdef DEBUG
-      printf("Error: uchar first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, sc result does not match expected result\n", len);
+       print_sc (vec_sc_expected1, vec_sc_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
+  
+  len = 12;
+  vec_sc_expected1 = (vector signed char){ -7, -6, -5, -4, -3, -2, -1, 0,
+					   1, 2, 3, 4, 0, 0, 0, 0 };
+  store_data_sc = (vector signed char){ -7, -6, -5, -4, -3, -2, -1, 0,
+					1, 2, 3, 4, 5, 6, 7, 8 };
+  vec_sc_result1 = (vector signed char){ 0, 0, 0, 0, 0, 0, 0, 0,
+                                         0, 0, 0, 0, 0, 0, 0, 0 };
 
-   uchar_src1 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					10, 11, 12, 13, 14, 15, 16};
-   uchar_src2 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					10, 11, 12, 13, 14, 15, 16};
-   expected_result = 16;
+  address_sc = &vec_sc_result1[0];
 
-   result = vec_first_mismatch_index (uchar_src1, uchar_src2);
+  vec_xst_len (store_data_sc, address_sc, len);
 
-   if (result != expected_result)
+  if (result_wrong_sc (vec_sc_expected1, vec_sc_result1))
+    {
 #ifdef DEBUG
-      printf("Error: uchar first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, sc result does not match expected result\n",
+	      len);
+       print_sc (vec_sc_expected1, vec_sc_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
+
+  len = 16;
+  vec_uc_expected1 = (vector unsigned char){ 0, 1, 2, 3, 4, 5, 6, 7,
+					     8, 9, 10, 11, 12, 13, 14, 15 };
 
-   /* short int */
-   short_src1 = (vector short int) {-10, -20, 30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {-10, 20, 30, 40, 50, 60, 70, 80};
+  store_data_uc = (vector unsigned char){ 0, 1, 2, 3, 4, 5, 6, 7,
+					  8, 9, 10, 11, 12, 13, 14, 15 };
 
-   expected_result = 1;
+  vec_uc_result1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0,
+					   0, 0, 0, 0, 0, 0, 0, 0 };
 
-   result = vec_first_mismatch_index (short_src1, short_src2);
+  address_uc = &vec_uc_result1[0];
 
-   if (result != expected_result)
+  vec_xst_len (store_data_uc, address_uc, len);
+
+  if (result_wrong_uc (vec_uc_expected1, vec_uc_result1))
+    {
 #ifdef DEBUG
-      printf("Error: short int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+      printf("Error: vec_xst_len, len = %d, uc result does not match expected result\n",
+	     len);
+      print_uc (vec_uc_expected1, vec_uc_result1);
 #else
       abort();
 #endif
+    }
 
-   short_src1 = (vector short int) {10, 20, 30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {10, 20, 30, 40, 50, 60, 70, 80};
+  len = 4;
+  vec_uc_expected1 = (vector unsigned char){ 0, 1, 2, 3, 0, 0, 0, 0,
+					     0, 0, 0, 0, 0, 0, 0, 0 };
+  store_data_uc = (vector unsigned char){ 0, 1, 2, 3, 4, 5, 6, 7,
+					  8, 9, 10, 11, 12, 13, 14, 15 };
+  vec_uc_result1 = (vector unsigned char){ 0, 0, 0, 0, 0, 0, 0, 0,
+					   0, 0, 0, 0, 0, 0, 0, 0 };
 
-   expected_result = 8;
+  address_uc = &vec_uc_result1[0];
 
-   result = vec_first_mismatch_index (short_src1, short_src2);
+  vec_xst_len (store_data_uc, address_uc, len);
 
-   if (result != expected_result)
+  if (result_wrong_uc (vec_uc_expected1, vec_uc_result1))
+    {
 #ifdef DEBUG
-      printf("Error: short int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+      printf("Error: vec_xst_len, len = %d, uc result does not match expected result\n",
+	      len);
+      print_uc (vec_uc_expected1, vec_uc_result1);
 #else
       abort();
 #endif
+    }
 
-   ushort_src1 = (vector short unsigned int) {10, 20, 30, 40, 50, 60, 70, 0};
-   ushort_src2 = (vector short unsigned int) {10, 20, 30, 40, 50, 60, 70, 80};
+  len = 16;
+  vec_ss_expected1 = (vector signed short int){ 10, 20, 30, 40,
+						50, 60, 70, 80 };
+  store_data_ss = (vector signed short int){ 10, 20, 30, 40,
+					     50, 60, 70, 80 };
+  vec_ss_result1 = (vector signed short int){ 0, 0, 0, 0, 0, 0, 0, 0};
 
-   expected_result = 7;
+  address_ss = &vec_ss_result1[0];
 
-   result = vec_first_mismatch_index (ushort_src1, ushort_src2);
+  vec_xst_len (store_data_ss, address_ss, len);
 
-   if (result != expected_result)
+  if (result_wrong_ss (vec_ss_expected1, vec_ss_result1))
+    {
 #ifdef DEBUG
-      printf("Error: ushort int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, ss result does not match expected result\n",
+	      len);
+       print_ss (vec_ss_expected1, vec_ss_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   ushort_src1 = (vector short unsigned int) {20, 30, 40, 50, 60, 70, 80, 90};
-   ushort_src2 = (vector short unsigned int) {20, 30, 40, 50, 60, 70, 80, 90};
+  len = 14;
+  vec_ss_expected1 = (vector signed short int){ 10, 20, 30, 40,
+						50, 60, 70, 0 };
+  store_data_ss = (vector signed short int){ 10, 20, 30, 40,
+					     50, 60, 70, 80 };
+  vec_ss_result1 = (vector signed short int){ 0, 0, 0, 0, 0, 0, 0, 0};
 
-   expected_result = 8;
+  address_ss = &vec_ss_result1[0];
 
-   result = vec_first_mismatch_index (ushort_src1, ushort_src2);
+  vec_xst_len (store_data_ss, address_ss, len);
 
-   if (result != expected_result)
+  if (result_wrong_ss (vec_ss_expected1, vec_ss_result1))
+    {
 #ifdef DEBUG
-      printf("Error: ushort int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, ss result does not match expected result\n",
+	      len);
+       print_ss (vec_ss_expected1, vec_ss_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   /* int */
-   int_src1 = (vector int) {1, 2, 3, 4};
-   int_src2 = (vector int) {1, 20, 3, 4};
+  len = 16;
+  vec_us_expected1 = (vector unsigned short int){ 10, 20, 30, 40,
+						  50, 60, 70, 80 };
+  store_data_us = (vector unsigned short int){ 10, 20, 30, 40,
+					       50, 60, 70, 80 };
+  vec_us_result1 = (vector unsigned short int){ 0, 0, 0, 0, 0, 0, 0, 0};
 
-   expected_result = 1;
+  address_us = &vec_us_result1[0];
 
-   result = vec_first_mismatch_index (int_src1, int_src2);
+  vec_xst_len (store_data_us, address_us, len);
 
-   if (result != expected_result)
+  if (result_wrong_us (vec_us_expected1, vec_us_result1))
+    {
 #ifdef DEBUG
-      printf("Error: int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, us result does not match expected result\n",
+	      len);
+       print_us (vec_us_expected1, vec_us_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   int_src1 = (vector int) {1, 2, 3, 4};
-   int_src2 = (vector int) {1, 2, 3, 4};
+  len = 2;
+  vec_us_expected1 = (vector unsigned short int){ 10, 0, 0, 0,
+						  0, 0, 0, 0 };
+  store_data_us = (vector unsigned short int){ 10, 20, 30, 40,
+					       50, 60, 70, 80 };
+  vec_us_result1 = (vector unsigned short int){ 0, 0, 0, 0, 0, 0, 0, 0};
 
-   expected_result = 4;
+  address_us = &vec_us_result1[0];
 
-   result = vec_first_mismatch_index (int_src1, int_src2);
+  vec_xst_len (store_data_us, address_us, len);
 
-   if (result != expected_result)
+  if (result_wrong_us (vec_us_expected1, vec_us_result1))
+    {
 #ifdef DEBUG
-      printf("Error: int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, us result does not match expected result\n",
+	      len);
+       print_us (vec_us_expected1, vec_us_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   int_src1 = (vector int) {1, 0, 3, 4};
-   int_src2 = (vector int) {1, 2, 3, 4};
+  len = 16;
+  vec_si_expected1 = (vector signed int){ -30, -10, 0, 10 };
+  store_data_si = (vector signed int){ -30, -10, 0, 10 };
+  vec_si_result1 = (vector signed int){ 0, 0, 0, 0};
 
-   expected_result = 1;
+  address_si = &vec_si_result1[0];
 
-   result = vec_first_mismatch_index (int_src1, int_src2);
+  vec_xst_len (store_data_si, address_si, len);
 
-   if (result != expected_result)
+  if (result_wrong_si (vec_si_expected1, vec_si_result1))
+    {
 #ifdef DEBUG
-      printf("Error: int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, si result does not match expected result\n",
+	      len);
+       print_si (vec_si_expected1, vec_si_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   uint_src1 = (vector unsigned int) {1, 2, 3, 4};
-   uint_src2 = (vector unsigned int) {11, 2, 33, 4};
+  len = 8;
+  vec_si_expected1 = (vector signed int){ -30, -10, 0, 0 };
+  store_data_si = (vector signed int){ -30, -10, 0, 10 };
+  vec_si_result1 = (vector signed int){ 0, 0, 0, 0};
 
-   expected_result = 0;
+  address_si = &vec_si_result1[0];
 
-   result = vec_first_mismatch_index (uint_src1, uint_src2);
+  vec_xst_len (store_data_si, address_si, len);
 
-   if (result != expected_result)
+  if (result_wrong_si (vec_si_expected1, vec_si_result1))
+    {
 #ifdef DEBUG
-      printf("Error: uint first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, si result does not match expected result\n",
+	      len);
+       print_si (vec_si_expected1, vec_si_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   uint_src1 = (vector unsigned int) {1, 2, 3, 4};
-   uint_src2 = (vector unsigned int) {1, 2, 3, 4};
+  len = 16;
+  vec_sll_expected1 = (vector signed long long int){ -3000, 10000 };
+  store_data_sll = (vector signed long long int){ -3000, 10000 };
+  vec_sll_result1 = (vector signed long long int){ 0, 0};
 
-   expected_result = 4;
+  address_sll = (signed long long *)&vec_sll_result1[0];
 
-   result = vec_first_mismatch_index (uint_src1, uint_src2);
+  vec_xst_len (store_data_sll, address_sll, len);
 
-   if (result != expected_result)
+  if (result_wrong_sll (vec_sll_expected1, vec_sll_result1) == TRUE)
+    {
 #ifdef DEBUG
-      printf("Error: uint first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, sll result does not match expected result\n",
+	      len);
+       print_sll (vec_sll_expected1, vec_sll_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
+
+  len = 8;
+  vec_sll_expected1 = (vector signed long long int){ -3000, 0 };
+  store_data_sll = (vector signed long long int){ -3000, 10000 };
+  vec_sll_result1 = (vector signed long long int){ 0, 0};
 
-   /* Tests for: vec_first_match_or_eos_index() */
-   /* char */
-   char_src1 = (vector signed char) {-1, 2, 3, 4, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {-1, 2, 3, 20, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 0;
+  address_sll = (signed long long *)&vec_sll_result1[0];
 
-   result = vec_first_match_or_eos_index (char_src1, char_src2);
+  vec_xst_len (store_data_sll, address_sll, len);
 
-   if (result != expected_result)
+  if (result_wrong_sll (vec_sll_expected1, vec_sll_result1))
+    {
 #ifdef DEBUG
-      printf("Error: char first match result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, sll result does not match expected result\n",
+	      len);
+       print_sll (vec_sll_expected1, vec_sll_result1);
 #else
       abort();
 #endif
+    }
+
+  len = 16;
+  vec_ull_expected1 = (vector unsigned long long int){ 50000, 120000 };
+  store_data_ull = (vector unsigned long long int){ 50000, 120000 };
+  vec_ull_result1 = (vector unsigned long long int){ 0, 0};
 
-   char_src1 = (vector signed char) {-1, 2, 3, 0, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {2, 3, 20, 0, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 3;
+  address_ull = (unsigned long long *) &vec_ull_result1[0];
 
-   result = vec_first_match_or_eos_index (char_src1, char_src2);
+  vec_xst_len (store_data_ull, address_ull, len);
 
-   if (result != expected_result)
+  if (result_wrong_ull (vec_ull_expected1, vec_ull_result1))
+    {
 #ifdef DEBUG
-      printf("Error: char first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, ull result does not match expected result\n",
+	      len);
+       print_ull (vec_ull_expected1, vec_ull_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
+
+  len = 8;
+  vec_ull_expected1 = (vector unsigned long long int){ 50000, 0 };
+  store_data_ull = (vector unsigned long long int){ 50000, 120000 };
+  vec_ull_result1 = (vector unsigned long long int){ 0, 0};
 
-  char_src1 = (vector signed char) {1, 2, 3, 4, 5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {-1, -2, -3, -4, -5, -6, -7, -8,
-				     -9, -10, -11, -12, -13, -14, -15, -16};
-   expected_result = 16;
+  address_ull = (unsigned long long *) &vec_ull_result1[0];
 
-   result = vec_first_match_or_eos_index (char_src1, char_src2);
+  vec_xst_len (store_data_ull, address_ull, len);
 
-   if (result != expected_result)
+  if (result_wrong_ull (vec_ull_expected1, vec_ull_result1))
+    {
 #ifdef DEBUG
-      printf("Error: char first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, ull result does not match expected result\n",
+	      len);
+       print_ull (vec_ull_expected1, vec_ull_result1);
 #else
-      abort();
-#endif
+       abort();
 #endif
+    }
 
-   uchar_src1 = (vector unsigned char) {1, 2, 3, 4, 5, 6, 7, 8,
-					9, 10, 11, 12, 13, 14, 15, 16};
-   uchar_src2 = (vector unsigned char) {-1, 0, -3, -4, -5, -6, -7, -8,
-					9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 1;
+  len = 16;
+  vec_s128_expected1 = (vector __int128_t){ 12345 };
+  store_data_s128 = (vector __int128_t){ 12345 };
 
-   result = vec_first_match_or_eos_index (uchar_src1, uchar_src2);
+  vec_s128_result1[0] = 0;
 
-   if (result != expected_result)
+  address_s128 = (__int128_t *)(&vec_s128_result1[0]);
+
+  vec_xst_len (store_data_s128, address_s128, len);
+
+  if (result_wrong_s128 (vec_s128_expected1, vec_s128_result1))
 #ifdef DEBUG
-      printf("Error: uchar first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+    {
+       printf("Error: vec_xst_len, len = %d, s128, result does not match expected result\n",
+	      len);
+       print_s128 (vec_s128_expected1, vec_s128_result1);
+    }
 #else
-      abort();
+    abort();
 #endif
 
-   uchar_src1 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					10, 11, 12, 13, 14, 15, 16, 17};
-   uchar_src2 = (vector unsigned char) {3, 4, 5, 6, 7, 8, 9, 10,
-					11, 12, 13, 14, 15, 16, 17, 18};
-   expected_result = 16;
+  len = 16;
+  vec_u128_expected1 = (vector __uint128_t){ 12345 };
+  store_data_u128 = (vector __uint128_t){ 12345 };
+
+  vec_u128_result1[0] = 0;
 
-   result = vec_first_match_or_eos_index (uchar_src1, uchar_src2);
+  address_u128 = (__int128_t *)(&vec_u128_result1[0]);
 
-   if (result != expected_result)
+  vec_xst_len (store_data_u128, address_u128, len);
+
+  if (result_wrong_u128 (vec_u128_expected1, vec_u128_result1))
+    {
 #ifdef DEBUG
-      printf("Error: uchar first match or EOS  result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+      printf("Error: vec_xst_len, len = %d, u128, result does not match expected result\n", len);
+      print_u128 (vec_u128_expected1, vec_u128_result1);
 #else
       abort();
 #endif
+    }
 
-   /* short int */
-   short_src1 = (vector short int) {10, -20, -30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {-10, 20, 30, 40, 50, 60, 70, 80};
+  len = 16;
+  vec_d_expected1 = (vector double){ 1., 2. };
+  store_data_d = (vector double){ 1., 2. };
+  vec_d_result1 = (vector double){ 0., 0. };
 
-   expected_result = 3;
+  address_d = (double *)(&vec_d_result1[0]);
 
-   result = vec_first_match_or_eos_index (short_src1, short_src2);
+  vec_xst_len (store_data_d, address_d, len);
 
-   if (result != expected_result)
+  if (result_wrong_d (vec_d_expected1, vec_d_result1))
+    {
 #ifdef DEBUG
-      printf("Error: short int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, double, result does not match expected result\n",
+	      len);
+       print_d (vec_d_expected1, vec_d_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   short_src1 = (vector short int) {1, 20, 30, 40, 50, 60, 70, 80};
+  len = 8;
+  vec_d_expected1 = (vector double){ 1., 0. };
+  store_data_d = (vector double){ 1., 2. };
+  vec_d_result1 = (vector double){ 0., 0. };
 
-   short_src2 = (vector short int) {10, 0, 30, 40, 50, 60, 70, 80};
+  address_d = (double *)(&vec_d_result1[0]);
 
-   expected_result = 1;
+  vec_xst_len (store_data_d, address_d, len);
 
-   result = vec_first_match_or_eos_index (short_src1, short_src2);
-
-   if (result != expected_result)
+  if (result_wrong_d (vec_d_expected1, vec_d_result1))
+    {
 #ifdef DEBUG
-      printf("Error: short int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, double, result does not match expected result\n",
+	      len);
+       print_d (vec_d_expected1, vec_d_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   short_src1 = (vector short int) {-10, -20, -30, -40, -50, -60, -70, -80};
+  len = 16;
+  vec_f_expected1 = (vector float){ 1., 2., 3., 4. };
+  store_data_f = (vector float){ 1., 2., 3., 4. };
+  vec_f_result1 = (vector float){ 0., 0., 0., 0. };
 
-   short_src2 = (vector short int) {10, 20, 30, 40, 50, 0, 70, 80};
+  address_f = (float *)(&vec_f_result1[0]);
 
-   expected_result = 5;
+  vec_xst_len (store_data_f, address_f, len);
 
-   result = vec_first_match_or_eos_index (short_src1, short_src2);
-
-   if (result != expected_result)
+  if (result_wrong_f (vec_f_expected1, vec_f_result1))
+    {
 #ifdef DEBUG
-      printf("Error: short int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, float, result does not match expected result\n",
+	      len);
+       print_f (vec_f_expected1, vec_f_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   short_src1 = (vector short int) {10, 20, 30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {0, 0, 0, 0, 0, 0, 0, 0};
+  len = 4;
+  vec_f_expected1 = (vector float){ 1., 0., 0., 0. };
+  store_data_f = (vector float){ 1., 2., 3., 4. };
+  vec_f_result1 = (vector float){ 0., 0., 0., 0. };
 
-   expected_result = 0;
+  address_f = (float *)(&vec_f_result1[0]);
 
-   result = vec_first_match_or_eos_index (short_src1, short_src2);
+  vec_xst_len (store_data_f, address_f, len);
 
-   if (result != expected_result)
+  if (result_wrong_f (vec_f_expected1, vec_f_result1))
+    {
 #ifdef DEBUG
-      printf("Error: short int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+       printf("Error: vec_xst_len, len = %d, float, result does not match expected result\n",
+	      len);
+       print_f (vec_f_expected1, vec_f_result1);
 #else
-      abort();
+       abort();
 #endif
+    }
 
-   ushort_src1 = (vector short unsigned int) {1, 2, 0, 0, 60, 70, 0};
-   ushort_src2 = (vector short unsigned int) {10, 20, 30, 40, 50, 60, 70, 80};
+  /* vec_xl_len() tests */
+  for (i = 0; i < 100; i++)
+    {
+      data_c[i] = i;
+      data_uc[i] = i+1;
+      data_ssi[i] = i+10;
+      data_usi[i] = i+11;
+      data_si[i] = i+100;
+      data_ui[i] = i+101;
+      data_sll[i] = i+1000;
+      data_ull[i] = i+1001;
+      data_f[i] = i+100000.0;
+      data_d[i] = i+1000000.0;
+      data_128[i] = i + 12800000;
+      data_u128[i] = i + 12800001;
+    }
 
-   expected_result = 2;
+  len = 16;
+  vec_sc_expected1 = (vector signed char){0, 1, 2, 3, 4, 5, 6, 7,
+					  8, 9, 10, 11, 12, 13, 14, 15};
+  vec_sc_result1 = vec_xl_len (data_c, len);
 
-   result = vec_first_match_or_eos_index (ushort_src1, ushort_src2);
-
-   if (result != expected_result)
+  for (i = 0; i < 16; i++)
+    {
+      if (vec_sc_result1[i] != vec_sc_expected1[i])
 #ifdef DEBUG
-      printf("Error: ushort int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_sc_result1[%d] = %d; vec_sc_expected1[%d] = %d\n",
+	       len, i,  vec_sc_result1[i], i, vec_sc_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   ushort_src1 = (vector short unsigned int) {-20, 30, -40, 50,
-					      60, -70, 80, -90};
-   ushort_src2 = (vector short unsigned int) {20, -30, 40, -50,
-					      -60, 70, -80, 90};
+  len = 12;
 
-   expected_result = 8;
+  vec_sc_expected1 = (vector signed char){0, 1, 2, 3, 4, 5, 6, 7,
+					  8, 9, 10, 11, 0, 0, 0, 0};
+  vec_sc_result1 = vec_xl_len (data_c, len);
 
-   result = vec_first_match_or_eos_index (ushort_src1, ushort_src2);
-
-   if (result != expected_result)
+  for (i = 0; i < 16; i++)
+    {
+      if (vec_sc_result1[i] != vec_sc_expected1[i])
 #ifdef DEBUG
-      printf("Error: ushort int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_sc_result1[%d] = %d; vec_sc_expected1[%d] = %d\n",
+	       len, i,  vec_sc_result1[i], i, vec_sc_expected1[i]);
 #else
-      abort();
+        abort ();
 #endif
-   ushort_src1 = (vector short unsigned int) {-20, 30, -40, 50,
-					      60, -70, 80, 0};
+    }
 
-   ushort_src2 = (vector short unsigned int) {20, -30, 40, -50,
-					      -60, 70, -80, 90};
+  len = 16;
+  vec_uc_expected1 = (vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8, 9,
+					    10, 11, 12, 13, 14, 15, 16};
+  vec_uc_result1 = vec_xl_len (data_uc, len);
 
-   expected_result = 7;
+  for (i = 0; i < 16; i++)
+    {
+      if (vec_uc_result1[i] != vec_uc_expected1[i])
+#ifdef DEBUG
+	printf("Error: vec_xl_len(), len = %d, vec_uc_result1[%d] = %d; vec_uc_expected1[%d] = %d\n",
+	       len, i,  vec_uc_result1[i], i, vec_uc_expected1[i]);
+#else
+	abort ();
+#endif
+    }
 
-   result = vec_first_match_or_eos_index (ushort_src1, ushort_src2);
+  len = 12;
+  vec_uc_expected1 = (vector unsigned char){1, 2, 3, 4, 5, 6, 7, 8, 9,
+					    10, 11, 12, 0, 0, 0, 0};
+  vec_uc_result1 = vec_xl_len (data_uc, len);
 
-   if (result != expected_result)
+  for (i = 0; i < 16; i++)
+    {
+      if (vec_uc_result1[i] != vec_uc_expected1[i])
 #ifdef DEBUG
-      printf("Error: ushort int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_uc_result1[%d] = %d; vec_uc_expected1[%d] = %d\n",
+	       len, i,  vec_uc_result1[i], i, vec_uc_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   /* int */
-   int_src1 = (vector int) {1, 2, 3, 4};
-   int_src2 = (vector int) {10, 20, 30, 4};
-
-   expected_result = 3;
+  len = 16;
+  vec_ss_expected1 = (vector signed short){10, 11, 12, 13, 14, 15, 16, 17};
 
-   result = vec_first_match_or_eos_index (int_src1, int_src2);
+  vec_ss_result1 = vec_xl_len (data_ssi, len);
 
-   if (result != expected_result)
+  for (i = 0; i < 8; i++)
+    {
+      if (vec_ss_result1[i] != vec_ss_expected1[i])
 #ifdef DEBUG
-      printf("Error: int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_ss_result1[%d] = %d; vec_ss_expected1[%d] = %d\n",
+	       len, i,  vec_ss_result1[i], i, vec_ss_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   int_src1 = (vector int) {0, 2, 3, 4};
-   int_src2 = (vector int) {4, 3, 2, 1};
-
-   expected_result = 0;
+  len = 8;
+  vec_ss_expected1 = (vector signed short){10, 11, 12, 13, 0, 0, 0, 0};
 
-   result = vec_first_match_or_eos_index (int_src1, int_src2);
+  vec_ss_result1 = vec_xl_len (data_ssi, len);
 
-   if (result != expected_result)
+  for (i = 0; i < 8; i++)
+    {
+      if (vec_ss_result1[i] != vec_ss_expected1[i])
 #ifdef DEBUG
-      printf("Error: int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_ss_result1[%d] = %d; vec_ss_expected1[%d] = %d\n",
+	       len, i,  vec_ss_result1[i], i, vec_ss_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
+  len = 16;
+  vec_us_expected1 = (vector unsigned short){11, 12, 13, 14, 15, 16, 17, 18};
+  vec_us_result1 = vec_xl_len (data_usi, len);
 
-   int_src1 = (vector int) {1, 2, 3, 4};
-   int_src2 = (vector int) {4, 3, 2, 1};
+  for (i = 0; i < 8; i++)
+    {
+      if (vec_us_result1[i] != vec_us_expected1[i])
+#ifdef DEBUG
+	printf("Error: vec_xl_len(), len = %d, vec_us_result1[%d] = %d; vec_us_expected1[%d] = %d\n",
+	       len, i,  vec_us_result1[i], i, vec_us_expected1[i]);
+#else
+	abort ();
+#endif
 
-   expected_result = 4;
+    }
 
-   result = vec_first_match_or_eos_index (int_src1, int_src2);
+  len = 8;
+  vec_us_expected1 = (vector unsigned short){11, 12, 13, 14, 0, 0, 0, 0};
+  vec_us_result1 = vec_xl_len (data_usi, len);
 
-   if (result != expected_result)
+  for (i = 0; i < 8; i++)
+    {
+      if (vec_us_result1[i] != vec_us_expected1[i])
 #ifdef DEBUG
-      printf("Error: int first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_us_result1[%d] = %d; vec_us_expected1[%d] = %d\n",
+	       len, i,  vec_us_result1[i], i, vec_us_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   uint_src1 = (vector unsigned int) {1, 2, 3, 4};
-   uint_src2 = (vector unsigned int) {11, 2, 33, 4};
+  len = 16;
+  vec_si_result1 = vec_xl_len (data_si, len);
+  vec_si_expected1 = (vector int){100, 101, 102, 103};
 
-   expected_result = 1;
+  for (i = 0; i < 4; i++)
+    {
+      if (vec_si_result1[i] != vec_si_expected1[i])
+#ifdef DEBUG
+	printf("Error: vec_xl_len(), len = %d, vec_si_result1[%d] = %d; vec_si_expected1[%d] = %d\n",
+	       len, i,  vec_si_result1[i], i, vec_si_expected1[i]);
+#else
+	abort ();
+#endif
+    }
 
-   result = vec_first_match_or_eos_index (uint_src1, uint_src2);
+  len = 8;
+  vec_si_result1 = vec_xl_len (data_si, len);
+  vec_si_expected1 = (vector int){100, 101, 0, 0};
 
-   if (result != expected_result)
+  for (i = 0; i < 4; i++)
+    {
+      if (vec_si_result1[i] != vec_si_expected1[i])
 #ifdef DEBUG
-      printf("Error: uint first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_si_result1[%d] = %d; vec_si_expected1[%d] = %d\n",
+	       len, i,  vec_si_result1[i], i, vec_si_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   uint_src1 = (vector unsigned int) {1, 2, 0, 4};
-   uint_src2 = (vector unsigned int) {2, 3, 4, 5};
+  len = 16;
+  vec_ui_result1 = vec_xl_len (data_ui, len);
+  vec_ui_expected1 = (vector unsigned int){101, 102, 103, 104};
 
-   expected_result = 2;
+  for (i = 0; i < 4; i++)
+    {
+      if (vec_ui_result1[i] != vec_ui_expected1[i])
+#ifdef DEBUG
+	printf("Error: vec_xl_len(), len = %d, vec_ui_result1[%d] = %d; vec_ui_expected1[%d] = %d\n",
+	       len, i,  vec_ui_result1[i], i, vec_ui_expected1[i]);
+#else
+	abort ();
+#endif
+    }
 
-   result = vec_first_match_or_eos_index (uint_src1, uint_src2);
+  len = 8;
+  vec_ui_result1 = vec_xl_len (data_ui, len);
+  vec_ui_expected1 = (vector unsigned int){101, 102, 0, 0};
 
-   if (result != expected_result)
+  for (i = 0; i < 4; i++)
+    {
+      if (vec_ui_result1[i] != vec_ui_expected1[i])
 #ifdef DEBUG
-      printf("Error: uint first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_ui_result1[%d] = %d; vec_ui_expected1[%d] = %d\n",
+	       len, i,  vec_ui_result1[i], i, vec_ui_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   uint_src1 = (vector unsigned int) {1, 2, 3, 4};
-   uint_src2 = (vector unsigned int) {2, 3, 4, 5};
+  len = 16;
+  vec_sll_result1 = vec_xl_len (data_sll, len);
+  vec_sll_expected1 = (vector signed long long){1000, 1001};
 
-   expected_result = 4;
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_sll_result1[i] != vec_sll_expected1[i])
+#ifdef DEBUG
+	printf("Error: vec_xl_len(), len = %d, vec_sll_result1[%d] = %lld; vec_sll_expected1[%d] = %lld\n",
+	       len, i,  vec_sll_result1[i], i, vec_sll_expected1[i]);
+#else
+	abort ();
+#endif
+    }
 
-   result = vec_first_match_or_eos_index (uint_src1, uint_src2);
+  len = 8;
+  vec_sll_result1 = vec_xl_len (data_sll, len);
+  vec_sll_expected1 = (vector signed long long){1000, 0};
 
-   if (result != expected_result)
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_sll_result1[i] != vec_sll_expected1[i])
 #ifdef DEBUG
-      printf("Error: uint first match or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_sll_result1[%d] = %lld; vec_sll_expected1[%d] = %lld\n",
+	       len, i,  vec_sll_result1[i], i, vec_sll_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   /* Tests for: vec_first_mismatch_or_eos_index() */
-   /* char */
-   char_src1 = (vector signed char) {-1, 2, 3, 4, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {-1, 2, 3, 20, -5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 3;
-
-   result = vec_first_mismatch_or_eos_index (char_src1, char_src2);
+  len = 16;
+  vec_ull_result1 = vec_xl_len (data_ull, len);
+  vec_ull_expected1 = (vector unsigned long long){1001, 1002};
 
-   if (result != expected_result)
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_ull_result1[i] != vec_ull_expected1[i])
 #ifdef DEBUG
-      printf("Error: char first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_ull_result1[%d] = %lld; vec_ull_expected1[%d] = %lld\n",
+	       len, i,  vec_ull_result1[i], i, vec_ull_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   char_src1 = (vector signed char) {1, 2, 0, 4, 5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {1, 2, 0, 4, 5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 2;
-
-   result = vec_first_mismatch_or_eos_index (char_src1, char_src2);
+  len = 8;
+  vec_ull_result1 = vec_xl_len (data_ull, len);
+  vec_ull_expected1 = (vector unsigned long long){1001, 0};
 
-   if (result != expected_result)
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_ull_result1[i] != vec_ull_expected1[i])
 #ifdef DEBUG
-      printf("Error: char first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_ull_result1[%d] = %lld; vec_ull_expected1[%d] = %lld\n",
+	       len, i,  vec_ull_result1[i], i, vec_ull_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   char_src1 = (vector signed char) {1, 2, 3, 4, 5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   char_src2 = (vector signed char) {1, 2, 3, 4, 5, 6, 7, 8,
-				     9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 16;
-
-   result = vec_first_mismatch_or_eos_index (char_src1, char_src2);
+  len = 16;
+  vec_f_result1 = vec_xl_len (data_f, len);
+  vec_f_expected1 = (vector float){100000.0, 100001.0, 100002.0, 100003.0};
 
-   if (result != expected_result)
+  for (i = 0; i < 4; i++)
+    {
+      if (vec_f_result1[i] != vec_f_expected1[i])
 #ifdef DEBUG
-      printf("Error: char first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_f_result1[%d] = %f; vec_f_expected1[%d] = %f\n",
+	       len, i,  vec_f_result1[i], i, vec_f_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   uchar_src1 = (vector unsigned char) {1, 2, 3, 4, 5, 6, 7, 8,
-					9, 10, 11, 12, 13, 14, 15, 16};
-   uchar_src2 = (vector unsigned char) {1, 0, 3, 4, 5, 6, 7, 8,
-					9, 10, 11, 12, 13, 14, 15, 16};
-   expected_result = 1;
-
-   result = vec_first_mismatch_or_eos_index (uchar_src1, uchar_src2);
+  len = 8;
+  vec_f_result1 = vec_xl_len (data_f, len);
+  vec_f_expected1 = (vector float){100000.0, 100001.0, 0.0, 0.0};
 
-   if (result != expected_result)
+  for (i = 0; i < 4; i++)
+    {
+      if (vec_f_result1[i] != vec_f_expected1[i])
 #ifdef DEBUG
-      printf("Error: uchar first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_f_result1[%d] = %f; vec_f_expected1[%d] = %f\n",
+	       len, i,  vec_f_result1[i], i, vec_f_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   uchar_src1 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					0, 11, 12, 13, 14, 15, 16};
-   uchar_src2 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					0, 11, 12, 13, 14, 15, 16};
-   expected_result = 8;
+  len = 16;
+  vec_d_result1 = vec_xl_len (data_d, len);
+  vec_d_expected1 = (vector double){1000000.0, 1000001.0};
 
-   result = vec_first_mismatch_or_eos_index (uchar_src1, uchar_src2);
-
-   if (result != expected_result)
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_d_result1[i] != vec_d_expected1[i])
 #ifdef DEBUG
-      printf("Error: uchar first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_d_result1[%d] = %f; vec_f_expected1[%d] = %f\n",
+	       len, i,  vec_d_result1[i], i, vec_d_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   uchar_src1 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					10, 11, 12, 13, 14, 15, 16, 17};
-   uchar_src2 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					10, 11, 12, 13, 14, 0, 16, 17};
-   expected_result = 13;
+  len = 8;
+  vec_d_result1 = vec_xl_len (data_d, len);
+  vec_d_expected1 = (vector double){1000000.0, 0.0};
 
-   result = vec_first_mismatch_or_eos_index (uchar_src1, uchar_src2);
-
-   if (result != expected_result)
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_d_result1[i] != vec_d_expected1[i])
 #ifdef DEBUG
-      printf("Error: uchar first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: vec_xl_len(), len = %d, vec_d_result1[%d] = %f; vec_f_expected1[%d] = %f\n",
+	       len, i,  vec_d_result1[i], i, vec_d_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   uchar_src1 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					10, 11, 12, 13, 14, 15, 16, 17};
-   uchar_src2 = (vector unsigned char) {2, 3, 4, 5, 6, 7, 8, 9,
-					10, 11, 12, 13, 14, 15, 16, 17};
-   expected_result = 16;
+  vec_s128_expected1 = (vector __int128_t){12800000};
+  vec_s128_result1 = vec_xl_len (data_128, len);
 
-   result = vec_first_mismatch_or_eos_index (uchar_src1, uchar_src2);
+  if (vec_s128_expected1[0] != vec_s128_result1[0])
+    {
+#ifdef DEBUG
+       printf("Error: vec_xl_len(), len = %d, vec_s128_result1[0] = %lld %llu; ",
+	      len, vec_s128_result1[0] >> 64,
+	      vec_s128_result1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF);
+       printf("vec_s128_expected1[0] = %lld %llu\n",
+	      vec_s128_expected1[0] >> 64,
+	      vec_s128_expected1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF);
+#else
+       abort ();
+#endif
+    }
 
-   if (result != expected_result)
+  vec_u128_result1 = vec_xl_len (data_u128, len);
+  vec_u128_expected1 = (vector __uint128_t){12800001};
+  if (vec_u128_expected1[0] != vec_u128_result1[0])
 #ifdef DEBUG
-      printf("Error: uchar first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+    {
+       printf("Error: vec_xl_len(), len = %d, vec_u128_result1[0] = %lld; ",
+	      len, vec_u128_result1[0] >> 64,
+	      vec_u128_result1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF);
+       printf("vec_u128_expected1[0] = %lld\n",
+	      vec_u128_expected1[0] >> 64,
+	      vec_u128_expected1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF);
+    }
 #else
-      abort();
+    abort ();
 #endif
 
-   /* short int */
-   short_src1 = (vector short int) {-10, -20, 30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {-10, 20, 30, 40, 50, 60, 70, 80};
+    /* Tests to ensure the vec_xl_len() is properly optimized with a pre
+       and post data initialization is done.  */
 
-   expected_result = 1;
+  len = 16;
 
-   result = vec_first_mismatch_or_eos_index (short_src1, short_src2);
+  vec_sc_expected1 = (vector signed char){ 1, 2, 3, 4, 5, 6, 7, 8,
+					   0, 0, 0, 0, 0, 0, 0, 0 };
 
-   if (result != expected_result)
+  input_c = (vector signed char){ 1, 2, 3, 4, 5, 6, 7, 8,
+				  0, 0, 0, 0, 0, 0, 0, 0 };
+  vec_sc_result1 = vec_xl_len (&input_c[0], len);
+  input_c = (vector signed char){ 9, 10, 11, 12, 13, 14, 15, 16,
+				  17, 18, 19, 20, 21, 22, 23, 24 };
+  
+  for (i = 0; i < 16; i++)
+    {
+      if (vec_sc_result1[i] != vec_sc_expected1[i])
 #ifdef DEBUG
-      printf("Error: short int first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_sc_result1[%d] = %d; vec_sc_expected1[%d] = %d\n",
+	       len, i,  vec_sc_result1[i], i, vec_sc_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   short_src1 = (vector short int) {0, 20, 30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {0, 20, 30, 40, 50, 60, 70, 80};
-
-   expected_result = 0;
-
-   result = vec_first_mismatch_or_eos_index (short_src1, short_src2);
+  len = 16;
+  vec_uc_expected1 = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8, 9,
+					     10, 11, 12, 13, 14, 15, 16 };
+  input_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8, 9,
+				   10, 11, 12, 13, 14, 15, 16 };
+  vec_uc_result1 = vec_xl_len (&input_uc[0], len);
+  input_uc = (vector unsigned char){ 10, 11, 12, 13, 14, 15, 16,
+				     17, 18, 19, 20, 21, 22, 23, 24 };
 
-   if (result != expected_result)
+  for (i = 0; i < 16; i++)
+    {
+      if (vec_uc_result1[i] != vec_uc_expected1[i])
 #ifdef DEBUG
-      printf("Error: short int first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_uc_result1[%d] = %d; vec_uc_expected1[%d] = %d\n",
+	       len, i,  vec_uc_result1[i], i, vec_uc_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   short_src1 = (vector short int) {10, 20, 30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {10, 20, 30, 40, 50, 60, 70, 80};
+  len = 16;
+  vec_ss_expected1 = (vector signed short){ 10, 11, 12, 13, 14, 15, 16, 17 };
+  input_ssi = (vector signed short){ 10, 11, 12, 13, 14, 15, 16, 17 };
+  vec_ss_result1 = vec_xl_len (&input_ssi[0], len);
+  input_ssi = (vector signed short){ 14, 15, 16, 17, 18, 19, 20, 21 };
 
-   expected_result = 8;
+  for (i = 0; i < 8; i++)
+    {
+      if (vec_ss_result1[i] != vec_ss_expected1[i])
+#ifdef DEBUG
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_ss_result1[%d] = %d; vec_ss_expected1[%d] = %d\n",
+	       len, i,  vec_ss_result1[i], i, vec_ss_expected1[i]);
+#else
+	abort ();
+#endif
+    }
 
-   result = vec_first_mismatch_or_eos_index (short_src1, short_src2);
+  len = 16;
+  vec_us_expected1 = (vector unsigned short){ 11, 12, 13, 14, 15, 16, 17, 18 };
+  input_usi = (vector unsigned short){ 11, 12, 13, 14, 15, 16, 17, 18 };
+  vec_us_result1 = vec_xl_len (&input_usi[0], len);
+  input_usi = (vector unsigned short){ 15, 16, 17, 18, 19, 20, 21, 22 };
 
-   if (result != expected_result)
+  for (i = 0; i < 8; i++)
+    {
+      if (vec_us_result1[i] != vec_us_expected1[i])
 #ifdef DEBUG
-      printf("Error: short int first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_us_result1[%d] = %d; vec_us_expected1[%d] = %d\n",
+	       len, i,  vec_us_result1[i], i, vec_us_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   short_src1 = (vector short int) {10, 0, 30, 40, 50, 60, 70, 80};
-   short_src2 = (vector short int) {10, 0, 30, 40, 50, 60, 70, 80};
+  len = 16;
+  vec_si_expected1 = (vector int){ 100, 101, 102, 103 };
+  input_si = (vector int){ 100, 101, 102, 103 };
+  vec_si_result1 = vec_xl_len (&input_si[0], len);
+  input_si = (vector int){ 102, 103, 104, 105 };
 
-   expected_result = 1;
+  for (i = 0; i < 4; i++)
+    {
+      if (vec_si_result1[i] != vec_si_expected1[i])
+#ifdef DEBUG
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_si_result1[%d] = %d; vec_si_expected1[%d] = %d\n",
+	       len, i,  vec_si_result1[i], i, vec_si_expected1[i]);
+#else
+	abort ();
+#endif
+    }
 
-   result = vec_first_mismatch_or_eos_index (short_src1, short_src2);
+  len = 16;
+  vec_ui_expected1 = (vector unsigned int){101, 102, 103, 104};
+  input_ui = (vector unsigned int){101, 102, 103, 104};
+  vec_ui_result1 = vec_xl_len (&input_ui[0], len);
+  input_ui = (vector unsigned int){ 103, 104, 105, 106 };
 
-   if (result != expected_result)
+  for (i = 0; i < 4; i++)
+    {
+      if (vec_ui_result1[i] != vec_ui_expected1[i])
 #ifdef DEBUG
-      printf("Error: short int first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_ui_result1[%d] = %d; vec_ui_expected1[%d] = %d\n",
+	       len, i,  vec_ui_result1[i], i, vec_ui_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   ushort_src1 = (vector short unsigned int) {10, 20, 30, 40, 50, 60, 70, 0};
-   ushort_src2 = (vector short unsigned int) {10, 20, 30, 40, 50, 60, 70, 80};
+#if 1  
+  len = 16;
+  vec_sll_expected1 = (vector signed long long){1000, 1001};
+  input_sll = (vector signed long long ){1000, 1001};
+  vec_sll_result1 = vec_xl_len ((signed long long int *)&input_sll[0], len);
+  input_sll = (vector signed long long){1001, 1002};
 
-   expected_result = 7;
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_sll_result1[i] != vec_sll_expected1[i])
+#ifdef DEBUG
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_sll_result1[%d] = %lld; vec_sll_expected1[%d] = %lld\n",
+	       len, i,  vec_sll_result1[i], i, vec_sll_expected1[i]);
+#else
+	abort ();
+#endif
+    }
 
-   result = vec_first_mismatch_or_eos_index (ushort_src1, ushort_src2);
+  len = 16;
+  vec_ull_expected1 = (vector unsigned long long int){1001, 1002};
+  input_ull = (vector unsigned long long int){1001, 1002};
+  vec_ull_result1 = vec_xl_len ((unsigned long long int *)&input_ull[0], len);
+  input_ull = (vector unsigned long long int){1002, 1003};
 
-   if (result != expected_result)
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_ull_result1[i] != vec_ull_expected1[i])
 #ifdef DEBUG
-      printf("Error: ushort int first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_ull_result1[%d] = %lld; vec_ull_expected1[%d] = %lld\n",
+	       len, i,  vec_ull_result1[i], i, vec_ull_expected1[i]);
 #else
-      abort();
+	abort ();
+#endif
+    }
 #endif
 
-   ushort_src1 = (vector short unsigned int) {20, 0, 40, 50, 60, 70, 80, 90};
-   ushort_src2 = (vector short unsigned int) {20, 0, 40, 50, 60, 70, 80, 90};
+  
+  len = 16;
+  vec_f_expected1 = (vector float){100000.0, 100001.0, 100002.0, 100003.0};
+  input_f = (vector float){100000.0, 100001.0, 100002.0, 100003.0};
+  vec_f_result1 = vec_xl_len (&input_f[0], len);
+  input_f = (vector float){100001.0, 100002.0, 100003.0, 100004.0};
 
-   expected_result = 1;
+  for (i = 0; i < 4; i++)
+    {
+      if (vec_f_result1[i] != vec_f_expected1[i])
+#ifdef DEBUG
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_f_result1[%d] = %f; vec_f_expected1[%d] = %f\n",
+	       len, i,  vec_f_result1[i], i, vec_f_expected1[i]);
+#else
+	abort ();
+#endif
+    }
 
-   result = vec_first_mismatch_or_eos_index (ushort_src1, ushort_src2);
+  len = 16;
+  vec_d_expected1 = (vector double){1000000.0, 1000001.0};
+  input_d = (vector double){1000000.0, 1000001.0};
+  vec_d_result1 = vec_xl_len (&input_d[0], len);
+  input_d = (vector double){1000001.0, 1000002.0};
 
-   if (result != expected_result)
+  for (i = 0; i < 2; i++)
+    {
+      if (vec_d_result1[i] != vec_d_expected1[i])
 #ifdef DEBUG
-      printf("Error: ushort int first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_d_result1[%d] = %f; vec_f_expected1[%d] = %f\n",
+	       len, i,  vec_d_result1[i], i, vec_d_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
 
-   ushort_src1 = (vector short unsigned int) {20, 30, 40, 50, 60, 70, 80, 90};
-   ushort_src2 = (vector short unsigned int) {20, 30, 40, 50, 60, 70, 80, 90};
+  len = 16;
+  vec_s128_expected1 = (vector __int128_t){12800000};
+  input_128 = (vector __int128_t){12800000};
+  vec_s128_result1 = vec_xl_len (&input_128[0], len);
+  input_128 = (vector __int128_t){12345678};
 
-   expected_result = 8;
+  if (vec_s128_expected1[0] != vec_s128_result1[0])
+    {
+#ifdef DEBUG
+       printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_s128_result1[0] = %lld %llu; ",
+	      len, vec_s128_result1[0] >> 64,
+	      vec_s128_result1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF);
+       printf("vec_s128_expected1[0] = %lld %llu\n",
+	      vec_s128_expected1[0] >> 64,
+	      vec_s128_expected1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF);
+#else
+       abort ();
+#endif
+    }
 
-   result = vec_first_mismatch_or_eos_index (ushort_src1, ushort_src2);
+  len = 16;
+  vec_u128_expected1 = (vector __uint128_t){12800001};
+  input_u128 = (vector __uint128_t){12800001};
+  vec_u128_result1 = vec_xl_len (&input_u128[0], len);
+  input_u128 = (vector __uint128_t){98765432};
 
-   if (result != expected_result)
+  if (vec_u128_expected1[0] != vec_u128_result1[0])
 #ifdef DEBUG
-      printf("Error: ushort int first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+    {
+       printf("Error: pre/post initialzation vec_xl_len(), len = %d, vec_u128_result1[0] = %lld; ",
+	      len, vec_u128_result1[0] >> 64,
+	      vec_u128_result1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF);
+       printf("vec_u128_expected1[0] = %lld\n",
+	      vec_u128_expected1[0] >> 64,
+	      vec_u128_expected1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF);
+    }
 #else
-      abort();
+    abort ();
 #endif
 
-   /* int */
-   int_src1 = (vector int) {1, 2, 3, 4};
-   int_src2 = (vector int) {1, 20, 3, 4};
+    /* Tests to ensure the vec_xl_len_r() is properly optimized with a pre
+       and post data initialization is done.  */
 
-   expected_result = 1;
+  len = 16;
+  vec_uc_expected1 = (vector unsigned char){ 16,15, 14, 13, 12, 11, 10, 9,
+					     8, 7, 6, 5, 4, 3, 2, 1 };
+  input_uc = (vector unsigned char){ 1, 2, 3, 4, 5, 6, 7, 8, 9,
+				   10, 11, 12, 13, 14, 15, 16 };
+  vec_uc_result1 = vec_xl_len_r (&input_uc[0], len);
+  input_uc = (vector unsigned char){ 10, 11, 12, 13, 14, 15, 16,
+				     17, 18, 19, 20, 21, 22, 23, 24 };
 
-   result = vec_first_mismatch_or_eos_index (int_src1, int_src2);
-
-   if (result != expected_result)
+  for (i = 0; i < 16; i++)
+    {
+      if (vec_uc_result1[i] != vec_uc_expected1[i])
 #ifdef DEBUG
-      printf("Error: int first mismatch or EOS result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
+	printf("Error: pre/post initialzation vec_xl_len_r(), len = %d, vec_uc_result1[%d] = %d; vec_uc_expected1[%d] = %d\n",
+	       len, i,  vec_uc_result1[i], i, vec_uc_expected1[i]);
 #else
-      abort();
+	abort ();
 #endif
+    }
+
+}
+
+
 
-   int_src1 = (vector int) {1, 2, 3, 4};
-   int_src2 = (vector int) {1, 2, 3, 4};
 
-   expected_result = 4;
 
-   result = vec_first_mismatch_or_eos_index (int_src1, int_src2);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
 
-   int_src1 = (vector int) {1, 2, 0, 4};
-   int_src2 = (vector int) {1, 2, 0, 4};
 
-   expected_result = 2;
 
-   result = vec_first_mismatch_or_eos_index (int_src1, int_src2);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
 
-   int_src1 = (vector int) {1, 0, 3, 4};
-   int_src2 = (vector int) {1, 2, 3, 4};
 
-   expected_result = 1;
 
-   result = vec_first_mismatch_or_eos_index (int_src1, int_src2);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: int first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
 
-   uint_src1 = (vector unsigned int) {1, 2, 3, 4};
-   uint_src2 = (vector unsigned int) {11, 2, 33, 4};
 
-   expected_result = 0;
 
-   result = vec_first_mismatch_or_eos_index (uint_src1, uint_src2);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: uint first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
 
-   uint_src1 = (vector unsigned int) {1, 2, 3, 0};
-   uint_src2 = (vector unsigned int) {1, 2, 3, 0};
 
-   expected_result = 3;
 
-   result = vec_first_mismatch_or_eos_index (uint_src1, uint_src2);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: uint first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
 
-   uint_src1 = (vector unsigned int) {1, 2, 3, 4};
-   uint_src2 = (vector unsigned int) {1, 2, 3, 4};
 
-   expected_result = 4;
 
-   result = vec_first_mismatch_or_eos_index (uint_src1, uint_src2);
 
-   if (result != expected_result)
-#ifdef DEBUG
-      printf("Error: uint first mismatch result (%d) does not match expected result (%d)\n",
-	     result, expected_result);
-#else
-      abort();
-#endif
 
-}