.
.
.
.
.
.
.
.
.
.
.
.
Functions called by the Asmexpand ocaml file, inspired and adapted from Asmblockgen.v
Recognition of integer immediate arguments for indexed memory accesses.
-
For 32-bit integers, immediate offsets are (-2^12,2^12) for ARM classic
and (-2^8,2^12) for Thumb2.
-
For 8- and 16-bit integers, immediate offsets are (-2^8,2^8).
-
For 32- and 64-bit integers, immediate offsets are multiples of 4
in (-2^10,2^10).
For all 3 kinds of accesses, we provide not a recognizer but a synthesizer:
a function taking an arbitrary offset
n and returning a valid offset
n'
that contains as many useful bits of
n as possible, so that the
computation of the remainder
n - n' is as simple as possible.
In particular, if
n is a representable immediate argument, we should have
n' = n.
Post-incremented double load/store: the Asmblock peephole only
produces these in Thumb mode and in canonical orientation (chk1 at
offset 0, chk2 at offset 4). ARM-mode lowering would require the
chunk-swap logic of gen_load_double/gen_store_double, which we
do not implement here; the OCaml peephole oracle is responsible for
not producing the post-incremented forms in ARM mode.