Skip to content

A faster dot4... #16

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

Open
lassade opened this issue May 22, 2025 · 0 comments
Open

A faster dot4... #16

lassade opened this issue May 22, 2025 · 0 comments

Comments

@lassade
Copy link

lassade commented May 22, 2025

Just want to point that dot4 can be improved with the dpps instruction (that I just discovered), it requres SSE4.1 (99.84% of cpus in the Steam Hardware Survey, April 2025)

pub fn dot4(v0: Vec, v1: Vec) Vec {
    return asm (
        \\dpps    $0xff, %xmm1, %xmm0 
        : [ret] "={xmm0}" (-> Vec), // output
        : [v0] "{xmm0}" (v0), // inputs
          [v1] "{xmm1}" (v1),
    );
}

Didn't test if it's how mutch faster it is...

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