interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / tests / native / reference.c

21 lines · 1387 bytes Raw Blame History
1/* A hand-written statement of the seven test units' exported C signatures, from the contract in
2 * docs/NATIVE-ABI.md and the units' Omega signature lines, independent of the generator.
3 * tests/native/run.sh compiles this file with the generated omega_native.h included first: if the
4 * generator's declarations disagree with these, the compiler reports conflicting types. */
5#include <stdint.h>
6
7/* fn madd a ulong b ulong c ulong to ulong */
8uint32_t omega_madd(uint64_t *result, uint64_t a, uint64_t b, uint64_t c);
9/* fn smadd a long b long c long to long */
10uint32_t omega_smadd(uint64_t *result, uint64_t a, uint64_t b, uint64_t c);
11/* fn fill buf edit ulong 4 k ulong to ulong */
12uint32_t omega_fill(uint64_t *result, void *buf, uint64_t buf_len, uint64_t k);
13/* fn spin n ulong to ulong */
14uint32_t omega_spin(uint64_t *result, uint64_t n);
15/* fn mix a ulong b long c view uchar 3 d edit uchar 2 e view ulong 2 f ulong to void */
16uint32_t omega_mix(uint64_t *result, uint64_t a, uint64_t b, const void *c, uint64_t c_len, void *d, uint64_t d_len,
17 const void *e, uint64_t e_len, uint64_t f);
18/* fn big n ulong to ulong */
19uint32_t omega_big(uint64_t *result, uint64_t n);
20/* fn hsum a view uchar 4 b ulong to ulong (its last function; the two before it are private helpers) */
21uint32_t omega_hsum(uint64_t *result, const void *a, uint64_t a_len, uint64_t b);