mratsim / constantine

Constantine: modular, high-performance, zero-dependency cryptography stack for verifiable computation, proof systems and blockchain protocols.
Other
413 stars 44 forks source link

llvm: more tentatives at optimal field addition with pure LLVM IR #457

Open mratsim opened 3 months ago

mratsim commented 3 months ago

This PR has changes behind the code generator from #456 that triggered issues:

for Bigints of size 254/255 the LLVM IR has better worst case codegen than builtin llvm.usub.with.overflow (1~2 extra instructions instead of 33% extra instructions https://github.com/mratsim/constantine/issues/357#issuecomment-2288608867) but for size 256 it degrades to 66% extra instructions.