Skip to content

Change test tool to use a loop and load intrinsic. #1318

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

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

Jmc18134
Copy link
Contributor

The files generated by the intrinsic test tool currently repeat the lines for the call multiple times, which sometimes generates very large test files. Changing it to use a loop and a load intrinsic reduces the size of the generated files and gives some coverage for the load intrinsics. This seems to also reduce the run-time for the test tool, enough that some of the intrinsics that are currently skipped because they take too long can be added back and the Rust test files can be built with --target again.

Example generated C before:

{
    uint64x1_t a = { 0x10000000000000 };
    uint64x1_t b = { 0x10000000000000 };
    auto __return_value = vadd_u64(a, b);
    std::cout << "Result -1: uint64x1_t(" << std::fixed << std::setprecision(150) <<  cast<uint64_t>(__return_value) << ")" << std::endl;
}
{
    uint64x1_t a = { 0x3FDFFFFFFFFFFFFF };
    uint64x1_t b = { 0x3FDFFFFFFFFFFFFF };
    auto __return_value = vadd_u64(a, b);
    std::cout << "Result -2: uint64x1_t(" << std::fixed << std::setprecision(150) <<  cast<uint64_t>(__return_value) << ")" << std::endl;
}
...
// Several more similar blocks

Example generated after:

const uint64_t a_vals[] = { 0x0,0x10000000000000,0x3FDFFFFFFFFFFFFF,0x3FE0000000000000,0x3FE0000000000001,0x3FEFFFFFFFFFFFFF,0x3FF0000000000000,0x3FF0000000000001,0x3FF8000000000000,0x4024000000000000,  0x7FEFFFFFFFFFFFFF,0x7FF0000000000000,0x7FF923456789ABCD,0x7FF8000000000000,0x7FF123456789ABCD,0x7FF0000000000000,0x123456789ABCD,0xFFFFFFFFFFFFF,0x1,0x8000000000000000 };
const uint64_t b_vals[] = { 0x0,0x10000000000000,0x3FDFFFFFFFFFFFFF,0x3FE0000000000000,0x3FE0000000000001,0x3FEFFFFFFFFFFFFF,0x3FF0000000000000,0x3FF0000000000001,0x3FF8000000000000,0x4024000000000000,  0x7FEFFFFFFFFFFFFF,0x7FF0000000000000,0x7FF923456789ABCD,0x7FF8000000000000,0x7FF123456789ABCD,0x7FF0000000000000,0x123456789ABCD,0xFFFFFFFFFFFFF,0x1,0x8000000000000000 };

...

{
    for (int i=0; i<20; i++) {
        uint64x1_t a = vld1_u64(&a_vals[i]);
        uint64x1_t b = vld1_u64(&b_vals[i]);
        auto __return_value = vadd_u64(a, b);
        std::cout << "Result -" << i+1 << ": uint64x1_t(" << std::fixed << std::setprecision(150) <<  cast<uint64_t>(__return_value) << ")" << std::endl;
    }
}

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon.

Please see the contribution instructions for more information.

@Jmc18134 Jmc18134 force-pushed the loop-intrinsic-test branch from 209c91e to 5dd3b6f Compare August 11, 2022 15:48
@Amanieu
Copy link
Member

Amanieu commented Aug 12, 2022

CI should be fixed now, can you rebase?

@Jmc18134 Jmc18134 force-pushed the loop-intrinsic-test branch from 5dd3b6f to a53c202 Compare August 15, 2022 09:31
@Amanieu
Copy link
Member

Amanieu commented Aug 20, 2022

CI should be fixed by #1326, can you rebase?

@Jmc18134 Jmc18134 force-pushed the loop-intrinsic-test branch from a53c202 to 56443eb Compare August 22, 2022 07:28
@Amanieu Amanieu merged commit 97bda68 into rust-lang:master Aug 22, 2022
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.

3 participants