Skip to content

Remove call pe, __setflags when signed overflow is impossible #37

@ZERICO2005

Description

@ZERICO2005

We can use known bits or etc to test if signed overflow is possible or not. Or more generally, if sbc hl, bc always sets PO, then call pe, __setflags will never be called and can be safely removed.

The other way to get this optimization would be to remove conditional calls if it can be proven that they will never be called.

__setflags discussion here: https://discordapp.com/channels/432891584451706892/1488273105121185875

Metadata

Metadata

Assignees

No one assigned

    Labels

    missed optimizationMissed optimizations generate correct (no bugs) but not optimal code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions