hex.add_mul (arity 2)¶
res += x * dst + carry_dst — one shift-and-add (multiply-accumulate) step used by hex.mul. Reads/writes the global multiplication carry.
Signature¶
def add_mul res, x @ ret < .mul.dst, .add.dst, .mul.ret, .tables.res { ... }
Defined in hex/mul.fj — lines 8–16 (view on GitHub).
Complexity¶
Time:
5@+26Space:
4@+52
See the complexity glossary for what @, w, dw, dbit, n mean.
Requires init¶
The following must be initialised before this macro is invoked:
hex.add.init (or hex.init)
Source¶
Click to view the macro body
def add_mul res, x @ ret < .mul.dst, .add.dst, .mul.ret, .tables.res {
.xor .mul.dst+4, x
.xor .add.dst, res
wflip .mul.ret+w, ret, .mul.dst
pad 4
ret: // meanwhile - make @+24 fj ops there
wflip .mul.ret+w, ret
.xor_zero res, .tables.res
}
Depends on¶
Next: hex.add_mul/4 →