Specifically an example generated by the AmigaE compiler when comparing two float values
MOVE.L -56(A4),A6 ;get mathieeesingbase
MOVE.L diff,D0 ;get first value
MOVE.L tolerance,D1 ;get second value
JSR -$2a(A6) ;call IEEESPCmp
SLE D0 ;assumes condition codes were set by call, sets D0 accordingly
EXT.W D0
EXT.L D0 ;extend value to full 32 bits
this code works correctly on a real machine because the return value is set just before returning from the library call and the condition codes remain accurate. adding a TST.L D0 immediately before the SLE makes the issue go away.
Specifically an example generated by the AmigaE compiler when comparing two float values
MOVE.L -56(A4),A6 ;get mathieeesingbase
MOVE.L diff,D0 ;get first value
MOVE.L tolerance,D1 ;get second value
JSR -$2a(A6) ;call IEEESPCmp
SLE D0 ;assumes condition codes were set by call, sets D0 accordingly
EXT.W D0
EXT.L D0 ;extend value to full 32 bits
this code works correctly on a real machine because the return value is set just before returning from the library call and the condition codes remain accurate. adding a TST.L D0 immediately before the SLE makes the issue go away.