vec_find_any_eq_or_0_idx_cc: Vector Find Any Element Equal or Zero Index with Condition Code

d = vec_find_any_eq_or_0_idx_cc(a, b, c)

Find the byte-index of element of a from any element of b with an equal value, or the byte-index of element of a is 0. The result is the lowest byte-index from element of a, if it is found to match those conditions. Otherwise, the result is 16.

c would be set to one of the following values:
  • 0 - if no element of a matches any element of b with an equal value, and there is at least one element from a with a value of 0.
  • 1 - if at least one element of a matches any element of b with an equal value, and no elements of a with a value of 0.
  • 2 - if at least one element of a matches any element of b with an equal value, and there is at least one element from a has a value of 0.
  • 3 - if no element of a matches any element of b with an equal value, and there is no element from a with a value of 0.

The result is placed into byte element seven of the returned vector, and all other bytes are set to 0.

Table 1. Vector Find Any Element Equal or Zero Index with Condition Code
d a b c
vector signed char vector signed char vector signed char int *
vector unsigned char vector bool char vector bool char
vector unsigned char vector unsigned char
vector signed short vector signed short vector signed short
vector unsigned short vector bool short vector bool short
vector unsigned short vector unsigned short
vector signed int vector signed int vector signed int
vector unsigned int vector bool int vector bool int
vector unsigned int vector unsigned int