Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add i128 compiler-rt div/mul support #1105

Merged
merged 2 commits into from Jun 14, 2018
Merged

Add i128 compiler-rt div/mul support #1105

merged 2 commits into from Jun 14, 2018

Conversation

tiehuis
Copy link
Member

@tiehuis tiehuis commented Jun 13, 2018

See:

Haven't tested on windows. I wonder if the udivmodti4 abi issue is relevant? Also, I am using these in a BigRational implementation so will wait until I'm happy there before doing anything here.

fn test__muloti4(a: i128, b: i128, expected: i128, expected_overflow: c_int) void {
var overflow: c_int = undefined;
const x = __muloti4(a, b, &overflow);
assert(overflow == expected_overflow and (overflow != 0 or x == expected));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have thought: overflow == expected_overflow and (expected_overflow == 0 or x == expected)

(change the 2nd overflow to expected_overflow)

@andrewrk
Copy link
Member

I wonder if the udivmodti4 abi issue is relevant?

I believe it is, since there is a 128 bit value as a return value. Here's the commit to follow example of: ec2a81a

@andrewrk andrewrk merged commit 2219cc0 into master Jun 14, 2018
@andrewrk andrewrk deleted the i128-compiler-rt branch June 14, 2018 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants