Yeah, BGBCC already implements _BitInt(N) ...
Semantics are mostly that it either represents the value as one of the
supported native types, or as a large value-type object (for N larger
than 128 bits; with storage padded to a multiple of 128 bits).
Though, FWIW:
BGBCC also implements "short float" as a way to specify scalar Binary16
values.
Though, with the funkiness that Binary16 is 16-bit in memory, but
represented using Binary64 in registers (and in non-aliased local
variables), which has a non-zero risk of funky semantic effects (due to
the much larger dynamic range and precision).
Similar also applies for "float", where in both cases the size and
format of the in-memory representation depends on whether or not someone
took the address of the variable.
However, the difference is large enough that, where, a calculation
performed using Binary16 may produce "noticeably different" results from
one calculated using Binary64 being passed off as Binary16.
For now, had mostly been hand-waving this has been "not really too much
of an issue in practice".
This differs when using SIMD ops, where intermediate results are
actually stored in the specified formats.
There is not currently any C type for FP8 formats (FP8U or FP8S), but I
could potentially add these, say, maybe __float8u_t, __float8s_t.
Though, the use-case for scalar FP8 is unclear, existing use-cases as
mostly as a space-saving alternative to Binary16 vectors.
These could be added as-is with existing instructions, they would mostly
just require 3-op load/store sequences (byte load/store with two
converter ops).
Though, FP8U is used as one of the texture-formats for my LDTEX instruction.
Previously I was going to use RGB30A, but:
FP8U is cheaper to encode/decode than RGBA30A;
For textures with an alpha-channel, FP8U has better quality;
The loss of quality and dynamic range for opaque textures is minor.
FP8U is limited to positive values, but this isn't likely a big issue
for textures. In theory, it is still possible to use RGBA64F textures
for negative pixels.
However, at present, there is no direct (C level) support for FP8 values
(but whether or not they would be useful enough to justify actual types
is debatable, compiler intrinsics being "good enough").
Started debating for a moment whether A-law support could be added, but
this is a little too niche (at most it would maybe justify an intrinsic,
even this is debatable). Encoding A-law via going through the FPU could
probably be faster than the current process of doing it via integer ops
though.
...