vec_first_mismatch_or_eos_index

Purpose

Compares each set of the corresponding elements of the given vectors and returns the first position of inequality or the position of the end-of-string terminator \0.

Note: This built-in function is valid only when the -mcpu option is set to target POWER9 processors or higher.

Syntax

d=vec_first_mismatch_or_eos_index(a, b)

Result and argument types

The following table describes the types of the returned value and the function arguments.

Table 1. Result and argument types
d a b
unsigned int vector signed char vector signed char
unsigned int vector unsigned char vector unsigned char
unsigned int vector signed short vector signed short
unsigned int vector unsigned short vector unsigned short
unsigned int vector signed int vector signed int
unsigned int vector unsigned int vector unsigned int

Result value

Returns the byte index of the first position of the unequal element between a and b or the position of an end-of-string terminator, \0.

If both of the following conditions are met,
  • There is no unequality between the corresponding elements of a and b;
  • There is no end-of-string terminator;
returns the number of the elements of either a or b.