mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-27 05:12:50 +00:00
The native DBT had no test for the 0x70..=0x7F or the 0F 80..=8F block at all. These four conditions are the ones an ARM64 condition code cannot provide directly: SUBS sets C when a subtraction does not borrow, so x86 CF is its inverse, and ARM64's HI and LS are defined on that same inverted carry. Three tests derive CF and ZF from the operands (Intel SDM Volume 1, 3.4.3.1), then check JB, JAE, JBE and JA in the short and the near encoding at both ends of the 32-bit and 64-bit ranges, with SUB as well as CMP, and with the compare and the branch in separate translated blocks. Inverting the borrow polarity in the lowering makes all three fail. Closes #64 Signed-off-by: izdat-sl4w <76667566+izdat-sl4w@users.noreply.github.com>