Skip to content

Possible incorrect result in compiler-rt 128x128 wideMultiply #90009

Closed
@tgross35

Description

@tgross35

This bit of code 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 rust-lang/compiler-builtins#587 (comment) 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.

Appears to cause #91840 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions