LATX, fix: Manage mode 2 softfpu helper regions - #427
Open
ganjue66da wants to merge 2 commits into
Open
Conversation
Softfpu mode 2 opens one helper region for consecutive x87 instructions. When such a sequence reaches the last instruction in a translation block, the old look-ahead logic has no following instruction to trigger the matching epilogue. Close the region explicitly at the translation-block boundary so the generated helper state is restored on every exit. Tests: - LATX_SOFTFPU=2 latx-x87-signal-stack-test-one Signed-off-by: Wenqiang Wei <weiwenqiang@mail.ustc.edu.cn>
Softfpu mode 2 already wraps consecutive x87 instructions in one helper prologue and epilogue. FIST, FISTP, FISTTP, FST, and FSTP generated additional per-instruction wrappers, repeating register state transfers inside hot x87 regions. Keep the local wrappers for mode 1 and rely on the region wrapper in mode 2. Tests: - LATX_SOFTFPU=2 x87-conversion-regression - LATX_SOFTFPU=2 latx-x87-signal-stack-test-one Signed-off-by: Wenqiang Wei <weiwenqiang@mail.ustc.edu.cn>
ganjue66da
force-pushed
the
codex/softfpu-helper-regions
branch
from
August 25, 2026 03:55
6b48fc9 to
af8b2fe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Softfpu mode 2 groups consecutive x87 instructions into a helper region. A region ending exactly at a translation-block boundary could miss its epilogue, while several store/conversion instructions also emitted redundant per-instruction state transfers inside an already-open region.
Changes
Validation
LATX_SOFTFPU=2.LATX_SOFTFPU=2 LATX_SOFTFPU_FAST=0xc00000passes the signal-stack regression.Scope
The first commit is a correctness boundary fix. The second commit is a dependent optimization of the same helper-region lifetime mechanism.