Skip to content

[DYNAREC] Added preliminary interblocks deferred flags elimination - #4284

Merged
ptitSeb merged 2 commits into
ptitSeb:mainfrom
ksco:peek-flags
Aug 24, 2026
Merged

[DYNAREC] Added preliminary interblocks deferred flags elimination#4284
ptitSeb merged 2 commits into
ptitSeb:mainfrom
ksco:peek-flags

Conversation

@ksco

@ksco ksco commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

The first version is probably too conservative, but it gives good results in some benchmarks.

@ptitSeb

ptitSeb commented Aug 24, 2026

Copy link
Copy Markdown
Owner

So for each "peekeable" jump, a limited 16 instructions decoding using only pass0 is done at the landing address to check if flags are regenated and so useless to store a defered flag befor ethe jump. Clever reuse of existing code!

Comment thread src/dynarec/dynarec_native.c Outdated
uintptr_t next[PEEK_FLAGS_INSTS + 2];
} peek_flags_state_t;

static __thread peek_flags_state_t peek_flags_state;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this break the Wow64 build:

ld.lld: error: undefined symbol: _tls_index
/usr/local/bin/cmake -E rm -f CMakeFiles/wowbox64.dir/objects.a
>>> referenced by objects.a(dynarec_native.c.obj):(interblock_flags_needed)
>>> referenced by objects.a(dynarec_native.c.obj):(interblock_flags_needed)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

On the other hand, I'm not sure it's necessary to have this thread local has dynarec is not supposed to be multithreaded: everything is static and dynablock building is behind a mutex.

@ptitSeb
ptitSeb merged commit a793cd5 into ptitSeb:main Aug 24, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants