SBBE has an extremely simple type system, putting the onus on the frontend to ensure that types are used correctly. There are no user-defined types, no structs or arrays, and no type qualifiers (like const or volatile). The type system is designed to be as simple as possible while still being able to represent the necessary data for most programs.

TypeSizeDescription
i81 byte8-bit integer
i162 bytes16-bit integer
i324 bytes32-bit integer
i648 bytes64-bit integer
f324 bytes32-bit IEEE 754 float
f648 bytes64-bit IEEE 754 float
ptrtarget4 bytes (32-bit) or 8 bytes (64-bit)
v12816 bytes128-bit SIMD vector
void0No value (return types only)

Integers

You can use i8, i16, i32, and i64 for all integer types. Signedness is encoded into instructions (either through mnemonic macros or dedicated opcodes) rather than the type, so i32 is a single type used by both signed and unsigned instructions.

Future versions of SBBE may add additional integer types (like i128 or i256) or the ability to define custom integer types, like i9, i24, etc…

Floating Point

You can use f32 and f64 for 32-bit and 64-bit floating point types, respectively. These types follow the IEEE 754 standard for floating point representation. The f16 type is not currently supported, but is planned as part of our GPU support effort.

Pointers

The ptr type is used for pointers and addresses. It is a target-sized type, meaning it will be 32 bits on a 32-bit target and 64 bits on a 64-bit target. The ptr type is opaque and does not have any associated operations other than loading and storing values from memory. Pointer arithmetic and other operations are handled through dedicated instructions rather than being encoded into the type system.

Vectors

The v128 type represents a 128-bit SIMD vector. The interpretation of the lanes (e.g., 4x i32, 2x f64, 16x i8) is determined by the instruction operating on the vector, not by the type itself. This follows the same philosophy as integer signedness: the type is just a bag of bits, and the instruction gives it meaning.

SIMD instructions use lane descriptors like i32x4 or f64x2 to specify how the 128 bits are partitioned. These are not types in the SBBE type system. They are instruction operands encoded in the argument field, similar to how scalar instructions encode their type. A v128 value on the stack has no inherent lane layout; you can operate on the same value as i32x4 in one instruction and f32x4 in the next.

DescriptorLanesLane width
i8x16168-bit integer
i16x8816-bit integer
i32x4432-bit integer
i64x2264-bit integer
f32x4432-bit float
f64x2264-bit float

See the Instruction Set page for the full list of SIMD instructions.

Void

The void type is used exclusively in function signatures to indicate that a function does not return a value. It cannot appear on the operand stack, in variable declarations, or in the constant table.