Skip to content

Add 128-bit integer support in tritonToLLVM#1410

Merged
cnheitman merged 3 commits intoJonathanSalwan:dev-v1.0from
ilyida:dev-v1.0
Jul 22, 2025
Merged

Add 128-bit integer support in tritonToLLVM#1410
cnheitman merged 3 commits intoJonathanSalwan:dev-v1.0from
ilyida:dev-v1.0

Conversation

@ilyida
Copy link
Contributor

@ilyida ilyida commented Jul 1, 2025

Extended tritonToLLVM.cpp to support 128-bit integers.

  • Expanded BV_NODE to handle 128-bit bit-vectors
  • Added switch cases to argument type generation and BSWAP_NODE to select 128-bit integer types

@ilyida
Copy link
Contributor Author

ilyida commented Jul 1, 2025

During testing, I discovered a bug caused by certain ASTs that Triton can emit, such as:
((_ extract 127 0) (concat ((_ extract 511 128) (_ bv0 512)) xmm0))
This caused an exception to be thrown since the code only handled BV_NODEs with bit-widths less than 64-bits, or exactly 128-bits.
The fix for this issue I implemented is simply to extend BV_NODEs to handle bit-widths up to 512-bits.

@cnheitman
Copy link
Collaborator

Hi! This looks good. I was planning to rebase and merge. Any comments @JonathanSalwan ?

@JonathanSalwan
Copy link
Owner

nop, looks good to me as well. thx @cnheitman and @raax7

@cnheitman cnheitman merged commit 16d3907 into JonathanSalwan:dev-v1.0 Jul 22, 2025
22 of 26 checks passed
@JonathanSalwan
Copy link
Owner

btw, in our CI, i think we should also test for llvm versions newer than just llvm-14

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants