update hosts for cored target

WIP: currently the hosts are not generic and don't support different
targets
This commit is contained in:
2026-04-07 20:22:12 +02:00
parent 39d2e1c51f
commit 28a3c37d41
8 changed files with 350 additions and 80 deletions

View File

@ -0,0 +1,45 @@
#include "../lib.h"
#include "../lib_cored.h"
static enc_t cored_res;
static enc_t filter_out[FILTER_COUNT];
void init_outputs(plain_t x_c, plain_t y_c, plain_t z_c) {
/* Replicated Filtersteps */
XC = encode(x_c, THE_A, SIG_X);
YC = encode(y_c, THE_A, SIG_Y);
ZC = encode(z_c, THE_A, SIG_Z);
}
enc_t INLINE apply(enc_t vc, sign_t bdyn) {
if (bdyn > SIG_MAX) {
fail_marker_detected();
}
return vc + bdyn;
}
sign_t wasm_module(void) {
if (equals(XC, YC, SIG_X, SIG_Y)) {
if (equals(XC, ZC, SIG_X, SIG_Z)) {
cored_res = apply(XC, (XC - YC) + (XC - ZC));
return SIG_s_XYZ;
} else {
cored_res = apply(XC, (XC - YC));
return SIG_s_XY;
}
} else if (equals(YC, ZC, SIG_Y, SIG_Z)) {
cored_res = apply(YC, (YC - ZC));
return SIG_s_YZ;
} else if (equals(XC, ZC, SIG_X, SIG_Z)) {
cored_res = apply(XC, (XC - ZC));
return SIG_s_XZ;
} else {
fail_marker_detected();
return 0;
}
}
enc_t get_cored_res() { return cored_res; }
// enc_t get_xc() { return XC; }
// enc_t get_yc() { return YC; }
// enc_t get_zc() { return ZC; }