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

[mono][jit] Zero SIMD vectors with movi on arm64 #92873

Closed
jandupej opened this issue Oct 2, 2023 · 1 comment
Closed

[mono][jit] Zero SIMD vectors with movi on arm64 #92873

jandupej opened this issue Oct 2, 2023 · 1 comment

Comments

@jandupej
Copy link
Member

jandupej commented Oct 2, 2023

The reverse engineering document (https://dougallj.github.io/applecpu/firestorm.html) does not indicate that M1 recognizes eor v0,v0,v0 as a zeroing idiom (like an x64 CPU would). Instead, there is the movi instruction (https://developer.arm.com/documentation/dui0801/l/A64-SIMD-Vector-Instructions/MOVI--vector---A64-?lang=en) that can initialize all lanes of a SIMD vector. Dougall Johnson's document shows that for zero, this is internally resolved with register renaming.

Also use this for OP_XONES.

@EgorBo
Copy link
Member

EgorBo commented Oct 3, 2023

Oh, interesting, looks like mov x, #0 is also better than mov x, xzr on Apple, e.g.: https://godbolt.org/z/6rh4rn5G3 since mov x, xzr is not handled via renaming on Apple.

@jandupej jandupej closed this as completed Oct 3, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants