Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In CIL, why is BGE equal to CLT.UN followed by BRFALSE?

Tags:

c#

.net

cil

In the CLI specifications (ECMA-335, page 329), and also on MSDN, it is stated that the CIL opcode bge is equivalent to performing a clt.un followed by a brfalse.

This baffles me. I don't understand why the equivalent is the unordered clt.un, and not the regular clt. Especially considering there is also a bge.un, which does not state an equivalent set of instructions. I whould have expected bge to be equivalent to [clt, brfalse], and bge.un to be equivalent to [clt.un, brfalse].

Is this an error in the specifications or am I missing something?

like image 860
basdp Avatar asked Mar 21 '14 11:03

basdp


1 Answers

That PDF states:

The effect of a bge target instruction is identical to:

  • If stack operands are integers, then clt followed by a brfalse target
  • If stack operands are floating-point, then clt.un followed by a brfalse target
like image 180
CodeCaster Avatar answered Nov 13 '22 12:11

CodeCaster