55803 Rev 0.91 - Sep 1, 2020 PPR for AMD Family 17h Model 31h B0
^ Bitwise exclusive-OR (e.g., 01b ^ 10b == 11b). Sometimes used as "raised to the power of" as
well, as indicated by the context in which it is used (e.g., 2^2 == 4).
~ Bitwise NOT (also known as one's complement). (e.g., ~10b == 01b).
! Logical NOT (e.g., !10b == 0b). It treats a multi-bit operand as 1 if >= 1 and produces a 1-bit
result.
<, <=, >,
>=, ==, !=
Relational. Less than, Less than or equal, greater, greater than or equal, equal, and not
equal.
+, -, *, /,
%
Arithmetic. Addition, subtraction, multiplication, division, and modulus.
<< Bitwise left shift. Shift left first operand by the number of bits specified by the 2nd
operand (e.g., 01b << 01b == 10b).
>> Bitwise right shift. Shift right first operand by the number of bits specified by the 2nd
operand (e.g., 10b >> 01b == 01b).
?: Ternary conditional (e.g., condition ? value if true : value if false).
Table 3: Function Definitions
Term Description
ABS ABS(integer expression): Remove sign from signed value.
FLOOR FLOOR(integer expression): Rounds real number down to nearest integer.
CEIL CEIL(real expression): Rounds real number up to nearest integer.
MIN MIN(integer expression list): Picks minimum integer or real value of comma separated list.
MAX MAX(integer expression list): Picks maximum integer or real value of comma separated list.
COUNT COUNT(integer expression): Returns the number of binary 1's in the integer.
ROUND ROUND(real expression): Rounds to the nearest integer; halfway rounds away from zero.
UNIT UNIT(register field reference): Input operand is a register field reference that contains a valid values table
that defines a value with a unit (e.g., clocks, ns, ms, etc). This function takes the value in the register field
and returns the value associated with the unit (e.g., If the field had a valid value definition where 1010b was
defined as 5 ns). Then if the field had the value of 1010b, then UNIT() would return the value 5.
POW POW(base, exponent): POW(x,y) returns the value x to the power of y.
1.4.2.1 Operator Precedence and Associativity
This document follows C operator precedence and associativity. The following table lists operator precedence (highest to
lowest). Their associativity indicates in what order operators of equal precedence in an expression are applied. Parentheses
are also used to group subexpressions to force a different precedence; such parenthetical expressions can be nested and are
evaluated from inner to outer (e.g., "X = A || !B && C" is the same as "X = A || ((!B) && C)").
Table 4: Operator Precedence and Associativity
Operator Description Associativity
!, ~ Logical negation/bitwise complement right to left
*, /, % Multiplication/division/modulus left to right
+, - Addition/subtraction left to right
<<, >> Bitwise shift left, Bitwise shift right left to right
< , <=, >,
>=, ==, !=
Relational operators left to right
& Bitwise AND left to right
^ Bitwise exclusive OR left to right
| Bitwise inclusive OR left to right
&& Logical AND left to right
17