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

Pushing back on implicit converions for simd types #75

Open
DenisYaroshevskiy opened this issue Jun 2, 2023 · 0 comments
Open

Pushing back on implicit converions for simd types #75

DenisYaroshevskiy opened this issue Jun 2, 2023 · 0 comments

Comments

@DenisYaroshevskiy
Copy link

DenisYaroshevskiy commented Jun 2, 2023

I had seen the other discussion but I think it misses that simd conversions can be very expensive.

Here is 2 chars to double https://godbolt.org/z/fGnMdYr7h

        pmovsxbq        xmm1, xmm0
        movd    eax, xmm1
        xorps   xmm0, xmm0
        cvtsi2sd        xmm0, eax
        pextrd  eax, xmm1, 2
        xorps   xmm1, xmm1
        cvtsi2sd        xmm1, eax
        unpcklpd        xmm0, xmm1                      # xmm0 = xmm0[0],xmm1[0]
        ret

4 chars to double will be much worse because needs to emulate double.

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