Skip to content

Conversation

@RiverDave
Copy link

Connections
related — #7105

Description
Similar to other wrapped math functions in #7012 I've followed the same structure/procedure with functions calculating dot product on integers. Some key changes:

  • Introduce a mangled helper for integer vector dot: naga_dot_{int|uint}{N}(a, b) -> returns the scalar dot result.
  • Emitted once per concrete type/width, re-used on call sites.
  • Modify integer-vector dot emission to call the helper directly.
  • Leave float vector dot mapping to MSL’s builtin dot unchanged (Added a brief comment to make this clear).
  • Name mangling logic centralized (e.g., naga_dot_int3, naga_dot_uint4) and shared between call expr site and wrapper generation.

Testing
I required minimal testing — output metal files seem to have generated correctly with the proper helper. I'm still trying to figure out how testing works, but the emitted files seem to make sense.

Squash or Rebase?

  • squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@ErichDonGubler ErichDonGubler changed the title [naga][metal] Anottate dot product functions as wrapped functions [naga][metal] Annotate dot product functions as wrapped functions Oct 27, 2025
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

Successfully merging this pull request may close these issues.

1 participant