NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Leveraging SIMD for Accelerating Large-number Arithmetic

Subhrajit Das, Abhishek Bichhawat, Yuvraj PatelarXiv 2026 · DOI

TL;DR

This paper introduces "DigitsOnTurbo" (DoT), a novel approach to accelerate large-number arithmetic on modern CPUs by restructuring algorithms to better leverage Single Instruction, Multiple Data (SIMD) parallelism. DoT achieves significant speedups for addition, subtraction, and multiplication, leading to notable performance improvements in widely-used libraries like GMP and OpenSSL.

What Problem Does This Paper Address?

Large-number arithmetic, crucial for scientific computing and cryptography, has historically been slow to adopt SIMD parallelism. Traditional algorithms for operations like addition and multiplication involve inherent sequential dependencies, particularly in handling "carries" (the result of an addition that exceeds the capacity of a single digit or "limb"). These dependencies make it difficult to parallelize operations across SIMD lanes, leading to performance bottlenecks. Existing SIMD implementations often struggle with the overhead of managing these carries, negating the potential benefits of parallel processing. This paper aims to bridge this gap by redesigning the core algorithms to expose more data-parallel operations, thereby unlocking SIMD's full potential for large-number arithmetic.

Methods

The core innovation of DoT lies in its algorithmic restructuring, rather than simply vectorizing existing sequential code.

  • DoT Addition/Subtraction: This method breaks down the operation into four phases. The first three phases handle the common case of limb addition/subtraction and carry detection/propagation in parallel using SIMD. A fourth, "slow path" phase is reserved for the rare "carry cascade" scenario, which is mathematically shown to be exponentially unlikely for random inputs. This separation significantly reduces the overhead for typical operations.
  • DoT Multiplication: DoT employs a "vertical and crosswise" multiplication technique. This approach reorganizes the computation to expose all partial products as independent operations. These can then be computed in parallel using SIMD, eliminating the long dependency chains found in traditional methods and fully utilizing SIMD execution units.

The implementation uses portable C with x86-64 SIMD intrinsics, allowing it to target SSE, AVX2, and AVX-512 widths.

Datasets

The paper does not discuss training datasets. For evaluation, it uses:

  • Random and Pathological Test Cases: These are generated using the Mersenne Twister algorithm and cover a wide range of operand sizes (512 to 32768 bits). Pathological cases are designed to stress edge scenarios like full carry/borrow propagation.
  • Existing Libraries and Benchmarks: DoT is integrated into GMP (GNU Multiple Precision Arithmetic Library) and OpenSSL. Performance is evaluated using GMPbench and OpenSSL's speed benchmark.

Key Insights and Ideas

  • Algorithmic Restructuring is Key: The paper strongly argues that simply vectorizing existing algorithms is insufficient for large-number arithmetic. The true gains come from fundamentally rethinking the algorithm to expose inherent data parallelism.
  • Carry Cascades are Rare: Mathematically proving that carry cascades are exponentially rare for random inputs is crucial. This insight justifies the four-phase approach for addition/subtraction, where the expensive carry handling is isolated to a rarely-executed path.
  • SIMD Throughput vs. Dependency Overhead: The paper highlights that the performance bottleneck in prior SIMD attempts was not SIMD compute throughput itself, but the overhead of managing data dependencies and preparing data for SIMD operations. DoT directly addresses this.
  • Impact of Base Case Optimization: Speeding up the fundamental primitives (add, sub, mul) has a cascading effect, significantly improving the performance of higher-level operations in libraries like GMP and OpenSSL.

Key Results

  • Micro-benchmarks:
    • DoT addition/subtraction achieves up to 1.85x speedup over prior SIMD methods and 2.3x for multiplication.
  • DoT's SIMD variants show increasing speedups with wider SIMD units: 0.7x (SSE), 1.2x (AVX2), and 1.8x (AVX512) over scalar for add/sub.
  • Integrated Libraries:
    • DoTMP (DoT integrated with GMP) shows a 7.8% overall GMPbench score improvement, with up to 19.3% for π computation and 48.7% for multiplication.
  • DoTSSL (DoT integrated with OpenSSL) shows throughput improvements of up to 5.9% for RSA, FFDH, and DSA, and latency reductions of up to 7.9%.
  • 256-bit Multiplication: DoT's 4x4 multiplication routine achieves a 2.31x speedup over prior work (Gueron et al.) and significantly lower instruction counts and higher IPC.

Limitations and Future Work

  • Hardware Evolution: The paper notes that current SIMD ISAs lack native carry propagation across lanes, necessitating explicit carry handling. Future hardware with features like "add-with-carry chaining" or wider multiply instructions could further benefit DoT.
  • ARM SVE2: The authors suggest that an ARM SVE2 port could make Phase 2 of DoT Add cheaper due to its native carry-generation instructions.
  • AVX-512 IFMA Limitations: The current AVX-512 IFMA instructions provide only the lower 64-bit product of a 128-bit result, requiring workarounds for full precision. Newer instructions or future ISA extensions could simplify this.
  • Future Work: The paper implies that as hardware evolves, algorithms like DoT that focus on independent, data-parallel operations will continue to be crucial for unlocking performance gains in large-number arithmetic. The authors also mention that DoT will run unchanged on upcoming Intel P- and E-cores due to AVX10 preserving AVX-512 intrinsics.

Summary updated

BibTeX
@misc{das2026leveraging,
  author = {Subhrajit Das and Abhishek Bichhawat and Yuvraj Patel},
  title = {{Leveraging SIMD for Accelerating Large-number Arithmetic}},
  year = {2026},
  eprint = {2604.21566},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.21566},
}
Figure