__builtin_national2packed

Purpose

Transforms the national 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_national2packed(vector unsigned char a, unsigned char b);

Usage

Transforms a from national decimal format to packed decimal format.

The value of b can only be 0 or 1.

The sign code of the result is set according to the following rules:
  • If a is positive, the sign code is set according to the following rules:
    • If b is 0, the sign code is set to 0xC.
    • If b is 1, the sign code is set to 0xF.
  • If a is negative, the sign code is set to 0xD.


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