Mod Arith: migrate barrett/subifge to mod arith type#1138
Mod Arith: migrate barrett/subifge to mod arith type#1138bqeyfukqbukq wants to merge 5 commits intogoogle:mainfrom
Conversation
subifge to mod arith barrett for mul 1 barrett_reduce barrett_reduce
subifge to mod arith barrett for mul 1 barrett_reduce barrett_reduce barrett reduce test
|
Hi @bqeyfukqbukq, what is the status of this PR? I think we would like appreciate this contribution, but it has some syntax errors and given its age it likely needs to be rebased and updated. If you no longer want to work on this, let me know and I can cherry-pick your commits and finish the work. |
|
The author is one of my colleagues in our group and I was trying to introduce the project to him. After a few discussion he decided to do other projects so left the PR here.
One thing that should be handled carefully is the bitwidth of intermediate result in barrett reduction, where the original author used 3B and we (wrongly) used 2B, then realized it should be 3B but did not get a proper type for it. |
This fix issue #1084
This is wip
This converts barret reduction and subifge to ModArithType, and added corresponding lowering in ModArithToArith.cpp
One thing worth discussing is that the input type is still SignlessIntegerLike, otherwise lowering won't work.