modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo
Other
21.79k stars 2.53k forks source link

[stdlib] Guard `SIMD.cast()` against equal types #2669

Closed helehex closed 2 weeks ago

helehex commented 2 weeks ago

Checks if types are already equal when calling SIMD.cast(). This avoids unnecessary code when generically casting simd vectors.

But, this could be used in place of rebind when you know the types are already equal. if that's not what we want, then maybe we should constrain the types to be different, instead of doing this.

modularbot commented 2 weeks ago

✅🟣 This contribution has been merged 🟣✅

Your pull request has been merged to the internal upstream Mojo sources. It will be reflected here in the Mojo repository on the nightly branch during the next Mojo nightly release, typically within the next 24-48 hours.

We use Copybara to merge external contributions, click here to learn more.

modularbot commented 2 weeks ago

Landed in 60b16a496b9ef7eaa55b4ec9383fb5720f982e05! Thank you for your contribution 🎉