vec_test_data_class

Purpose

Determines the data class of the elements of the given vector.

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_test_data_class(a, b)

Result and argument types

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

Table 1. Types of the returned value and function arguments
d a b
vector bool int vector float unsigned char
vector bool long long vector double unsigned char

Result value

Returns the results of testing a for the condition selected by b. The value of b is in the range of 0-127. Each bit of b enables the test of a different condition. You can refer to the following table for the mapping relations between testing conditions and bits of b:

Table 2. Bitmask for testing conditions
Bits of b Test conditions
0x01 Test for -Denormal
0x02 Test for +Denormal
0x04 Test for -Zero
0x08 Test for +Zero
0x10 Test for -Infinity
0x20 Test for +Infinity
0x40 Test for NaN

If any of the enabled test conditions is true, all of the bits of corresponding element are set to 1. If all of the enabled test conditions are false, all of the bits of the corresponding element is set to 0.



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