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] Optimizing arm64 trampolines #93547

Merged
merged 2 commits into from
Oct 17, 2023
Merged

Conversation

jandupej
Copy link
Member

Two occurrences are addressed here:

(1) Sequential SIMD loads/stores try to use paired opcodes, e.g. in generic_trampoline_jit

A0 47 80 3D        str    q0, [x29, #0x110]  ;
A1 4B 80 3D        str    q1, [x29, #0x120]  ; Merge with above into one stp
A2 4F 80 3D        str    q2, [x29, #0x130]
A3 53 80 3D        str    q3, [x29, #0x140]
A4 57 80 3D        str    q4, [x29, #0x150]
A5 5B 80 3D        str    q5, [x29, #0x160]
A6 5F 80 3D        str    q6, [x29, #0x170]
A7 63 80 3D        str    q7, [x29, #0x180]

(2) Arithmetics with large immediate values takes advantage of the full immediate range (but not shifted imm), e.g. in generic_trampoline_jit:

31 02 04 91        add    x17, x17, #0x100
31 02 04 91        add    x17, x17, #0x100
31 82 00 91        add    x17, x17, #0x20   ; These three should fuse into add x17,x17,#0x220 

According to https://developer.arm.com/documentation/dui0801/c/A64-General-Instructions/ADD--immediate-?lang=en the immediate range is 0..4095

@jandupej jandupej added this to the 9.0.0 milestone Oct 16, 2023
@jandupej jandupej self-assigned this Oct 16, 2023
@vargaz
Copy link
Contributor

vargaz commented Oct 16, 2023

Note that this code is designed to be run like once per callsite, so optimizing it is not going to achieve much. The only case where its called more often is delegate invokes.

@jandupej
Copy link
Member Author

/azp run runtime-extra-platforms

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jandupej
Copy link
Member Author

The CI failures appear unrelated. Merging.

@jandupej jandupej merged commit c5e7081 into dotnet:main Oct 17, 2023
144 of 159 checks passed
@jandupej jandupej deleted the arm64-tramp branch October 17, 2023 08:49
@ghost ghost locked as resolved and limited conversation to collaborators Nov 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants