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

Add WAsm SIMD microkernel for f32-rsqrt. #6280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link
Contributor

Add WAsm SIMD microkernel for f32-rsqrt.

PiperOrigin-RevId: 624151682

const v128_t vt0123 = wasm_f32x4_sqrt(vx0123);
const v128_t vt4567 = wasm_f32x4_sqrt(vx4567);
const v128_t vy0123 = wasm_f32x4_div(vone, vt0123);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some cpus dont support div, such as arm. Is there an alternative way to get reciprocal?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, since WASM SIMD does not support rcp or rsqrt approximations, since they would not be identical across all platforms.

We could compute an rsqrt approximation ourselves, e.g. a polynomial, but I doubt that would be faster than whatever WASM would to under the hood here.

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.

2 participants