__builtin_packed2zoned
Purpose
Transforms the packed decimal value to zoned decimal format.
Note: This built-in function
is valid only when the following conditions are met:
- The -mcpu option is set to target POWER9 processors or higher.
- The
bcd.hfile is included.
Prototype
vector unsigned char __builtin_packed2zoned(vector unsigned char, unsigned char);
Usage
The built-in function transforms the packed decimal value to zoned decimal format. The format of
the result depends on the value of the second parameter and complies with the following rules:
- If the second parameter is
0, the format of the result is set by the following rules:- The leftmost halfword of each digit 0-14 of the result is set to
0x3. - The positive sign code is set to
0x3. - The negative sign code is set to
0x7.
- The leftmost halfword of each digit 0-14 of the result is set to
- If the second parameter is
1, the format of the result is set by the following rules:- The leftmost halfword of each digit 0-14 of the result is set to
0xF. - The positive sign code is set to
0xC. - The negative sign code is set to
0xD.
- The leftmost halfword of each digit 0-14 of the result is set to
Notes:
- The second parameter can only be
0or1. - You can determine whether a packed decimal value is positive or negative according to the
following rules:
- Packed decimal values with sign code of
0xA,0xC,0xE, or0xFare interpreted as positive values. - Packed decimal values with sign code of
0xBor0xDare interpreted as negative values.
- Packed decimal values with sign code of