Issue 90009
Summary Possible bug in compiler-rt 128x128 `wideMultiply`
Labels new issue
Assignees
Reporter tgross35
    [This bit of code](https://github.com/llvm/llvm-project/blob/49b209d0d1833a339e66735e1288c1805224603e/compiler-rt/lib/builtins/fp_lib.h#L145-L185) seems to have a bug where it is missing the carry bit. This was discovered when I was porting the function to Rust's compiler-rt and results of unit tests disagreed with Python, see https://github.com/rust-lang/compiler-builtins/pull/587#issuecomment-2060543566 and the followup discussion.

To reproduce - `"0xffffffffffffffffffffffffffffffff * 0xffffffffffffffffffffffffffffffff` should be `0xfffffffffffffffffffffffffffffffe00000000000000000000000000000001`, but this function returns `0xfffffffffffffffffffffffffffffffd00000000000000000000000000000001`.

cc @marthadev who found a fix for the Rust side.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to