diff --git a/macros/README.md b/macros/README.md index 2941a4b..3245a13 100644 --- a/macros/README.md +++ b/macros/README.md @@ -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. diff --git a/not_written_yet.md b/not_written_yet.md index 796c1a5..6d24362 100644 --- a/not_written_yet.md +++ b/not_written_yet.md @@ -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,