Proofing pass: macros/README, not_written_yet — doc MOD, fix variadic xref

- macros/README.md
  - Add ### MOD section documenting the previously-undocumented MOD
    macro (src_a, src_b, dest, scratch → sdiv/msub composition).
    Canonical apple-linux-convergence.S has defined MOD since at least
    the sync-script enforcement work (3144bc6); README drifted from it.
  - Rewrite variadic cross-reference to link BOTH more/varargs/README.md
    (the dedicated chapter) and more/apple_silicon/README.md (the
    Apple/Linux divergence discussion). Original pointed only at
    apple_silicon, which undersold the standalone varargs chapter.
  - Grammar: "Thank you to u/TNorthover for nudge" → "for the nudge".

- not_written_yet.md
  - Capitalize GitHub.

Rejected alternatives: (a) removing MOD from canonical instead of
documenting it — rejected per author direction, MOD is useful; (b)
repointing the variadic link to varargs only — rejected, the Apple
Silicon page's divergence discussion remains directly relevant in the
macros context.

Proofing status (NAS): LICENSE.md and not_written_yet.md flipped to
[reviewed]; macros/README.md flipped to [revised].
This commit is contained in:
Perry Kivolowitz 2026-04-19 10:41:48 -05:00
parent 4805083a87
commit 8db2733883
2 changed files with 21 additions and 5 deletions

View file

@ -68,8 +68,10 @@ Functions such as `printf()` do not have fixed signatures. That is, they
may accept a variable number of parameters of varying types. Linux and
Apple Silicon handle these functions quite differently.
This is [explained at length in the chapter on variadic
functions](../more/apple_silicon/README.md).
This is covered in the dedicated [chapter on variadic
functions](../more/varargs/README.md) and in the [Apple Silicon
chapter](../more/apple_silicon/README.md), which details how
Apple and Linux diverge.
## Macros of general use
@ -114,8 +116,8 @@ the macro performs a `cmp` which subtracts `src_b` from `src_a`
(discarding the results) in order to set the flags to be interpreted by
the following `csel`.
Thank you to u/TNorthover for nudge to add the cmp directly into the
macro.
Thank you to u/TNorthover for the nudge to add the cmp directly into
the macro.
Signature:
@ -129,6 +131,20 @@ Signature:
The larger of `src_a` and `src_b` is put into `dest`.
### MOD
AARCH64 has no single modulo instruction. This macro composes the
standard `sdiv` / `msub` pair to produce `src_a mod src_b`. A caller-
supplied scratch register is required because the quotient must be
materialized before the multiply-subtract step.
Signature:
`MOD src_a, src_b, dest, scratch`
On completion, `dest` holds `src_a mod src_b`; `scratch` is
clobbered.
### Mark a label as global
Makes a label available externally.

View file

@ -2,7 +2,7 @@
You've landed on a placeholder page.
Please leave a comment here on github indicating which
Please leave a comment here on GitHub indicating which
material you're anxious to have covered.
Thank you,