Note also that the 'mul' instruction is described in the Arm docs the article links to as an "alias" of madd. That is, the CPU itself has no pure multiply-only insn at all, only a multiply-and-add. When you write 'mul' in assembly, the assembler turns it into a 'madd' where the register to add is XZR (the reads-as-zero register).
There are a fair number of insns in the A64 instruction set that make use of this trick to provide one flexible instruction that as a special case provides useful simpler functionality under an alias. (Register-to-register 'mov' being an alias of 'orr' is another.)
RISC-V similarly has a ton of these aliased instructions.
Re:How to Read ARM64 Assembly Language
by tom_mellior on Monday March 15, 2021 @10:28AM
(#26466456)
> relatively common operation of computing the address of a field of a struct in an array
This is only relatively common inside loops. Inside loops you will usually index with the loop counter or some other value that is derived from it linearly. Compilers will typically use induction variable arithmetic that doesn't involve multiplication.
Multiply-add is a good choice because it corresponds to the relatively common operation of computing the address of a field of a struct in an array so you can operate on that field.
(e.g. &(points[5].x) is &points + (5 * sizeof(point)) + offsetof(point, x)).