Skip to content

Conversation

@farhan-syah
Copy link
Collaborator

Summary

  • Add Windows x64 ABI support with proper calling convention handling
  • Add complete ARM64 (AArch64) JIT compilation support across all JIT engines
  • Add cross-platform CI workflows for Linux (x86-64, ARM64), macOS (x86-64, ARM64), and Windows (x64)
  • Implement greedy codepoint matching with backtracking for AArch64

Platform Support

Platform JIT Support SIMD Support
Linux x86-64 ✓ (AVX2)
Linux ARM64
macOS x86-64 ✓ (AVX2)
macOS ARM64 (Apple Silicon)
Windows x86-64 ✓ (AVX2)

Changes

New Platform Support

  • Windows x64: Implements Windows calling convention (rcx, rdx, r8, r9 for args, different volatile registers)
  • ARM64 (AArch64): Full JIT support for Apple Silicon, Linux ARM64
    • DFA JIT (src/jit/aarch64.rs)
    • Tagged NFA JIT (src/nfa/tagged/jit/aarch64.rs)
    • Backtracking JIT (src/vm/backtracking/jit/aarch64.rs)
    • Shift-Or JIT (src/vm/shift_or/jit/aarch64.rs)

Architecture

  • New calling_convention.rs module abstracts platform-specific ABI details
  • Unified codegen helpers work across x86-64 and AArch64

CI

  • .github/workflows/ci.yml: General CI for all platforms
  • .github/workflows/jit.yml: JIT-specific tests on Linux (x86-64, ARM64), macOS (x86-64, ARM64), and Windows

Documentation

  • Updated README.md with platform support table
  • Updated docs/architecture.md, engine_structure.md, features.md for ARM64

Test plan

  • CI passes on Linux x86-64
  • CI passes on Linux ARM64
  • CI passes on macOS x86-64
  • CI passes on macOS ARM64 (Apple Silicon)
  • CI passes on Windows x64

Implement Microsoft x64 calling convention support for Windows JIT compilation,
enabling JIT features on Windows, Linux, and macOS x86-64 systems.

Key Changes:
- Add calling_convention.rs module with platform-specific prologue/epilogue helpers
- Update all JIT engines (DFA, Tagged NFA, Backtracking, Shift-Or) with dual ABI support
- Use conditional compilation for System V AMD64 (Unix) vs Microsoft x64 (Windows) ABIs
- Handle callee-saved register differences (RDI/RSI callee-saved on Windows only)
- Add extern "win64" function signatures for Windows, "sysv64" for Unix

CI Infrastructure:
- ci.yml: General CI for pull requests (Linux all checks, Windows/macOS subset, MSRV)
- jit.yml: JIT-specific CI triggered by branch patterns and JIT path changes

Version: Bump to 0.1.0-beta.3
Implement native code generation for ARM64 platforms including Apple Silicon
and ARM64 Linux/Windows, providing full feature parity with x86_64 JIT.

Key additions:
- ARM64 codegen infrastructure with AAPCS64 calling convention support
- DFA JIT compiler for ARM64 with prefilter integration
- Shift-Or JIT using bit-parallel execution on ARM64
- Backtracking JIT with capture group support
- Tagged NFA JIT with lookaround and non-greedy quantifiers
- Architecture detection and conditional compilation for both x86_64 and aarch64
- CI testing on macOS ARM64 (Apple Silicon) runners

Implementation details:
- ~3900 lines of ARM64-specific code across 5 new modules
- Unified calling convention abstraction for x86_64 and ARM64
- Engine selector updated to detect ARM64 JIT capability
- All 4 JIT execution engines (DFA, Shift-Or, Backtracking, Tagged NFA) fully functional

This enables JIT compilation on modern ARM64 systems with performance
characteristics similar to x86_64 JIT implementations.
Update all documentation and CI configuration to reflect the newly
implemented ARM64 JIT support:

- Add Linux ARM64 CI job using ubuntu-24.04-arm runner
- Update platform support tables showing JIT availability on ARM64
- Revise conditional compilation examples to include aarch64 target
- Update feature flag descriptions for cross-platform JIT support
- Remove "(future)" annotation from aarch64.rs references

Follows implementation in commits 179c755 and c40d01c.
@farhan-syah farhan-syah force-pushed the feature/jit/windows-macos-abi branch 2 times, most recently from 6a4d51b to 2c0fd75 Compare December 2, 2025 12:57
Resolve 81+ clippy warnings across source code, tests, and benchmarks
by addressing lint violations including:

- Simplify control flow (collapsible_if, collapsible_else_if, if_same_then_else)
- Improve iteration patterns (manual_flatten, needless_range_loop, unused_enumerate_index)
- Remove redundant operations (clone_on_copy, redundant_closure, let_and_return)
- Simplify expressions (unwrap_or_default, int_plus_one, len_zero, manual_contains)
- Fix documentation formatting (doc_lazy_continuation, doc_nested_refdefs, empty_line_after_doc_comments)
- Optimize code patterns (manual_div_ceil, manual_is_multiple_of, manual_range_contains)
- Reduce complexity (type_complexity, large_enum_variant)
- Remove unused code (useless_format, useless_vec, byte_char_slices)

Fix MSRV CI job by removing Cargo.lock before compatibility check,
as v4 lockfile format requires Rust 1.78+ while MSRV is 1.70.
@farhan-syah farhan-syah force-pushed the feature/jit/windows-macos-abi branch from 2c0fd75 to e5e4137 Compare December 2, 2025 13:00
@farhan-syah farhan-syah merged commit 5fc7139 into main Dec 2, 2025
14 checks passed
@farhan-syah farhan-syah deleted the feature/jit/windows-macos-abi branch December 2, 2025 13:03
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