Skip to content

Commit 31d0459

Browse files
committed
Update clobber example in the asm documentation
1 parent ddc53f8 commit 31d0459

File tree

1 file changed

+7
-1
lines changed
  • src/doc/unstable-book/src/library-features

1 file changed

+7
-1
lines changed

src/doc/unstable-book/src/library-features/asm.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,19 @@ fn call_foo(arg: i32) {
306306
sym foo,
307307
// 1st argument in rdi, which is caller-saved
308308
inout("rdi") arg => _,
309-
// All caller-saved registers must be marked as clobberred
309+
// All caller-saved registers must be marked as clobbered
310310
out("rax") _, out("rcx") _, out("rdx") _, out("rsi") _,
311311
out("r8") _, out("r9") _, out("r10") _, out("r11") _,
312312
out("xmm0") _, out("xmm1") _, out("xmm2") _, out("xmm3") _,
313313
out("xmm4") _, out("xmm5") _, out("xmm6") _, out("xmm7") _,
314314
out("xmm8") _, out("xmm9") _, out("xmm10") _, out("xmm11") _,
315315
out("xmm12") _, out("xmm13") _, out("xmm14") _, out("xmm15") _,
316+
// Also mark AVX-512 registers as clobbered. This is accepted by the
317+
// compiler even if AVX-512 is not enabled on the current target.
318+
out("xmm16") _, out("xmm17") _, out("xmm18") _, out("xmm19") _,
319+
out("xmm20") _, out("xmm21") _, out("xmm22") _, out("xmm13") _,
320+
out("xmm24") _, out("xmm25") _, out("xmm26") _, out("xmm27") _,
321+
out("xmm28") _, out("xmm29") _, out("xmm30") _, out("xmm31") _,
316322
)
317323
}
318324
}

0 commit comments

Comments
 (0)