RFR: 8312213: Remove unnecessary TEST instructions on x86 when flags reg will already be set [v2]
Dean Long
dlong at openjdk.org
Sat Aug 5 00:21:34 UTC 2023
On Fri, 4 Aug 2023 09:45:40 GMT, Tobias Hotz <duke at openjdk.org> wrote:
> For example, if the instruction following the test checks if the value is greater (than zero), the sign and zero flag need to be set and the overflow flag needs to be cleared. Not all instructions (such as add) satisfy this requirement, so in this case we would need to emit the test, but we could omit it if we only check for zero, as that only requires the ZF, which the test instruction sets.
OK, I see your concern about ADD. Rather than reject it completely, you allow it depending on the kind of compare, which requires tracking individual flags.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14172#issuecomment-1666297192
More information about the hotspot-compiler-dev
mailing list