vec_first_mismatch_index
Purpose
Compares each set of the corresponding elements of the given vectors and returns the first position of inequality.
This built-in function is valid only when -qarch(-mcpu) is set to utilize the POWER9™ technology and the altivec.h file is included.
Syntax
d=vec_first_mismatch_index(a, b)
Result and argument types
The following table describes the types of the returned value and the function arguments.
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 position of the first unequal element between a and b. If all the corresponding elements are equal between a and b, returns the number of the elements of either a or b.