Skip to content

Unnecessary splat in normalize* functions #15

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
defaultgnome opened this issue Mar 26, 2025 · 0 comments
Open

Unnecessary splat in normalize* functions #15

defaultgnome opened this issue Mar 26, 2025 · 0 comments

Comments

@defaultgnome
Copy link

Hey folks,

I was looking through the normalize2, normalize3, and normalize4 functions and noticed this pattern:

return v * splat(F32x4, 1.0) / sqrt(dotX(v, v));

Out of curiosity, I tried removing the splat(F32x4, 1.0) since multiplying by 1 shouldn’t change the result, and everything still passes:

return v / sqrt(dotX(v, v));

Is there a reason for explicitly multiplying by splat(1.0)? am I missing something?

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