Skip to content

vamos - code which assumes condition codes are set on return from library calls does not work correctly. #240

@dmcoles

Description

@dmcoles

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions