Skip to content

Unnecessary splat in normalize* functions #15

Open
@defaultgnome

Description

@defaultgnome

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions