A minor version of the Jasmin compiler is available. It features a handful of bug fixes and a few important changes that are summarized below. More details can be accessed through the CHANGELOG.

Stack layout

There are two new ways of controlling the layout of stack memory. First, each declaration of local “stack” variables can be annotated with an “overlay”. This is a named region of the stack that all variables sharing the same overlay annotation are allocated within this region. This enables sharing of stack space between variables of different sizes.

How large is the area reserved in the stack frame of any export function for saving the contents of callee-saved registers is controlled by the callee_saved annotation. Default value is inferred according to a heuristic that may be selected through the -callee-saved command-line argument of the jasminc compiler. The default is to run register allocation in order to provide a tight estimate.

Register allocation

The register allocation honors the inplace annotation on instructions with a single output: the first source operand and the destination shall be the same register.

Alignment

There are a few changes regarding hypotheses made by the language and compiler regarding alignment of memory accesses, in particular the ones that are expressed at the source level as array accesses. The purpose of this change is, with no impact on the generated assembly, to increase the guaranties provided by the compiler-correctness theorem: it applies to more program and to more executions of these programs.

The annotations #aligned and #unaligned are now documented. The #copy operator no longer incurs any alignment constraint. Array accesses are no longer required to be aligned by default; the compiler nonetheless tries to layout the stack frames such that accesses to the stack memory are aligned.

Finally, if an export functions requires for its safety some non-trivial alignment of the arrays that it receives as argument, which due to the changes summarized above seldom occurs, said requirements must be documented through the required_alignment annotation.

Tooling

The linter now checks that inline variable does not depend on values that are not known until run-time.

The constant-time checker in “DOIT” mode accepts more programs on x86_64: the list of safe instructions has been revised and now notably includes byte swaps, rotations, and double-precision shifts.

Other

Definitions of type aliases can be annotated. These annotations are inherited by declarations of variables with these types.

Instructions SXTB and SXTH are now available on arm-m4.