Published June 19, 2026 | Version v1

Porting the Striped Smith-Waterman Library to RISC-V via LLM-Driven Translation

  • 1. ROR icon Universidad Complutense de Madrid

Description

Manually porting SIMD-optimized libraries across instruction set architectures is costly and error-prone, particularly when optimized kernels rely on architecture-specific idioms. We introduce a fully automated, two-phase LLM-driven pipeline for translating x86 SSE code to native RISC-V Vector (RVV) intrinsics. The first phase produces a functionally correct translation based on sse2rvv, while the second rewrites that translation to exploit RVV's scalable vector-length model. Both phases use an iterative compile-fix loop in which the LLM relies exclusively on compiler and simulator feedback to detect and repair errors. We evaluate the pipeline on the Striped Smith-Waterman (SSW) library, a production-grade genomics kernel. Relative to a manually written naive Smith-Waterman baseline, Phase 1 achieves up to 21.7× speedup, showing that a compatibility-layer-guided translation strategy can serve as an effective foundation for cross-ISA porting. Spike simulation confirms that the Phase 2 transformation remains functionally correct across vector lengths from 128 to 4096 bits. On our target platform with a 256-bit vector length, Phase 2 delivers a further 1.30× speedup. Overall, the fully automated pipeline achieves performance and correctness comparable to those of a manually optimized implementation developed by a human expert with AI assistance.

Files

main.pdf

Files (922.8 kB)

Name Size
md5:6d8753510dd6d686158ddbf173d859fa
922.8 kB Preview Download

Additional details

Software

Repository URL
https://github.com/alexfdez1010/riscv-translator
Programming language
Python
Development Status
Active