cpu/drcbearm64.cpp: Optimised conditional operations using carry flag. (#13484)

Track the state of the native carry flag to avoid unnecessarily
manipulating the native NZCV register.  If the native carry flag does
not correspond to the UML carry flag, test the bit in the flags register
for the C and NC conditions.

Use condition select instructions to implement conditional forms of MOV
and FMOV when advantageous.

Fixed EXIT with C/NC/A/BE condition not working properly if it doesn't
immediately follow a CMP or SUB.  Extended reach of conditional EXIT to
+/-128MiB (was +/-1MiB for conditions other than U/NU).

Moved code to set up skipping conditional instructions to a common
function.

Use TBZ/TBNZ for short backward jumps with U/NU/C/NC conditions to save
one instruction and a temporary register.

Simplified/optimised ADD[C]/SUB[B] code generation - avoids an
unnecessary register copy when one operand is in memory and the other is
a small immediate value.  Also fixed another unnecessary register copy
for SUB[B] when an operand is kept in a host register.

Slightly optimised generated code for AND immediate.
This commit is contained in:
Vas Crabb 2025-03-17 05:02:39 +11:00 committed by GitHub
parent 8d7167a901
commit d7d7a4c46c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 475 additions and 214 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:windyfairy
// copyright-holders:windyfairy, Vas Crabb
#ifndef MAME_CPU_DRCBEARM64_H
#define MAME_CPU_DRCBEARM64_H