__builtin_zoned2packed

Purpose

Transforms the zoned decimal value to packed decimal format.

This built-in function is valid only when -qarch(-mcpu) is set to utilize the POWER9™ technology and the altivec.h file is included.

Prototype

vector unsigned char __builtin_zoned2packed(vector unsigned char, unsigned char);

Usage

The built-in function transforms the zoned decimal value to packed decimal format. The details of the format of the first parameter depend on the value of the second parameter and comply with the following rules:
  • If the second parameter is 0:
    • The value of the first parameter with a sign code of 0x0, 0x1, 0x2, 0x3, 0x8, 0x9, 0xA, or 0xB is interpreted as positive.
    • The value of the first parameter with a sign code of 0x4, 0x5, 0x6, 0x7, 0xC, 0xD, 0xE, or 0xF is interpreted as negative.
  • If the second parameter is 1:
    • The value of the first parameter with a sign code of 0xA, 0xC, 0xE, or 0xF is interpreted as positive.
    • The value of the first parameter with a sign code of 0xB or 0xD is interpreted as negative.

If the first parameter is positive, the sign code for the result is 0xC; if the first parameter is negative, the sign code for the result is 0xD.

Note: The second parameter can only be 0 or 1.


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