vec_first_match_or_eos_index

Purpose

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

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_match_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 position of the first equal 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 equality 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.


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us