Skip to content

feat(core): add JIT support for aarch64#6758

Merged
bluestreak01 merged 6 commits intomasterfrom
rd_jit_arm
Feb 9, 2026
Merged

feat(core): add JIT support for aarch64#6758
bluestreak01 merged 6 commits intomasterfrom
rd_jit_arm

Conversation

@RaphDal
Copy link
Copy Markdown
Contributor

@RaphDal RaphDal commented Feb 8, 2026

This pull request adds support for ARM64 (AArch64) architecture to the JIT compiler, enabling QuestDB's JIT code generation to run natively on ARM64 systems in addition to x86. The changes introduce ARM64-specific implementations for register handling, caches, and code generation, while maintaining compatibility with the existing x86 logic. Conditional compilation is used throughout to select the appropriate architecture at build time.

Architecture support and conditional compilation:

  • Added conditional includes and logic throughout common.h and compiler.cpp to select between ARM64 (aarch64.h) and x86 (x86.h, avx2.h) headers and implementations. This ensures the codebase can be built and run on both architectures. [1] [2]

ARM64-specific JIT code generation:

  • Implemented ARM64-specific versions of Function and CountOnlyFunction structs in compiler.cpp, including methods for code generation, register setup, and loop logic. These mirror the x86 implementations but use ARM64 instructions and register types. [1] [2]

Register and cache handling for ARM64:

  • Added ARM64-specific register and cache logic in common.h for jit_value_t, ColumnAddressCache, ConstantCache, and ColumnValueCache, including methods for handling ARM64 registers and values, and appropriate storage for ARM64 register types. [1] [2] [3] [4]

Maintaining x86 compatibility:

  • Preserved all existing x86 code paths, including SIMD support, by wrapping them in #else blocks and ensuring all caches and register handling remain unchanged for x86 builds. [1] [2] [3] [4]

Benchmark setup update:

  • Updated the benchmark setup in SqlJitCompilerScalarBenchmark.java to ensure the execution context is properly initialized for the new architecture support.

Performance improvements

SqlJitCompilerScalarBenchmark ran on an Apple M5.

Benchmark (boolOperation) (jitMode) (predicate) Score Error Units
testCountOnlyFilter AND SCALAR EQ 48.765 ± 8.055 ms/op
testCountOnlyFilter AND SCALAR NEQ 80.435 ± 7.173 ms/op
testCountOnlyFilter AND DISABLED EQ 100.675 ± 6.387 ms/op
testCountOnlyFilter AND DISABLED NEQ 107.414 ± 2.441 ms/op
testCountOnlyFilter OR SCALAR EQ 80.129 ± 7.466 ms/op
testCountOnlyFilter OR SCALAR NEQ 47.280 ± 4.885 ms/op
testCountOnlyFilter OR DISABLED EQ 445.545 ± 11.063 ms/op
testCountOnlyFilter OR DISABLED NEQ 116.696 ± 10.751 ms/op
testFilter AND SCALAR EQ 46.159 ± 7.363 ms/op
testFilter AND SCALAR NEQ 206.506 ± 10.358 ms/op
testFilter AND DISABLED EQ 101.459 ± 6.283 ms/op
testFilter AND DISABLED NEQ 470.782 ± 9.036 ms/op
testFilter OR SCALAR EQ 79.862 ± 5.852 ms/op
testFilter OR SCALAR NEQ 182.743 ± 10.445 ms/op
testFilter OR DISABLED EQ 406.438 ± 8.699 ms/op
testFilter OR DISABLED NEQ 427.244 ± 6.651 ms/op

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 8, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rd_jit_arm

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@RaphDal RaphDal changed the title feat: add JIT support for aarch64 feat(core): add JIT support for aarch64 Feb 8, 2026
@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 30 / 30 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/SqlCompilerImpl.java 29 29 100.00%
🔵 io/questdb/jit/JitUtil.java 1 1 100.00%

@bluestreak01 bluestreak01 merged commit 55c3414 into master Feb 9, 2026
45 checks passed
@bluestreak01 bluestreak01 deleted the rd_jit_arm branch February 9, 2026 00:39
@puzpuzpuz puzpuzpuz added SQL Issues or changes relating to SQL execution Performance Performance improvements labels Feb 9, 2026
@puzpuzpuz
Copy link
Copy Markdown
Contributor

@RaphDal really cool patch. Great job!

maciulis pushed a commit to maciulis/questdb that referenced this pull request Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Performance Performance improvements SQL Issues or changes relating to SQL execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants