reduce lifetime of e in dyArith_AA

This commit is contained in:
dzaima 2022-09-01 22:45:30 +03:00
parent 1b8bd0707e
commit 76141f6fe6
2 changed files with 7 additions and 5 deletions

View File

@ -48,7 +48,7 @@ typedef struct FnInfoAA {
u8 width; // width in bytes; unused for u_call_bit u8 width; // width in bytes; unused for u_call_bit
} FnInfoAA; } FnInfoAA;
typedef struct EntAA { typedef struct EntAA {
FnInfoAA a, b; FnInfoAA bundles[2];
} EntAA; } EntAA;
typedef struct DyTableAA { typedef struct DyTableAA {
@ -64,15 +64,17 @@ NOINLINE B dyArith_AA(DyTableAA* table, B w, B x) {
ur xr = RNK(x); ur xr = RNK(x);
if (wr!=xr || !eqShPart(SH(w), SH(x), wr)) goto rec; if (wr!=xr || !eqShPart(SH(w), SH(x), wr)) goto rec;
B r, t;
usz ia = IA(w); usz ia = IA(w);
EntAA* e = &table->entsAA[we*8 + xe]; EntAA* e = &table->entsAA[we*8 + xe];
newEnt: newEnt:
FnInfoAA* fn = &e->a; FnInfoAA* fn = &e->bundles[0];
newFn: newFn:
u8 ex = fn->ex1; u8 ex = fn->ex1;
newEx: newEx:
B r, t;
#if ARITH_DEBUG #if ARITH_DEBUG
printf("opcode %d / %s\n", ex, execAA_repr(ex)); printf("opcode %d / %s\n", ex, execAA_repr(ex));
#endif #endif
@ -96,7 +98,7 @@ NOINLINE B dyArith_AA(DyTableAA* table, B w, B x) {
u64 got = fn->cFn(m_tyarrlc(&r, fn->width, x, fn->type), tyany_ptr(w), tyany_ptr(x), ia); u64 got = fn->cFn(m_tyarrlc(&r, fn->width, x, fn->type), tyany_ptr(w), tyany_ptr(x), ia);
if (got==ia) goto decG_ret; if (got==ia) goto decG_ret;
decG(r); decG(r);
fn = &e->b; fn++;
goto newFn; goto newFn;
} }
case u_call_rbyte: { case u_call_rbyte: {

View File

@ -124,7 +124,7 @@ Make ← {𝕊ns:
@""{",.uFn"",.cFn"˜ttmCheckedFn,"=",𝕩} fn @""{",.uFn"",.cFn"˜ttmCheckedFn,"=",𝕩} fn
}¨ instrs }¨ instrs
" [",•Repr we,"*8+",•Repr xe,"] = {{", i0, "}, {", i1, "}},", nl " [",•Repr we,"*8+",•Repr xe,"] = {{{", i0, "}, {", i1, "}}},", nl
} }
}¨ T instrs 88 }¨ T instrs 88
" },", nl " },", nl