29.2.44 __builtin_max_16, __builtin_max_32

Description

Force (Signed) Data Range Maximum Limit. Compares a 16-bit or 32-bit signed data value to a maximum signed limit value, both stored in the accumulators. If the data value is greater than the maximum, the maximum value is returned. If the data value is less than or equal to the maximum value, the data value is returned.

Prototype

int16_t __builtin_max_16(int16_t value1, int16_t value2);
int32_t __builtin_max_32(int32_t value1, int32_t value2);

Arguments

value1 – Maximum allowable value

value2 – Data value to clamp

Return Value

Returns value1 or value2 based on Description.

Machine Instruction

max.w
max.l

Error Messages

None