Commit db87610
JIT: don't kill FP/SIMD/mask regs across x64 write barriers (#128778)
<img width="805" height="497"
alt="{7366C871-08EB-48F1-897F-021AE10303FC}"
src="https://github.com/user-attachments/assets/d3bc0305-d901-4f69-a94c-0dd742c78fb9"
/>
### What I deliberately did *not* do
- **Did not exclude RCX/RDI (dst)** from the kill set — the asm helpers
shift dst in place (`shr rcx, 0Bh`), so it must be considered clobbered.
Preserving dst would require rewriting all ~20 asm variants.
- **Did not exclude RDX/RSI (src)** — the Region variants destroy src.
- **Did not exclude R10/R11** on Windows even though the default
patched-slot path doesn't touch them. Kept conservative to cover
`_DEBUG` runtime variant (`JIT_WriteBarrier_Debug`) and the
`DOTNET_UseGCWriteBarrierCopy=0` config (`RhpAssignRef`), both of which
touch R10/R11.
PS: We probably can do this for APX cc @dotnet/intel
I think it would be nice to preserve `dst` register unchanged (we do
that for arm64), but that requires some changes in the ASM helpers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 41642df commit db87610
1 file changed
Lines changed: 26 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
185 | 188 | | |
186 | | - | |
187 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
188 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
189 | 208 | | |
190 | 209 | | |
191 | 210 | | |
| |||
196 | 215 | | |
197 | 216 | | |
198 | 217 | | |
199 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
200 | 221 | | |
201 | 222 | | |
202 | | - | |
| 223 | + | |
203 | 224 | | |
204 | 225 | | |
205 | 226 | | |
| |||
0 commit comments