__bcdsub, __builtin_ppc_bcdsub

Purpose

Returns the result of subtraction on the BCD values a and b.

The sign of the result is determined as follows:
  • If the result is a non-negative value and ps is 0, the sign is set to 0b1100 (0xC).
  • If the result is a non-negative value and ps is 1, the sign is set to 0b1111 (0xF).
  • If the result is a negative value, the sign is set to 0b1101 (0xD).
Note: This built-in function is valid only when the following conditions are met:
  • The -mcpu option is set to target POWER8 or higher processors.
  • The -maltivec option is specified.
  • The altivec.h file is included.

Prototype

vector unsigned char __builtin_ppc_bcdsub (vector unsigned char a, vector unsigned char b, long ps);

vector unsigned char __bcdsub (vector unsigned char a, vector unsigned char b, long ps);

Note:
  • The built-in function in the form of __name is a synonym of the built-in function in the form of __builtin_ppc_name.
  • The built-in function in the form of __name is provided for compatibility with IBM® XL C/C++ for AIX® 16.1.0 or earlier releases. This built-in function form might be deprecated in the future.

Parameters

ps
A compile-time known constant.