Skip to content

Add 128-bit integer plugin (nautilus-int128) with MLIR intrinsics, runtime, docs, and tests - #414

Open
PhilippGrulich wants to merge 1 commit into
mainfrom
codex/add-__int128-support-for-nautilus
Open

Add 128-bit integer plugin (nautilus-int128) with MLIR intrinsics, runtime, docs, and tests#414
PhilippGrulich wants to merge 1 commit into
mainfrom
codex/add-__int128-support-for-nautilus

Conversation

@PhilippGrulich

Copy link
Copy Markdown
Member

Motivation

  • Provide a traceable signed 128-bit integer type for Nautilus to allow arithmetic, bitwise, shifts, comparisons, casts, and memory operations on platforms with __int128 support.
  • Expose a plugin that lets scalar backends use portable runtime helpers while the MLIR backend emits native i128 operations for better performance.
  • Add automated tests and an optional libFuzzer differential harness to validate correctness across backends.

Description

  • Add ENABLE_INT128_PLUGIN CMake option and wire plugins/int128 into the top-level build when enabled.
  • Introduce plugins/int128 library implementing runtime helpers (int128.cpp) and a public header include/nautilus/int128.hpp exposing nautilus::int128 with constructors, operators, loads/stores, and accessors.
  • Add MLIR intrinsic plugin (MLIRInt128Intrinsics.cpp/.hpp) to replace runtime calls with native i128 LLVM/MLIR operations when the MLIR backend is enabled.
  • Include installation rules and a public CMake alias target nautilus::nautilus-int128 in the plugin CMakeLists.
  • Add documentation docs/int128-plugin.md describing semantics, memory behavior, MLIR interaction, and the fuzz target behavior.
  • Add execution tests (plugins/int128/test/Int128ExecutionTest.cpp) using Catch2 and an optional differential fuzz target (plugins/int128/test/fuzz/Int128Fuzz.cpp) built when ENABLE_FUZZING=ON.

Testing

  • Ran the plugin unit tests via Catch2 (nautilus-int128-tests) through ctest and all tests passed.
  • Built the project with MLIR enabled to exercise MLIRInt128Intrinsics registration and the build completed successfully in that configuration.
  • Verified that the fuzz target nautilus-int128-fuzz is conditionally added when ENABLE_FUZZING=ON; the fuzz target builds with libFuzzer sanitizer flags when enabled.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant