Indices and tables

Todo list


Clarify the representation of larger boolean types.

The multi-bit boolean types can be interpreted in different ways. We could declare that zero means false and non-zero means true. This may require unwanted normalization code in some places.

We could specify a fixed encoding like all ones for true. This would then lead to undefined behavior if untrusted code uses the multibit booleans incorrectly.

Something like this:

  • External code is not allowed to load/store multi-bit booleans or otherwise expose the representation.
  • Each target specifies the exact representation of a multi-bit boolean.

(The original entry is located in /home/docs/checkouts/, line 103.)


Define safe indirect function calls.

The call_indirect instruction is dangerous to use in a sandboxed environment since it is not easy to verify the callee address. We need a table-driven indirect call instruction, similar to br_table.

(The original entry is located in /home/docs/checkouts/, line 415.)


Larger multiplication results.

For example, smulx which multiplies i32 operands to produce a i64 result. Alternatively, smulhi and smullo pairs.

(The original entry is located in /home/docs/checkouts/, line 615.)


Integer remainder vs modulus.

Clarify whether the result has the sign of the divisor or the dividend. Should we add a smod instruction for the case where the result has the same sign as the divisor?

(The original entry is located in /home/docs/checkouts/ of base.instructions.srem, line 5.)


Minimum / maximum.

NEON has smin, smax, umin, and umax instructions. We should replicate those for both scalar and vector integer types. Even if the target ISA doesn’t have scalar operations, these are good pattern matching targets.

(The original entry is located in /home/docs/checkouts/, line 629.)


Saturating arithmetic.

Mostly for SIMD use, but again these are good patterns for contraction. Something like usatadd, usatsub, ssatadd, and ssatsub is a good start.

(The original entry is located in /home/docs/checkouts/, line 636.)


Redundant bitwise operators.

ARM has instructions like bic(x,y) = x & ~y, orn(x,y) = x | ~y, and eon(x,y) = x ^ ~y.

(The original entry is located in /home/docs/checkouts/, line 658.)