Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 1.24 KB

iii.3.23-cgt-un.md

File metadata and controls

33 lines (18 loc) · 1.24 KB

III.3.23 cgt.un – compare greater than, unsigned or unordered

Format Assembly Format Description
FE 03 cgt.un Push 1 (of type int32) if value1 > value2, unsigned or unordered, else push 0.

Stack Transition:

…, value1, value2 → …, result

Description:

The cgt.un instruction compares value1 and value2. A value of 1 (of type int32) is pushed on the stack if

  • for floating-point numbers, either value1 is strictly greater than value2, or value1 is not ordered with respect to value2.

  • for integer values, value1 is strictly greater than value2 when considered as unsigned numbers.

Otherwise, 0 (of type int32) is pushed on the stack.

As per IEC 60559:1989, infinite values are ordered with respect to normal numbers (e.g., +infinity > 5.0 > -infinity). The acceptable operand types are encapsulated in Table 4: Binary Comparison or Branch Operations.

Exceptions:

None.

Correctness:

Correct CIL provides two values on the stack whose types match those specified in Table 4: Binary Comparison or Branch Operations

Verifiability:

There are no additional verification requirements.