Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

64bit jmp #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

64bit jmp #21

wants to merge 4 commits into from

Conversation

adam-ii
Copy link

@adam-ii adam-ii commented Nov 26, 2018

This pull requests includes several fixes and improvements for x86-64 hosts

  • JITC x86-64 assembler fixes for Clang and Xcode
  • JITC x86-64 support for jump from translation cache to offsets >2GB via a jump table
  • Translation cache and client page performance tuning
  • CMake build system scripts (primarily for generating Xcode projects)

Implement preprocessor macros from configure that are used in the source
CMake options for UI (sdl/x11) and CPU (generic, x86, x86_64)
Flex and bison outputs are generated out of build tree
Support for posix hosts
Incomplete support for Win32/MinGW hosts
No support for beos, gtk or qt UI
Disabled by default due to high performance cost
$ cmake -D PEARPC_JITC_DEBUG=ON
LLVM interprets a label 0b or 1b as a binary literal

https://bugs.llvm.org/show_bug.cgi?id=36144

Replace label '1' and associated jmps with an unused non-binary digit
Reduce the size of each ClientPage entry point from 64-bit pointer to 32-bit integer offset, to facilitate increasing the number of free ClientPages

Store ClientPage and TranslationCacheFragment objects contiguously

Increase transation cache and ClientPage cache proportional to client memory, existing defaults result in a large amount of thrashing with OS X 10.4.11 client

Limit translation cache to 2GB so that jmp/call within the translation cache can use 32-bit relative instructions

Implement a jump table for jumps from the translation cache to asm functions in the text segment. This is placed at the beginning of the translation cache so it can be reached with a 32-bit relative jump

This resolves the immediate segfault when running a gcc compiled elf on Linux, as the elf is observed loading above the 64GB address mark
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.

1 participant