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

Test the i128 related intrinsics on windows #158

Closed
japaric opened this issue Apr 11, 2017 · 0 comments
Closed

Test the i128 related intrinsics on windows #158

japaric opened this issue Apr 11, 2017 · 0 comments

Comments

@japaric
Copy link
Member

japaric commented Apr 11, 2017

These intrinsics return a U64x2 instead of i128 / u128 because of ABI requirements.

The tests will have to modified somehow to test these. I tried a transmute:

#[test]
fn divti3() {
    for &((a, b), c) in TEST_CASES {
        let c_: i128 = unsafe { mem::transmute(__divti3(a, b)) };
        assert_eq!(((a, b), c), ((a, b), c_));
    }
}

but apparently it didn't work:

running 1 test
test divti3 ... FAILED
failures:
---- divti3 stdout ----
	thread 'divti3' panicked at 'assertion failed: `(left == right)` (left: `((-91225923628555883033450043276019451624, -99173197121162634899222824496910041088), -124760295158389846421118573101029785600)`, right: `((-91225923628555883033450043276019451624, -99173197121162634899222824496910041088), 0)`)', C:\projects\compiler-builtins\target\x86_64-pc-windows-msvc\debug\build\compiler_builtins-89dacbcd722cfc78\out/divti3.rs:10050

So maybe we should test for equality using the U64x2 type without going back to i128 / u128.

For #155 I'm going to ignore these tests on Windows which is what we are already doing.

cc @est31

japaric pushed a commit that referenced this issue Apr 11, 2017
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

No branches or pull requests

1 participant