feat: add --macos backend to jda1 with syscall translation#12
Merged
Conversation
Translate Linux syscall numbers to macOS BSD numbers at JIR emit time via macos_xlat_nr_id() helper called from codegen_syscall_inline(). Translation covers: read(0), write(1), open(2), close(3), mmap(9), munmap(11), exit(60), gettimeofday(96), exit_group(231). All 5 benchmarks now run natively on macOS (Rosetta 2, x86-64 Mach-O): sudoku 500/500 solved, 46ms lz77 verified, 282ms btree 44863 nodes, 640ms regex 198 matches, 183ms raytracer checksum 1285549368, 328ms Self-host converges at 2,050,465 bytes. Also update benchmarks to use gettimeofday (syscall 96) for timing instead of clock_gettime (syscall 228) which has no direct macOS equiv.
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.
Translate Linux syscall numbers to macOS BSD numbers at JIR emit time via macos_xlat_nr_id() helper called from codegen_syscall_inline(). Translation covers: read(0), write(1), open(2), close(3), mmap(9), munmap(11), exit(60), gettimeofday(96), exit_group(231).
All 5 benchmarks now run natively on macOS (Rosetta 2, x86-64 Mach-O):
sudoku 500/500 solved, 46ms
lz77 verified, 282ms
btree 44863 nodes, 640ms
regex 198 matches, 183ms
raytracer checksum 1285549368, 328ms
Self-host converges at 2,050,465 bytes.
Also update benchmarks to use gettimeofday (syscall 96) for timing instead of clock_gettime (syscall 228) which has no direct macOS equiv.