From 535d83f71c0ffa08f302ffe7dba42b4bb7d104c4 Mon Sep 17 00:00:00 2001 From: Drake Stapleton <213298340+drakestapleton@users.noreply.github.com> Date: Fri, 20 Nov 2026 16:08:53 -0600 Subject: [PATCH] Move OSC control flow analysis and IR block layout into Omega --- CONTRIBUTORS.md | 1 + mk/compiler.mk | 10 +- om/compiler/osc_flow.om | 253 ++++++++++++++++++ om/units.sh | 4 +- src/compiler/osc_check.c | 33 +-- src/compiler/osc_ir.c | 85 +++--- src/compiler/osc_lower.c | 16 +- src/omega_api_decl.h | 15 ++ src/omega_native.h | 10 + src/omega_om_units.c | 153 +++++++++++ src/omega_om_units.ident | 1 + .../compiler/neg/flow_return_from_regions.osc | 10 + tests/compiler/neg/flow_zero_trip_return.osc | 6 + tests/compiler/test_osc_flow.c | 46 ++++ 14 files changed, 572 insertions(+), 71 deletions(-) create mode 100644 om/compiler/osc_flow.om create mode 100644 tests/compiler/neg/flow_return_from_regions.osc create mode 100644 tests/compiler/neg/flow_zero_trip_return.osc create mode 100644 tests/compiler/test_osc_flow.c diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d8cc22c76..be752b1ee 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -378,3 +378,4 @@ Update this table in the same commit as the work it credits. | Codex (under Drake Stapleton's direction) | Rewrote lexical scope destruction in Omega, including nested borrow closure, conditional owner release, arena escape and pool teardown. | | Codex (under Drake Stapleton's direction) | Converted OSC handle provenance, stale read/write/free decisions, branch snapshots and loop settlement to seeded Omega. | | Codex (under Drake Stapleton's direction) | Converted OSC owner and borrow snapshots, rollback of fresh borrows, branch joins and move replay to seeded Omega. | +| Codex (under Drake Stapleton's direction) | Migrated OSC statement reachability, return-path analysis, IR block layout and partition validation, and definite-assignment propagation to seeded Omega. | diff --git a/mk/compiler.mk b/mk/compiler.mk index 3400b46b3..e1aa3e448 100644 --- a/mk/compiler.mk +++ b/mk/compiler.mk @@ -38,7 +38,15 @@ $(OSC_DIR)/test_osc_lex: $(OSC_LEX_TEST_SRC) $(OSC_HDRS) src/omega_api_decl.h test-osc-lex: $(OSC_DIR)/test_osc_lex @$(OSC_DIR)/test_osc_lex $(OSC_LEX_FIXTURES) -test-compiler test-compiler-quick: test-osc-lex +$(OSC_DIR)/test_osc_flow: tests/compiler/test_osc_flow.c $(OSC_LIB) $(OSC_HDRS) src/omega_native.h + @mkdir -p $(OSC_DIR) + $(CC) $(OSC_CFLAGS) -Wl,--wrap=mmap -o $@ $< $(OSC_LIB) + +.PHONY: test-osc-flow +test-osc-flow: $(OSC_DIR)/test_osc_flow + @$(OSC_DIR)/test_osc_flow + +test-compiler test-compiler-quick: test-osc-lex test-osc-flow # Optional differential run for source checkouts with Git history. Compile the # last all-C parser independently and keep it out of the production link. diff --git a/om/compiler/osc_flow.om b/om/compiler/osc_flow.om new file mode 100644 index 000000000..a0e455bcd --- /dev/null +++ b/om/compiler/osc_flow.om @@ -0,0 +1,253 @@ +note SPDX-License-Identifier: Apache-2.0 +note OSC statement reachability and IR basic-block partitioning. +note bridge c-define OSC_FLOW_RETURNS 1 +note bridge c-define OSC_FLOW_UNREACHABLE 2 +note bridge c-define OSC_BLOCK_BAD_RANGE 1 +note bridge c-define OSC_BLOCK_OVERLAP 2 +note bridge c-define OSC_BLOCK_NO_TERMINATOR 3 +note bridge c-define OSC_BLOCK_EARLY_TERMINATOR 4 +note bridge c-define OSC_BLOCK_UNCOVERED 5 +om2 + +const node_size ulong 104 +const block_node ulong 3 +const if_node ulong 10 +const while_node ulong 11 +const for_node ulong 12 +const return_node ulong 13 +const arena_node ulong 27 +const pool_node ulong 28 +const absent ulong 4294967295 +const ir_insn_size ulong 48 +const ir_br uchar 13 +const ir_ret uchar 15 + +fn read_le bytes view uchar * pos ulong width ulong to ulong + value = ulong 0 + for i ulong width + value = or value shl ulong get bytes add pos i mul i 8 + end + ret value +end + +fn summarize_stmt nodes view uchar * id ulong flow edit uchar * to void + base = mul id node_size + kind = read_le nodes base 2 + returns = uchar 0 + if eq kind return_node + returns = 1 + end + if or eq kind arena_node eq kind pool_node + returns = get flow read_le nodes add base 16 4 + end + if eq kind if_node + other = read_le nodes add base 20 4 + if ne other absent + then_id = read_le nodes add base 16 4 + returns = and get flow other get flow then_id + end + end + if eq kind block_node + stmt = read_le nodes add base 12 4 + while ne stmt absent + if ne returns 0 + put flow stmt or get flow stmt uchar 2 + else + returns = get flow stmt + end + stmt = read_le nodes add mul stmt node_size 24 4 + end + end + put flow id returns +end + +note Visit only statements, recording parents before their children. Reversing +note this order computes each child's return status before its parent needs it. +note A loop may execute zero times even if its entire body returns. +export fn osc_statement_flow nodes view uchar * order edit ulong * flow edit uchar * to void +requires eq len nodes mul len flow node_size +requires ge len order len flow + note The caller puts the function body in order[0]. + count = ulong 1 + cursor = ulong 0 + while lt cursor count + base = mul get order cursor node_size + cursor = add cursor 1 + kind = read_le nodes base 2 + if eq kind block_node + stmt = read_le nodes add base 12 4 + while ne stmt absent + put order count stmt + count = add count 1 + stmt = read_le nodes add mul stmt node_size 24 4 + end + else + loop_body = or eq kind while_node eq kind for_node + region_body = or eq kind arena_node eq kind pool_node + if or eq kind if_node or loop_body region_body + put order count read_le nodes add base 16 4 + count = add count 1 + if eq kind if_node + other = read_le nodes add base 20 4 + if ne other absent + put order count other + count = add count 1 + end + end + end + end + end + for step ulong count + id = get order sub sub count 1 step + summarize_stmt nodes id flow + end +end + +fn check_block insns view uchar * cover edit uchar 4096 first ulong count ulong location edit ulong 1 to ulong + if or eq count 0 gt add first count div len insns ir_insn_size + ret 1 + end + for offset ulong count + i = add first offset + if ne get cover i 0 + put location 0 i + ret 2 + end + put cover i 1 + op = get insns mul i ir_insn_size + term = and ge op ir_br le op ir_ret + if eq add offset 1 count + if eq term false + ret 3 + end + else + if term + ret 4 + end + end + end + ret 0 +end + +note Block order determines the first diagnostic. Report its block index for a +note bad range or terminator and its instruction index for a coverage error. +export fn osc_block_partition blocks view uchar * insns view uchar * location out ulong 1 to ulong +requires eq rem len blocks 8 0 +requires eq rem len insns ir_insn_size 0 +requires le div len insns ir_insn_size 4096 + cover = new uchar 4096 0 + ninsns = div len insns ir_insn_size + for b ulong div len blocks 8 + base = mul b 8 + first = read_le blocks base 4 + count = read_le blocks add base 4 4 + put location 0 b + failure = check_block insns cover first count location + if ne failure 0 + ret failure + end + end + for i ulong ninsns + if eq get cover i 0 + put location 0 i + ret 5 + end + end + put location 0 0 + ret 0 +end + +note Each transfer record holds a block's generated register bitset followed +note by its two successor indices, with the block count meaning no successor. +note Propagate IN union GEN along each edge. Intersection at the destination +note retains only registers defined on every incoming path. +fn meet_words inputs edit ulong * generated view ulong * source ulong dest ulong to bool + changed = false + for k ulong len generated + outgoing = or get inputs add source k get generated k + old = get inputs add dest k + restricted = and old outgoing + if ne restricted old + put inputs add dest k restricted + changed = true + end + end + ret changed +end + +fn meet_edge inputs edit ulong * record view ulong * source ulong successor ulong to bool + width = sub len record 2 + target = get record add width successor + if eq target div len inputs width + ret false + end + ret meet_words inputs part record 0 width source mul target width +end + +export fn osc_definite_inputs transfers view ulong * inputs edit ulong * params ulong width ulong to void +requires gt width 0 +requires eq rem len inputs width 0 +requires ge len inputs width +requires eq len transfers mul div len inputs width add width 2 +requires le params 6 + blocks = div len inputs width + for i ulong len inputs + put inputs i 0xffffffffffffffff + end + for k ulong width + put inputs k 0 + end + put inputs 0 sub shl ulong 1 params 1 + changed = true + while changed + changed = false + for b ulong blocks + record = mul b add width 2 + for successor ulong 2 + if meet_edge inputs part transfers record add width 2 mul b width successor + changed = true + end + end + end + end +end + +fn copy_insn source view ulong 24576 dest edit ulong 24576 src ulong dst ulong to void + for k ulong 6 + put dest add dst k get source add src k + end +end + +note Stable counting sort of emitted instructions by block, preserving both +note block creation order and instruction emission order within each block. +export fn osc_layout_blocks tags view short * source view ulong 24576 dest edit ulong 24576 blocks edit uint 1024 nblocks ulong to void +requires le nblocks 512 +requires le len tags 4096 + for i ulong len tags + label = get tags i + if or lt label 0 ge long label long nblocks + trap 3 + end + end + for b ulong nblocks + put blocks add mul b 2 1 0 + end + for i ulong len tags + pos = add mul ulong get tags i 2 1 + put blocks pos add get blocks pos 1 + end + first = uint 0 + for b ulong nblocks + pos = mul b 2 + put blocks pos first + first = add first get blocks add pos 1 + put blocks add pos 1 0 + end + for i ulong len tags + pos = mul ulong get tags i 2 + count = get blocks add pos 1 + dst = mul ulong add get blocks pos count 6 + put blocks add pos 1 add count 1 + copy_insn source dest mul i 6 dst + end +end diff --git a/om/units.sh b/om/units.sh index 2b6801dde..bb27f4047 100755 --- a/om/units.sh +++ b/om/units.sh @@ -28,7 +28,7 @@ NATIVE_PIN=2c1bf63798336e899704217d98f909b31e567289650751a55d83255c7eb8f27d ROOT=$(cd "$(dirname "$0")/.." && pwd) # One generated library for all units: the bindings share one ABI runtime (ombr_enter). # om/encoder/bw_enc_sm121.om: the sm_121 instruction encoder, twin of aien-dev/CUDApp's (mk/om-encoder.mk). -UNITS="${OMEGA_UNITS:-om/sha256/sha256-om2.om om/blake3/b3unit.om om/encoder/bw_enc_sm121.om om/gpu/bw_qmd.om om/gpu/bw_sched.om om/gpu/q38_plan.om om/gpu/cg_pf.om om/gpu/cg_bf16.om om/gpu/cg_gemm.om om/gpu/cg_moe2.om om/gpu/cg_moe.om om/gpu/cg_qmma.om om/gpu/cg_pfhost.om om/gpu/cg_gpu_attn.om om/runtime/rx_regulate.om om/runtime/rx_mid.om om/runtime/rx_cortex_rec.om om/runtime/rx_plan_core.om om/runtime/rx_projection.om om/runtime/rx_capq_core.om om/runtime/rx_costmodel_core.om om/runtime/rx_route_core.om om/runtime/rx_world_core.om om/runtime/rx_skillroute_core.om om/runtime/rx_fusion_core.om om/compiler/osc_literal.om om/compiler/osc_type.om om/compiler/osc_expr.om om/compiler/osc_scalar.om om/compiler/osc_a64_fields.om om/compiler/osc_statement.om om/compiler/osc_ownership.om om/compiler/osc_scope.om om/compiler/osc_pool.om om/compiler/osc_trace.om om/compiler/osc_lifetimes.om src/tensor/tensor_shape.om src/train/sgd_update.om}" +UNITS="${OMEGA_UNITS:-om/sha256/sha256-om2.om om/blake3/b3unit.om om/encoder/bw_enc_sm121.om om/gpu/bw_qmd.om om/gpu/bw_sched.om om/gpu/q38_plan.om om/gpu/cg_pf.om om/gpu/cg_bf16.om om/gpu/cg_gemm.om om/gpu/cg_moe2.om om/gpu/cg_moe.om om/gpu/cg_qmma.om om/gpu/cg_pfhost.om om/gpu/cg_gpu_attn.om om/runtime/rx_regulate.om om/runtime/rx_mid.om om/runtime/rx_cortex_rec.om om/runtime/rx_plan_core.om om/runtime/rx_projection.om om/runtime/rx_capq_core.om om/runtime/rx_costmodel_core.om om/runtime/rx_route_core.om om/runtime/rx_world_core.om om/runtime/rx_skillroute_core.om om/runtime/rx_fusion_core.om om/compiler/osc_literal.om om/compiler/osc_type.om om/compiler/osc_expr.om om/compiler/osc_scalar.om om/compiler/osc_a64_fields.om om/compiler/osc_statement.om om/compiler/osc_ownership.om om/compiler/osc_scope.om om/compiler/osc_pool.om om/compiler/osc_trace.om om/compiler/osc_lifetimes.om om/compiler/osc_flow.om src/tensor/tensor_shape.om src/train/sgd_update.om}" # The units the freestanding GPU link needs (the encoder, codegen, matmul and realize files hash with sha256_*; qmd packs QMDs). FS_UNITS="om/sha256/sha256-om2.om om/gpu/bw_qmd.om om/gpu/cg_gpu_attn.om" DEST="${OMEGA_UNITS_DEST:-$ROOT/src}" @@ -48,7 +48,7 @@ for u in $UNITS; do { cat "$src"; printf '\0'; printf '%08d' "$(wc -c < "$T/u.bin")"; cat "$T/u.bin" [ $abi = 1 ] || printf 'omega-unit %s %s\n' "$name" "$OMC_PIN"; } > "$T/u.in" cat "$T/u.in" >> "$T/units.in" - if [ "$src" -ef "$ROOT/src/tensor/tensor_shape.om" ]; then + if [ "$src" -ef "$ROOT/src/tensor/tensor_shape.om" ] || [ "$src" -ef "$ROOT/om/compiler/osc_flow.om" ]; then cat "$T/u.in" >> "$T/leaf.in" else cat "$T/u.in" >> "$T/host.in" diff --git a/src/compiler/osc_check.c b/src/compiler/osc_check.c index d9d402910..f0cba0e6c 100644 --- a/src/compiler/osc_check.c +++ b/src/compiler/osc_check.c @@ -93,7 +93,7 @@ typedef struct { int nobj; int nbor; int loop_depth; - int term; /* current path has returned */ + uint8_t *flow; /* per-statement reachability from osc_statement_flow */ char sobj[64]; /* statement object (diagnostics) */ int contract; /* 0 body; 1 checking a requires clause; 2 an ensures clause (OSC-2) */ int cond_depth; /* OSC-2 arenas: nesting of if/else branches */ @@ -1472,25 +1472,23 @@ static int chk_if(C *c, int i) if (!h0) { cap_fail(c, n->line, "checker memory"); goto out; } tr_control(c, OSC_TR_SAVE, n->line); if (chk_block(c, n->b, 1)) goto out; - int t1 = c->term; + int t1 = c->flow[n->b] & OSC_FLOW_RETURNS; s1 = snap_take(c); h1 = hs_take(c); if (!s1 || !h1) { cap_fail(c, n->line, "checker memory"); goto out; } tr_control(c, OSC_TR_RESTORE, n->line); snap_restore(c, s0); osc_handles_restore(&c->handles, h0, 1); - c->term = 0; int t2 = 0; if (n->c >= 0) { tr_control(c, OSC_TR_SAVE, n->line); if (NODE(n->c)->kind == ON_IF) { if (chk_if(c, n->c)) goto out; } else if (chk_block(c, n->c, 1)) goto out; - t2 = c->term; + t2 = c->flow[n->c] & OSC_FLOW_RETURNS; tr_control(c, OSC_TR_RESTORE, n->line); } /* state after else is in c; after then is s1 */ if (t1 && t2) { - c->term = 1; rc = 0; goto out; } @@ -1514,7 +1512,6 @@ static int chk_if(C *c, int i) if (sym >= 0) NODE(c->sym[sym].decl)->dflag = 1; } } - c->term = 0; /* re-emit moves that hold after the if */ if (c->tr && nobj0) { int32_t ids[OSC_CHECK_MAX_OBJS]; @@ -1563,7 +1560,6 @@ static int chk_loop_body(C *c, OscNode *n, int is_for) * entry, then settle handle assignments against the body that ran. */ osc_handles_restore(&c->handles, h0, 0); hs_settle(c, h0, NULL, n->line); - c->term = 0; rc = 0; out: snap_free(c, s0); @@ -1844,7 +1840,6 @@ static int chk_stmt(C *c, int i) if (chk_return_ensures(c, n)) return -1; } if (scope_exit_events(c, c->names.depth, n->line, n)) return -1; - c->term = 1; return 0; } case ON_ARENA: { /* OSC-2: arena NAME bound K { body } */ @@ -1862,7 +1857,7 @@ static int chk_stmt(C *c, int i) tr_region(c, OSC_EV_REGION_OPEN, -1, y->region, n->line, 0); if (chk_block(c, n->b, 1)) return -1; /* destroy after the body's own scope exit (its owners and borrows end first) */ - if (!c->term && scope_exit_events(c, 1, (uint32_t)NODE(n->b)->ival, n)) return -1; + if (!(c->flow[n->b] & OSC_FLOW_RETURNS) && scope_exit_events(c, 1, (uint32_t)NODE(n->b)->ival, n)) return -1; pop_scope(c); return 0; } @@ -1876,7 +1871,7 @@ static int chk_stmt(C *c, int i) osc_pool_init(&y->slots, (uint16_t)n->ival, (uint64_t)n->lo, c->loop_depth, c->cond_depth); n->sym = s; if (chk_block(c, n->b, 1)) return -1; - if (!c->term && scope_exit_events(c, 1, (uint32_t)NODE(n->b)->ival, n)) return -1; + if (!(c->flow[n->b] & OSC_FLOW_RETURNS) && scope_exit_events(c, 1, (uint32_t)NODE(n->b)->ival, n)) return -1; pop_scope(c); return 0; } @@ -1927,14 +1922,14 @@ static int chk_block(C *c, int i, int new_scope) OscNode *n = NODE(i); if (new_scope && push_scope(c, n->line)) return -1; for (int s = n->a; s >= 0; s = NODE(s)->next) { - if (c->term) { + if (c->flow[s] & OSC_FLOW_UNREACHABLE) { osc_diag_set(c->d, OSC_DIAG_UNSUPPORTED, NODE(s)->line, NODE(s)->col, "return", 0, NULL, "unreachable statement", "statement after 'return' is unreachable"); return -1; } if (chk_stmt(c, s)) return -1; } - if (!c->term && new_scope && scope_exit_events(c, 1, (uint32_t)n->ival, n)) return -1; + if (!(c->flow[i] & OSC_FLOW_RETURNS) && new_scope && scope_exit_events(c, 1, (uint32_t)n->ival, n)) return -1; if (new_scope) pop_scope(c); return 0; } @@ -1944,11 +1939,14 @@ static int chk_fn(C *c, int fi) OscAst *a = c->ast; int f = a->fns[fi]; OscNode *fn = NODE(f); + c->expr_work[0] = (uint64_t)fn->b; + osc_statement_flow((const uint8_t *)a->nodes, a->nnodes * sizeof(OscNode), + c->expr_work, c->expr_words, c->flow, a->nnodes); osc_scope_reset(&c->names); c->fi = fi; c->fnode = f; c->fret = fn->ty; - c->nsym = c->nobj = c->nbor = c->loop_depth = c->term = 0; + c->nsym = c->nobj = c->nbor = c->loop_depth = 0; c->cond_depth = 0; c->nregion = 0; c->handles.count = c->handles.nbind = 0; @@ -1990,7 +1988,7 @@ static int chk_fn(C *c, int fi) } if (chk_contracts(c, fi)) return -1; if (chk_block(c, fn->b, 1)) return -1; - if (!c->term) { + if (!(c->flow[fn->b] & OSC_FLOW_RETURNS)) { if (fn->ty.s != OSC_T_VOID) { uint32_t end = (uint32_t)NODE(fn->b)->ival; osc_diag_set(c->d, OSC_DIAG_MISSING_RETURN, end, 0, fname, fn->line, NULL, "fall off end of non-void function", @@ -2003,15 +2001,20 @@ static int chk_fn(C *c, int fi) return 0; } +_Static_assert(ON_BLOCK == 3 && ON_IF == 10 && ON_WHILE == 11 && ON_FOR == 12 && + ON_RETURN == 13 && ON_ARENA == 27 && ON_POOL == 28 && offsetof(OscNode, c) == 20, + "OSC statement flow AST layout"); + int osc_check(const OscAlloc *a, OscAst *ast, OscDiag *d, OscTrace *trace) { size_t expr_words = (size_t)ast->nnodes * 2 + 1; - size_t bytes = sizeof(C) + expr_words * sizeof(uint64_t); + size_t bytes = sizeof(C) + expr_words * sizeof(uint64_t) + ast->nnodes; C *c = a->alloc(a->ctx, bytes); if (c) { memset(c, 0, offsetof(C, sym)); c->expr_work = (uint64_t *)(c + 1); c->expr_words = expr_words; + c->flow = (uint8_t *)(c->expr_work + expr_words); } if (!c) { osc_diag_set(d, OSC_DIAG_CAPACITY, 0, 0, "unit", 0, NULL, "checker memory", "out of memory"); diff --git a/src/compiler/osc_ir.c b/src/compiler/osc_ir.c index 5f213c678..e7863e3fd 100644 --- a/src/compiler/osc_ir.c +++ b/src/compiler/osc_ir.c @@ -103,7 +103,9 @@ static bool canonical_for(OscScalar s, uint64_t v) { return v < (1ULL << w); } -static bool is_term(uint8_t op) { return op == OSC_I_BR || op == OSC_I_CBR || op == OSC_I_RET; } +_Static_assert(OSC_MAX_INSNS == 4096 && sizeof(OscInsn) == 48 && offsetof(OscInsn, op) == 0 && + sizeof(OscBlock) == 8 && offsetof(OscBlock, first) == 0 && offsetof(OscBlock, count) == 4 && + OSC_I_BR == 13 && OSC_I_CBR == 14 && OSC_I_RET == 15, "OSC block partition ABI"); /* uses / def of an instruction (for def-before-use) */ static int insn_uses(const OscInsn *in, int16_t *u) { @@ -422,23 +424,19 @@ static int validate_func(const OscAlloc *a, const OscUnit *u, int fi, char *err, if (f->nblocks < 1 || f->nblocks > OSC_MAX_BLOCKS) return vfail(err, n, "func %d: bad nblocks", fi); /* blocks partition the instruction array */ - uint8_t cover[OSC_MAX_INSNS]; - memset(cover, 0, sizeof cover); - for (int b = 0; b < f->nblocks; b++) { - const OscBlock *bl = &f->blocks[b]; - if (bl->count < 1 || (uint64_t)bl->first + bl->count > f->ninsns) - return vfail(err, n, "func %d block %d: bad range", fi, b); - for (uint32_t i = bl->first; i < bl->first + bl->count; i++) { - if (cover[i]) return vfail(err, n, "func %d: insn %u in two blocks", fi, i); - cover[i] = 1; - bool last = i == bl->first + bl->count - 1; - if (is_term(f->insns[i].op) != last) - return vfail(err, n, last ? "func %d block %d: missing terminator" : - "func %d block %d: terminator before block end", fi, b); - } + uint64_t location; + uint64_t partition = osc_block_partition((const uint8_t *)f->blocks, f->nblocks * sizeof(OscBlock), + (const uint8_t *)f->insns, f->ninsns * sizeof(OscInsn), + &location); + switch (partition) { + case 0: break; + case OSC_BLOCK_BAD_RANGE: return vfail(err, n, "func %d block %u: bad range", fi, (unsigned)location); + case OSC_BLOCK_OVERLAP: return vfail(err, n, "func %d: insn %u in two blocks", fi, (unsigned)location); + case OSC_BLOCK_NO_TERMINATOR: return vfail(err, n, "func %d block %u: missing terminator", fi, (unsigned)location); + case OSC_BLOCK_EARLY_TERMINATOR: return vfail(err, n, "func %d block %u: terminator before block end", fi, (unsigned)location); + case OSC_BLOCK_UNCOVERED: return vfail(err, n, "func %d: insn %u in no block", fi, (unsigned)location); + default: return vfail(err, n, "func %d: unknown block partition result", fi); } - for (uint32_t i = 0; i < f->ninsns; i++) - if (!cover[i]) return vfail(err, n, "func %d: insn %u in no block", fi, i); for (uint32_t i = 0; i < f->ninsns; i++) if (validate_insn(u, fi, f, i, err, n)) return -1; for (uint32_t i = 0; i < f->ninsns; i++) { @@ -520,36 +518,33 @@ static int validate_func(const OscAlloc *a, const OscUnit *u, int fi, char *err, /* definite assignment: every use reads a vreg defined on every path */ int nb = f->nblocks; - size_t bsz = sizeof(uint64_t) * BSW * (size_t)nb; - uint64_t *in = a->alloc(a->ctx, bsz), *out = a->alloc(a->ctx, bsz); - if (!in || !out) { a->free(a->ctx, in, bsz); a->free(a->ctx, out, bsz); vfail(err, n, "out of memory"); return -2; } - uint64_t params[BSW] = {0}; - for (int v = 0; v < f->nparams; v++) params[v / 64] |= 1ULL << (v % 64); - for (int b = 0; b < nb; b++) for (int k = 0; k < BSW; k++) { in[b * BSW + k] = ~0ULL; out[b * BSW + k] = ~0ULL; } - int rc = 0; - for (int changed = 1; changed;) { /* monotone decreasing: terminates */ - changed = 0; - for (int b = 0; b < nb; b++) { - uint64_t cur[BSW]; - for (int k = 0; k < BSW; k++) cur[k] = (b == 0) ? params[k] : ~0ULL; - /* meet over predecessors */ - for (int p = 0; p < nb; p++) { - const OscInsn *t = &f->insns[f->blocks[p].first + f->blocks[p].count - 1]; - bool pred = (t->op == OSC_I_BR && t->blk_t == b) || - (t->op == OSC_I_CBR && (t->blk_t == b || t->blk_f == b)); - if (pred) for (int k = 0; k < BSW; k++) cur[k] &= out[p * BSW + k]; - } - if (memcmp(cur, &in[b * BSW], sizeof cur)) { memcpy(&in[b * BSW], cur, sizeof cur); changed = 1; } - for (uint32_t i = f->blocks[b].first; i < f->blocks[b].first + f->blocks[b].count; i++) { - int d = insn_def(&f->insns[i]); - if (d >= 0) cur[d / 64] |= 1ULL << (d % 64); - } - if (memcmp(cur, &out[b * BSW], sizeof cur)) { memcpy(&out[b * BSW], cur, sizeof cur); changed = 1; } + size_t width = f->nvregs ? ((size_t)f->nvregs + 63) / 64 : 1; + size_t input_words = nb * width, transfer_words = nb * (width + 2); + uint64_t *in = a->alloc(a->ctx, input_words * sizeof(*in)); + uint64_t *transfers = a->alloc(a->ctx, transfer_words * sizeof(*transfers)); + if (!in || !transfers) { + a->free(a->ctx, in, input_words * sizeof(*in)); + a->free(a->ctx, transfers, transfer_words * sizeof(*transfers)); + vfail(err, n, "out of memory"); + return -2; + } + for (int b = 0; b < nb; b++) { + uint64_t *record = transfers + b * (width + 2); + memset(record, 0, width * sizeof(*record)); + const OscBlock *bl = &f->blocks[b]; + for (uint32_t i = bl->first; i < bl->first + bl->count; i++) { + int d = insn_def(&f->insns[i]); + if (d >= 0) record[d / 64] |= UINT64_C(1) << (d % 64); } + const OscInsn *term = &f->insns[bl->first + bl->count - 1]; + record[width] = term->op == OSC_I_RET ? nb : term->blk_t; + record[width + 1] = term->op == OSC_I_CBR ? term->blk_f : nb; } + osc_definite_inputs(transfers, transfer_words, in, input_words, f->nparams, width); + int rc = 0; for (int b = 0; b < nb && !rc; b++) { uint64_t cur[BSW]; - memcpy(cur, &in[b * BSW], sizeof cur); + memcpy(cur, &in[b * width], width * sizeof(*cur)); for (uint32_t i = f->blocks[b].first; i < f->blocks[b].first + f->blocks[b].count && !rc; i++) { int16_t us[OSC_MAX_PARAMS + 2]; int k = insn_uses(&f->insns[i], us); @@ -562,8 +557,8 @@ static int validate_func(const OscAlloc *a, const OscUnit *u, int fi, char *err, if (d >= 0) cur[d / 64] |= 1ULL << (d % 64); } } - a->free(a->ctx, in, bsz); - a->free(a->ctx, out, bsz); + a->free(a->ctx, in, input_words * sizeof(*in)); + a->free(a->ctx, transfers, transfer_words * sizeof(*transfers)); return rc; } diff --git a/src/compiler/osc_lower.c b/src/compiler/osc_lower.c index 255cd60f4..e63159094 100644 --- a/src/compiler/osc_lower.c +++ b/src/compiler/osc_lower.c @@ -636,6 +636,11 @@ static void block(L *l, int i) if (l->cur >= 0) releases(l, n); } +_Static_assert(OSC_MAX_INSNS == 4096 && OSC_MAX_BLOCKS == 512 && + sizeof(OscInsn) == 6 * sizeof(uint64_t) && _Alignof(OscInsn) >= _Alignof(uint64_t) && + sizeof(OscBlock) == 8 && offsetof(OscBlock, first) == 0 && offsetof(OscBlock, count) == 4, + "OSC lowering block layout"); + static int lower_fn(L *l, int fi) { const OscAst *a = l->ast; @@ -683,14 +688,9 @@ static int lower_fn(L *l, int fi) } if (l->failed) return -1; /* layout: blocks in creation order, instructions in emission order */ - uint32_t k = 0; - for (int b = 0; b < l->nblk; b++) { - f->blocks[b].first = k; - for (uint32_t j = 0; j < l->nins; j++) - if (l->iblk[j] == b) f->insns[k++] = l->ins[j]; - f->blocks[b].count = k - f->blocks[b].first; - } - f->ninsns = k; + osc_layout_blocks(l->iblk, l->nins, (const uint64_t *)l->ins, (uint64_t *)f->insns, + (uint32_t *)f->blocks, (uint64_t)l->nblk); + f->ninsns = l->nins; f->nblocks = (uint16_t)l->nblk; return 0; } diff --git a/src/omega_api_decl.h b/src/omega_api_decl.h index 5df6a0411..d3eab3f39 100644 --- a/src/omega_api_decl.h +++ b/src/omega_api_decl.h @@ -741,6 +741,21 @@ OMBR_ASSERT(offsetof(OscScopeExit, borrows) == 12, "layout exitwork field borrow OMBR_ASSERT(offsetof(OscScopeExit, actions) == 16, "layout exitwork field actions"); /* export fn osc_scope_exit visible view ushort 480 symbols view uchar 76800 owners edit uchar 5120 borrows edit uchar 12288 work edit exitwork to ulong */ uint64_t osc_scope_exit(const uint16_t o_visible[480], const uint8_t o_symbols[76800], uint8_t o_owners[5120], uint8_t o_borrows[12288], OscScopeExit *o_work); +#define OSC_FLOW_RETURNS 1 +#define OSC_FLOW_UNREACHABLE 2 +#define OSC_BLOCK_BAD_RANGE 1 +#define OSC_BLOCK_OVERLAP 2 +#define OSC_BLOCK_NO_TERMINATOR 3 +#define OSC_BLOCK_EARLY_TERMINATOR 4 +#define OSC_BLOCK_UNCOVERED 5 +/* export fn osc_statement_flow nodes view uchar * order edit ulong * flow edit uchar * to void */ +void osc_statement_flow(const uint8_t *o_nodes, size_t o_nodes_len, uint64_t *o_order, size_t o_order_len, uint8_t *o_flow, size_t o_flow_len); +/* export fn osc_block_partition blocks view uchar * insns view uchar * location out ulong 1 to ulong */ +uint64_t osc_block_partition(const uint8_t *o_blocks, size_t o_blocks_len, const uint8_t *o_insns, size_t o_insns_len, uint64_t o_location[1]); +/* export fn osc_definite_inputs transfers view ulong * inputs edit ulong * params ulong width ulong to void */ +void osc_definite_inputs(const uint64_t *o_transfers, size_t o_transfers_len, uint64_t *o_inputs, size_t o_inputs_len, uint64_t o_params, uint64_t o_width); +/* export fn osc_layout_blocks tags view short * source view ulong 24576 dest edit ulong 24576 blocks edit uint 1024 nblocks ulong to void */ +void osc_layout_blocks(const int16_t *o_tags, size_t o_tags_len, const uint64_t o_source[24576], uint64_t o_dest[24576], uint32_t o_blocks[1024], uint64_t o_nblocks); /* export fn tensor_shape_size dims view ulong * elems edit ulong 1 to long */ int64_t tensor_shape_size(const uint64_t *o_dims, size_t o_dims_len, uint64_t o_elems[1]); /* export fn tensor_dense_strides dims view ulong * strides edit ulong * to void */ diff --git a/src/omega_native.h b/src/omega_native.h index ca1bc9f63..69299bfcb 100644 --- a/src/omega_native.h +++ b/src/omega_native.h @@ -367,6 +367,16 @@ uint32_t omega2_osc_trace_record(uint64_t *result, uint8_t *o_trace, uint64_t o_ const char *omega2_ident_osc_lifetimes(void); /* export fn osc_scope_exit visible view ushort 480 symbols view uchar 76800 owners edit uchar 5120 borrows edit uchar 12288 work edit exitwork to ulong */ uint32_t omega2_osc_scope_exit(uint64_t *result, const uint16_t *o_visible, uint64_t o_visible_len, const uint8_t *o_symbols, uint64_t o_symbols_len, uint8_t *o_owners, uint64_t o_owners_len, uint8_t *o_borrows, uint64_t o_borrows_len, uint8_t *o_work); +#define OMEGA2_IDENT_osc_flow "omega-ident 1 unit=osc_flow abi=2 profile=OM-2 src=561334dffdf9c38cab0f03a0d0f11a18dd3eab63efed08c14447e20693c38644 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2" +const char *omega2_ident_osc_flow(void); +/* export fn osc_statement_flow nodes view uchar * order edit ulong * flow edit uchar * to void */ +uint32_t omega2_osc_statement_flow(uint64_t *result, const uint8_t *o_nodes, uint64_t o_nodes_len, uint64_t *o_order, uint64_t o_order_len, uint8_t *o_flow, uint64_t o_flow_len); +/* export fn osc_block_partition blocks view uchar * insns view uchar * location out ulong 1 to ulong */ +uint32_t omega2_osc_block_partition(uint64_t *result, const uint8_t *o_blocks, uint64_t o_blocks_len, const uint8_t *o_insns, uint64_t o_insns_len, uint64_t *o_location); +/* export fn osc_definite_inputs transfers view ulong * inputs edit ulong * params ulong width ulong to void */ +uint32_t omega2_osc_definite_inputs(uint64_t *result, const uint64_t *o_transfers, uint64_t o_transfers_len, uint64_t *o_inputs, uint64_t o_inputs_len, uint64_t o_params, uint64_t o_width); +/* export fn osc_layout_blocks tags view short * source view ulong 24576 dest edit ulong 24576 blocks edit uint 1024 nblocks ulong to void */ +uint32_t omega2_osc_layout_blocks(uint64_t *result, const int16_t *o_tags, uint64_t o_tags_len, const uint64_t *o_source, uint64_t o_source_len, uint64_t *o_dest, uint64_t o_dest_len, uint32_t *o_blocks, uint64_t o_blocks_len, uint64_t o_nblocks); #define OMEGA2_IDENT_tensor_shape "omega-ident 1 unit=tensor_shape abi=2 profile=OM-2 src=c28554bdff536175775cdf0bf99e71054300e9341059f24c9dbe65cccc0c0aac omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2" const char *omega2_ident_tensor_shape(void); /* export fn tensor_shape_size dims view ulong * elems edit ulong 1 to long */ diff --git a/src/omega_om_units.c b/src/omega_om_units.c index aadb9513e..6b5d1f285 100644 --- a/src/omega_om_units.c +++ b/src/omega_om_units.c @@ -4985,6 +4985,127 @@ static uint32_t ombr_leaf2_run(const void *code, uint64_t *args, uint64_t *resul } return s; } +__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr_leaf2_code_osc_flow\n.hidden ombr_leaf2_code_osc_flow\nombr_leaf2_code_osc_flow:\n.byte 0x17,0x01,0x00,0x14,0x93,0x02,0x00,0x14,0xbb,0x03,0x00,0x14,0x6b,0x04,0x00,0x14,0x04,0x00,0x80,0xd2,0x05,0x00,0x80,0xd2,0x06,0x00,0x80,0xd2,0xbf,0x00,0x03,0xeb,0x62,0x02,0x00,0x54,0x08,0x48,0x88,0xd2,0xe8,0x01,0xa0,0xf2,0xdf,0x00,0x08,0xeb,0xc2,0x02,0x00,0x54,0xc6,0x04,0x00,0x91,0x48,0x00,0x05,0x8b,0x1f,0x01,0x01,0xeb,0x02,0x02,0x00,0x54,0x09,0x68,0x68,0x38,0x0a,0x01,0x80,0xd2,0xab,0x7c,0x0a,0x9b,0x7f,0x01,0x01,0xf1,0xe2,0x01,0x00,0x54,0x2c,0x21,0xcb,0x9a,0x84,0x00,0x0c,0xaa,0xa5,0x04,0x00,0x91,0xbf,0x00,0x03,0xeb,0xe3,0xfd,0xff,0x54,0xe0,0x03,0x04,0xaa,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0xe1,0x00,0x80,0xd2,0xf8,0xff,0xff,0x17,0x06,0x0d,0x80,0xd2,0x45,0x7c,0x06,0x9b,0xff,0x03,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xfe,0x1f,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x17,0x40,0xf9,0x43,0x00,0x80,0xd2,0xcf,0xff,0xff,0x97,0xe6,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xfe,0x1f,0x40,0xf9,0xff,0x03,0x01,0x91,0x08,0x00,0x80,0xd2,0xdf,0x34,0x00,0xf1,0x41,0x00,0x00,0x54,0x28,0x00,0x80,0xd2,0xdf,0x6c,0x00,0xf1,0xe9,0x17,0x9f,0x9a,0xdf,0x70,0x00,0xf1,0xea,0x17,0x9f,0x9a,0x2b,0x01,0x0a,0xaa,0x0b,0x04,0x00,0xb4,0xa9,0x40,0x00,0x91,0xff,0x43,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xfe,0x27,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x23,0x40,0xf9,0x83,0x00,0x80,0xd2,0xab,0xff,0xff,0x97,0xe9,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xfe,0x27,0x40,0xf9,0xff,0x43,0x01,0x91,0x3f,0x01,0x04,0xeb,0xa2,0x15,0x00,0x54,0x68,0x68,0x69,0x38,0xdf,0x28,0x00,0xf1,0x01,0x09,0x00,0x54,0xaa,0x50,0x00,0x91,0xff,0x83,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xfe,0x2b,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x27,0x40,0xf9,0x83,0x00,0x80,0xd2,0x89,0xff,0xff,0x97,0xe9,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xfe,0x2b,0x40,0xf9,0xff,0x83,0x01,0x91,0xea,0xff,0x9f,0xd2,0xea,0xff,0xbf,0xf2,0x3f,0x01,0x0a,0xeb,0xe0,0x04,0x00,0x54,0xab,0x40,0x00,0x91,0xff,0x83,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xfe,0x2f,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x2b,0x40,0xf9,0x83,0x00,0x80,0xd2,0x67,0xff,0xff,0x97,0xea,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xfe,0x2f,0x40,0xf9,0xff,0x83,0x01,0x91,0x3f,0x01,0x04,0xeb,0x02,0x0d,0x00,0x54,0x6b,0x68,0x69,0x38,0x5f,0x01,0x04,0xeb,0xa2,0x0c,0x00,0x54,0x6c,0x68,0x6a,0x38,0x68,0x01,0x0c,0x8a,0xdf,0x0c,0x00,0xf1,0x41,0x0b,0x00,0x54,0xaa,0x30,0x00,0x91,0xff,0x83,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xfe,0x2b,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x27,0x40,0xf9,0x83,0x00,0x80,0xd2,0x40,0xff,0xff,0x97,0xe9,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xfe,0x2b,0x40,0xf9,0xff,0x83,0x01,0x91,0x0a,0x00,0x80,0xd2,0xeb,0xff,0x9f,0xd2,0xeb,0xff,0xbf,0xf2,0x3f,0x01,0x0b,0xeb,0x00,0x07,0x00,0x54,0x0c,0x48,0x88,0xd2,0xec,0x01,0xa0,0xf2,0x5f,0x01,0x0c,0xeb,0xa2,0x07,0x00,0x54,0x4a,0x05,0x00,0x91,0x1f,0x01,0x00,0xf1,0x40,0x01,0x00,0x54,0x3f,0x01,0x04,0xeb,0xc2,0x06,0x00,0x54,0x6b,0x68,0x69,0x38,0x4c,0x00,0x80,0xd2,0x6d,0x01,0x0c,0xaa,0x3f,0x01,0x04,0xeb,0x22,0x06,0x00,0x54,0x6d,0x68,0x29,0x38,0x04,0x00,0x00,0x14,0x3f,0x01,0x04,0xeb,0xa2,0x05,0x00,0x54,0x68,0x68,0x69,0x38,0x0b,0x0d,0x80,0xd2,0x2c,0x7d,0x0b,0x9b,0x8d,0x61,0x00,0x91,0xff,0xc3,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xfe,0x37,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x33,0x40,0xf9,0x83,0x00,0x80,0xd2,0x06,0xff,0xff,0x97,0xe9,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xea,0x27,0x40,0xf9,0xfe,0x37,0x40,0xf9,0xff,0xc3,0x01,0x91,0xc6,0xff,0xff,0x17,0x5f,0x00,0x04,0xeb,0xc2,0x00,0x00,0x54,0x68,0x68,0x22,0x38,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x06,0x0d,0x80,0xd2,0xa8,0x7c,0x06,0x9b,0x3f,0x00,0x08,0xeb,0x81,0x26,0x00,0x54,0x7f,0x00,0x05,0xeb,0x43,0x26,0x00,0x54,0x26,0x00,0x80,0xd2,0x08,0x00,0x80,0xd2,0x09,0x00,0x80,0xd2,0x1f,0x01,0x06,0xeb,0x82,0x1e,0x00,0x54,0x0a,0x48,0x88,0xd2,0xea,0x01,0xa0,0xf2,0x3f,0x01,0x0a,0xeb,0xe2,0x24,0x00,0x54,0x29,0x05,0x00,0x91,0x1f,0x01,0x03,0xeb,0x42,0x24,0x00,0x54,0x4b,0x78,0x68,0xf8,0x0c,0x0d,0x80,0xd2,0x6a,0x7d,0x0c,0x9b,0x08,0x05,0x00,0x91,0xff,0x83,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xfe,0x2f,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x27,0x40,0xf9,0x43,0x00,0x80,0xd2,0xc6,0xfe,0xff,0x97,0xeb,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xfe,0x2f,0x40,0xf9,0xff,0x83,0x01,0x91,0x7f,0x0d,0x00,0xf1,0xa1,0x0b,0x00,0x54,0x4d,0x31,0x00,0x91,0xff,0xc3,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xfe,0x37,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x33,0x40,0xf9,0x83,0x00,0x80,0xd2,0xa2,0xfe,0xff,0x97,0xec,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xfe,0x37,0x40,0xf9,0xff,0xc3,0x01,0x91,0x0d,0x00,0x80,0xd2,0xee,0xff,0x9f,0xd2,0xee,0xff,0xbf,0xf2,0x9f,0x01,0x0e,0xeb,0x80,0x06,0x00,0x54,0x0f,0x48,0x88,0xd2,0xef,0x01,0xa0,0xf2,0xbf,0x01,0x0f,0xeb,0x62,0x1a,0x00,0x54,0xad,0x05,0x00,0x91,0xdf,0x00,0x03,0xeb,0xc2,0x19,0x00,0x54,0x4c,0x78,0x26,0xf8,0xc6,0x04,0x00,0x91,0x0e,0x0d,0x80,0xd2,0x8f,0x7d,0x0e,0x9b,0xf1,0x61,0x00,0x91,0xff,0x43,0x02,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xee,0x37,0x00,0xf9,0xef,0x3b,0x00,0xf9,0xf1,0x3f,0x00,0xf9,0xfe,0x43,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x3f,0x40,0xf9,0x83,0x00,0x80,0xd2,0x6c,0xfe,0xff,0x97,0xec,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xed,0x33,0x40,0xf9,0xfe,0x43,0x40,0xf9,0xff,0x43,0x02,0x91,0xca,0xff,0xff,0x17,0x6b,0x00,0x00,0x14,0x7f,0x2d,0x00,0xf1,0xed,0x17,0x9f,0x9a,0x7f,0x31,0x00,0xf1,0xee,0x17,0x9f,0x9a,0xac,0x01,0x0e,0xaa,0x7f,0x6d,0x00,0xf1,0xee,0x17,0x9f,0x9a,0x7f,0x71,0x00,0xf1,0xef,0x17,0x9f,0x9a,0xcd,0x01,0x0f,0xaa,0x7f,0x29,0x00,0xf1,0xee,0x17,0x9f,0x9a,0x8f,0x01,0x0d,0xaa,0xd1,0x01,0x0f,0xaa,0x91,0x0b,0x00,0xb4,0x4e,0x41,0x00,0x91,0xff,0x03,0x02,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xee,0x37,0x00,0xf9,0xfe,0x3b,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x37,0x40,0xf9,0x83,0x00,0x80,0xd2,0x36,0xfe,0xff,0x97,0xee,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xec,0x2f,0x40,0xf9,0xed,0x33,0x40,0xf9,0xfe,0x3b,0x40,0xf9,0xff,0x03,0x02,0x91,0xdf,0x00,0x03,0xeb,0x42,0x0d,0x00,0x54,0x4e,0x78,0x26,0xf8,0xc6,0x04,0x00,0x91,0x7f,0x29,0x00,0xf1,0x01,0x06,0x00,0x54,0x4f,0x51,0x00,0x91,0xff,0x03,0x02,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xee,0x37,0x00,0xf9,0xef,0x3b,0x00,0xf9,0xfe,0x3f,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x3b,0x40,0xf9,0x83,0x00,0x80,0xd2,0x09,0xfe,0xff,0x97,0xee,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xec,0x2f,0x40,0xf9,0xed,0x33,0x40,0xf9,0xfe,0x3f,0x40,0xf9,0xff,0x03,0x02,0x91,0xef,0xff,0x9f,0xd2,0xef,0xff,0xbf,0xf2,0xdf,0x01,0x0f,0xeb,0xa0,0x00,0x00,0x54,0xdf,0x00,0x03,0xeb,0x22,0x07,0x00,0x54,0x4e,0x78,0x26,0xf8,0xc6,0x04,0x00,0x91,0x0c,0xff,0xff,0x17,0x09,0x00,0x80,0xd2,0x0a,0x00,0x80,0xd2,0x3f,0x01,0x06,0xeb,0xc2,0x05,0x00,0x54,0x0b,0x48,0x88,0xd2,0xeb,0x01,0xa0,0xf2,0x5f,0x01,0x0b,0xeb,0x02,0x06,0x00,0x54,0x4a,0x05,0x00,0x91,0xcc,0x04,0x00,0xd1,0x8d,0x01,0x09,0xcb,0xbf,0x01,0x03,0xeb,0x22,0x05,0x00,0x54,0x4b,0x78,0x6d,0xf8,0xff,0x83,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xfe,0x2f,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x2b,0x40,0xf9,0xe3,0x13,0x40,0xf9,0xe4,0x17,0x40,0xf9,0xf1,0xfd,0xff,0x97,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xfe,0x2f,0x40,0xf9,0xff,0x83,0x01,0x91,0x29,0x05,0x00,0x91,0x3f,0x01,0x06,0xeb,0x83,0xfa,0xff,0x54,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf8,0xff,0xff,0x17,0x9f,0x00,0x00,0xf1,0xe6,0x17,0x9f,0x9a,0x68,0x00,0x04,0x8b,0x09,0x06,0x80,0xd2,0x2a,0x08,0xc9,0x9a,0x1f,0x01,0x0a,0xeb,0xeb,0x97,0x9f,0x9a,0xcc,0x00,0x0b,0xaa,0x6c,0x00,0x00,0xb4,0x20,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x06,0x00,0x80,0xd2,0x08,0x00,0x80,0xd2,0xdf,0x00,0x04,0xeb,0xa2,0x05,0x00,0x54,0x09,0x48,0x88,0xd2,0xe9,0x01,0xa0,0xf2,0x1f,0x01,0x09,0xeb,0x02,0x06,0x00,0x54,0x08,0x05,0x00,0x91,0x69,0x00,0x06,0x8b,0x0a,0x00,0x82,0xd2,0x3f,0x01,0x0a,0xeb,0x22,0x05,0x00,0x54,0x4b,0x68,0x69,0x38,0x7f,0x01,0x00,0xf1,0x80,0x00,0x00,0x54,0xa9,0x00,0x00,0xf9,0x40,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x2a,0x00,0x80,0xd2,0x0b,0x00,0x82,0xd2,0x3f,0x01,0x0b,0xeb,0xe2,0x03,0x00,0x54,0x4a,0x68,0x29,0x38,0x0b,0x06,0x80,0xd2,0x2c,0x7d,0x0b,0x9b,0x9f,0x01,0x01,0xeb,0x42,0x03,0x00,0x54,0x0a,0x68,0x6c,0x38,0x5f,0x35,0x00,0xf1,0xec,0x37,0x9f,0x9a,0x5f,0x3d,0x00,0xf1,0xed,0x87,0x9f,0x9a,0x8b,0x01,0x0d,0x8a,0xcc,0x04,0x00,0x91,0x9f,0x01,0x04,0xeb,0xc1,0x00,0x00,0x54,0x7f,0x01,0x00,0xf1,0x61,0x00,0x00,0x54,0x60,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x04,0x00,0x00,0x14,0x6b,0x00,0x00,0xb4,0x80,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0xc6,0x04,0x00,0x91,0xdf,0x00,0x04,0xeb,0xa3,0xfa,0xff,0x54,0x00,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x05,0x01,0x80,0xd2,0x28,0x08,0xc5,0x9a,0x06,0x85,0x05,0x9b,0xdf,0x00,0x00,0xf1,0x21,0x18,0x00,0x54,0x05,0x06,0x80,0xd2,0x68,0x08,0xc5,0x9a,0x06,0x8d,0x05,0x9b,0xdf,0x00,0x00,0xf1,0x81,0x17,0x00,0x54,0x05,0x06,0x80,0xd2,0x66,0x08,0xc5,0x9a,0x08,0x00,0x82,0xd2,0xdf,0x00,0x08,0xeb,0xe8,0x16,0x00,0x54,0x06,0x00,0x80,0xd2,0xff,0x07,0x40,0xd1,0xe5,0x03,0x00,0x91,0x08,0x00,0x80,0xd2,0x09,0x00,0x82,0xd2,0xa6,0x68,0x28,0x38,0x08,0x05,0x00,0x91,0x1f,0x01,0x09,0xeb,0xa3,0xff,0xff,0x54,0x08,0x06,0x80,0xd2,0x66,0x08,0xc8,0x9a,0x08,0x01,0x80,0xd2,0x29,0x08,0xc8,0x9a,0x0a,0x00,0x80,0xd2,0x0b,0x00,0x80,0xd2,0x5f,0x01,0x09,0xeb,0x82,0x10,0x00,0x54,0x0c,0x48,0x88,0xd2,0xec,0x01,0xa0,0xf2,0x7f,0x01,0x0c,0xeb,0x02,0x14,0x00,0x54,0x6b,0x05,0x00,0x91,0x0d,0x01,0x80,0xd2,0x4c,0x7d,0x0d,0x9b,0xff,0xc3,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xfe,0x37,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x2f,0x40,0xf9,0x83,0x00,0x80,0xd2,0x36,0xfd,0xff,0x97,0xed,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xec,0x2f,0x40,0xf9,0xfe,0x37,0x40,0xf9,0xff,0xc3,0x01,0x91,0x8f,0x11,0x00,0x91,0xff,0x03,0x02,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xee,0x37,0x00,0xf9,0xef,0x3b,0x00,0xf9,0xfe,0x3f,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x3b,0x40,0xf9,0x83,0x00,0x80,0xd2,0x10,0xfd,0xff,0x97,0xee,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xec,0x2f,0x40,0xf9,0xed,0x33,0x40,0xf9,0xfe,0x3f,0x40,0xf9,0xff,0x03,0x02,0x91,0x8a,0x00,0x00,0xf9,0xff,0x03,0x02,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xee,0x37,0x00,0xf9,0xef,0x3b,0x00,0xf9,0xfe,0x3f,0x00,0xf9,0xe0,0x0b,0x40,0xf9,0xe1,0x0f,0x40,0xf9,0xe2,0x17,0x40,0xf9,0xe3,0x33,0x40,0xf9,0xe4,0x37,0x40,0xf9,0xe5,0x13,0x40,0xf9,0x33,0xff,0xff,0x97,0xef,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xec,0x2f,0x40,0xf9,0xed,0x33,0x40,0xf9,0xee,0x37,0x40,0xf9,0xfe,0x3f,0x40,0xf9,0xff,0x03,0x02,0x91,0xff,0x01,0x00,0xf1,0x80,0x00,0x00,0x54,0xe0,0x03,0x0f,0xaa,0xff,0x07,0x40,0x91,0xc0,0x03,0x5f,0xd6,0x4a,0x05,0x00,0x91,0x5f,0x01,0x09,0xeb,0xc3,0xef,0xff,0x54,0x08,0x00,0x80,0xd2,0x09,0x00,0x80,0xd2,0x1f,0x01,0x06,0xeb,0x62,0x02,0x00,0x54,0x0a,0x48,0x88,0xd2,0xea,0x01,0xa0,0xf2,0x3f,0x01,0x0a,0xeb,0x22,0x03,0x00,0x54,0x29,0x05,0x00,0x91,0x0a,0x00,0x82,0xd2,0x1f,0x01,0x0a,0xeb,0x62,0x02,0x00,0x54,0xab,0x68,0x68,0x38,0x7f,0x01,0x00,0xf1,0xa1,0x00,0x00,0x54,0x88,0x00,0x00,0xf9,0xa0,0x00,0x80,0xd2,0xff,0x07,0x40,0x91,0xc0,0x03,0x5f,0xd6,0x08,0x05,0x00,0x91,0x1f,0x01,0x06,0xeb,0xe3,0xfd,0xff,0x54,0x08,0x00,0x80,0xd2,0x88,0x00,0x00,0xf9,0x00,0x00,0x80,0xd2,0xff,0x07,0x40,0x91,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf8,0xff,0xff,0x17,0x06,0x00,0x80,0xd2,0x08,0x00,0x80,0xd2,0x09,0x00,0x80,0xd2,0x1f,0x01,0x03,0xeb,0xa2,0x03,0x00,0x54,0x0a,0x48,0x88,0xd2,0xea,0x01,0xa0,0xf2,0x3f,0x01,0x0a,0xeb,0x02,0x04,0x00,0x54,0x29,0x05,0x00,0x91,0x8b,0x00,0x08,0x8b,0x7f,0x01,0x01,0xeb,0x42,0x03,0x00,0x54,0x0c,0x78,0x6b,0xf8,0x1f,0x01,0x03,0xeb,0xe2,0x02,0x00,0x54,0x4d,0x78,0x68,0xf8,0x8a,0x01,0x0d,0xaa,0xac,0x00,0x08,0x8b,0x9f,0x01,0x01,0xeb,0x42,0x02,0x00,0x54,0x0b,0x78,0x6c,0xf8,0x6c,0x01,0x0a,0x8a,0x9f,0x01,0x0b,0xeb,0xc0,0x00,0x00,0x54,0xad,0x00,0x08,0x8b,0xbf,0x01,0x01,0xeb,0x62,0x01,0x00,0x54,0x0c,0x78,0x2d,0xf8,0x26,0x00,0x80,0xd2,0x08,0x05,0x00,0x91,0x1f,0x01,0x03,0xeb,0xa3,0xfc,0xff,0x54,0xe0,0x03,0x06,0xaa,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x66,0x08,0x00,0xd1,0xc9,0x00,0x05,0x8b,0x3f,0x01,0x03,0xeb,0x62,0x06,0x00,0x54,0x48,0x78,0x69,0xf8,0xe6,0x05,0x00,0xb4,0x29,0x08,0xc6,0x9a,0x1f,0x01,0x09,0xeb,0x61,0x00,0x00,0x54,0x00,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x09,0x00,0x80,0xd2,0x3f,0x01,0x03,0xeb,0x28,0x05,0x00,0x54,0x6a,0x00,0x09,0xcb,0xdf,0x00,0x0a,0xeb,0xc8,0x04,0x00,0x54,0x4a,0x0c,0x09,0x8b,0x0b,0x7d,0x06,0x9b,0xff,0x83,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xfe,0x2f,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x27,0x40,0xf9,0xe3,0x1b,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x2b,0x40,0xf9,0xb0,0xff,0xff,0x97,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xfe,0x2f,0x40,0xf9,0xff,0x83,0x01,0x91,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x41,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x61,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0xbf,0x00,0x00,0xf1,0x09,0x13,0x00,0x54,0xe5,0x11,0x00,0xb4,0x68,0x08,0xc5,0x9a,0x06,0x8d,0x05,0x9b,0xdf,0x00,0x00,0xf1,0x61,0x12,0x00,0x54,0x7f,0x00,0x05,0xeb,0x23,0x12,0x00,0x54,0x05,0x11,0x00,0xb4,0x66,0x08,0xc5,0x9a,0xa8,0x08,0x00,0x91,0xc9,0x7c,0x08,0x9b,0x3f,0x00,0x09,0xeb,0x61,0x11,0x00,0x54,0x9f,0x18,0x00,0xf1,0x28,0x11,0x00,0x54,0x05,0x10,0x00,0xb4,0x66,0x08,0xc5,0x9a,0x08,0x00,0x80,0xd2,0x09,0x00,0x80,0xd2,0x1f,0x01,0x03,0xeb,0xa2,0x01,0x00,0x54,0x0a,0x48,0x88,0xd2,0xea,0x01,0xa0,0xf2,0x3f,0x01,0x0a,0xeb,0x62,0x0f,0x00,0x54,0x29,0x05,0x00,0x91,0x0a,0x00,0x80,0x92,0x1f,0x01,0x03,0xeb,0xa2,0x0e,0x00,0x54,0x4a,0x78,0x28,0xf8,0x08,0x05,0x00,0x91,0x1f,0x01,0x03,0xeb,0xa3,0xfe,0xff,0x54,0x08,0x00,0x80,0xd2,0x09,0x00,0x80,0xd2,0x1f,0x01,0x05,0xeb,0xa2,0x01,0x00,0x54,0x0a,0x48,0x88,0xd2,0xea,0x01,0xa0,0xf2,0x3f,0x01,0x0a,0xeb,0x62,0x0d,0x00,0x54,0x29,0x05,0x00,0x91,0x0a,0x00,0x80,0xd2,0x1f,0x01,0x03,0xeb,0xa2,0x0c,0x00,0x54,0x4a,0x78,0x28,0xf8,0x08,0x05,0x00,0x91,0x1f,0x01,0x05,0xeb,0xa3,0xfe,0xff,0x54,0x28,0x00,0x80,0xd2,0x9f,0x00,0x01,0xf1,0x42,0x0c,0x00,0x54,0x09,0x21,0xc4,0x9a,0x2a,0x05,0x00,0xd1,0x0b,0x00,0x80,0xd2,0x7f,0x01,0x03,0xeb,0x22,0x0b,0x00,0x54,0x4a,0x78,0x2b,0xf8,0x28,0x00,0x80,0xd2,0x09,0x00,0x80,0xd2,0xe8,0x09,0x00,0xb4,0x0a,0x48,0x88,0xd2,0xea,0x01,0xa0,0xf2,0x3f,0x01,0x0a,0xeb,0x62,0x0a,0x00,0x54,0x29,0x05,0x00,0x91,0x08,0x00,0x80,0xd2,0x0a,0x00,0x80,0xd2,0x0b,0x00,0x80,0xd2,0x5f,0x01,0x06,0xeb,0x82,0x08,0x00,0x54,0x0c,0x48,0x88,0xd2,0xec,0x01,0xa0,0xf2,0x7f,0x01,0x0c,0xeb,0x22,0x09,0x00,0x54,0x6b,0x05,0x00,0x91,0xad,0x08,0x00,0x91,0x4c,0x7d,0x0d,0x9b,0x0d,0x00,0x80,0xd2,0xbf,0x09,0x00,0xf1,0xe2,0x06,0x00,0x54,0xae,0x08,0x00,0x91,0x9f,0x01,0x01,0xeb,0xc8,0x07,0x00,0x54,0x2f,0x00,0x0c,0xcb,0xdf,0x01,0x0f,0xeb,0x68,0x07,0x00,0x54,0x0f,0x0c,0x0c,0x8b,0x51,0x7d,0x05,0x9b,0xff,0x43,0x02,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xee,0x37,0x00,0xf9,0xef,0x3b,0x00,0xf9,0xf1,0x3f,0x00,0xf9,0xfe,0x43,0x00,0xf9,0xe0,0x0b,0x40,0xf9,0xe1,0x0f,0x40,0xf9,0xe2,0x3b,0x40,0xf9,0xe3,0x37,0x40,0xf9,0xe4,0x3f,0x40,0xf9,0xe5,0x33,0x40,0xf9,0x55,0xff,0xff,0x97,0xee,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xec,0x2f,0x40,0xf9,0xed,0x33,0x40,0xf9,0xfe,0x43,0x40,0xf9,0xff,0x43,0x02,0x91,0x4e,0x00,0x00,0xb4,0x28,0x00,0x80,0xd2,0xad,0x05,0x00,0x91,0xbf,0x09,0x00,0xf1,0x63,0xf9,0xff,0x54,0x4a,0x05,0x00,0x91,0x5f,0x01,0x06,0xeb,0xc3,0xf7,0xff,0x54,0xb2,0xff,0xff,0x17,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x41,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x61,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xf8,0xff,0xff,0x17,0xe1,0x00,0x80,0xd2,0xf6,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf4,0xff,0xff,0x17,0x04,0x00,0x80,0xd2,0x9f,0x18,0x00,0xf1,0xc2,0x01,0x00,0x54,0x65,0x00,0x04,0x8b,0x46,0x00,0x04,0x8b,0x08,0x00,0x8c,0xd2,0xdf,0x00,0x08,0xeb,0xa2,0x01,0x00,0x54,0x09,0x78,0x66,0xf8,0x0a,0x00,0x8c,0xd2,0xbf,0x00,0x0a,0xeb,0x22,0x01,0x00,0x54,0x29,0x78,0x25,0xf8,0x84,0x04,0x00,0x91,0x9f,0x18,0x00,0xf1,0x83,0xfe,0xff,0x54,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0xbf,0x00,0x08,0xf1,0xe8,0x16,0x00,0x54,0x06,0x00,0x82,0xd2,0x3f,0x00,0x06,0xeb,0x88,0x16,0x00,0x54,0x06,0x00,0x80,0xd2,0x08,0x00,0x80,0xd2,0xdf,0x00,0x01,0xeb,0xa2,0x02,0x00,0x54,0x09,0x48,0x88,0xd2,0xe9,0x01,0xa0,0xf2,0x1f,0x01,0x09,0xeb,0x02,0x15,0x00,0x54,0x08,0x05,0x00,0x91,0xdf,0x00,0x01,0xeb,0x62,0x14,0x00,0x54,0x09,0x78,0xa6,0x78,0x3f,0x01,0x00,0xf1,0xea,0xa7,0x9f,0x9a,0xab,0xfc,0x7f,0xd3,0x4b,0x14,0x00,0xb5,0x3f,0x01,0x05,0xeb,0xec,0xb7,0x9f,0x9a,0x4d,0x01,0x0c,0xaa,0x4d,0x00,0x00,0xb4,0x2e,0x13,0x00,0x54,0xc6,0x04,0x00,0x91,0xdf,0x00,0x01,0xeb,0xa3,0xfd,0xff,0x54,0x06,0x00,0x80,0xd2,0x08,0x00,0x80,0xd2,0xdf,0x00,0x05,0xeb,0x02,0x02,0x00,0x54,0x09,0x48,0x88,0xd2,0xe9,0x01,0xa0,0xf2,0x1f,0x01,0x09,0xeb,0x02,0x12,0x00,0x54,0x08,0x05,0x00,0x91,0x49,0x00,0x80,0xd2,0xca,0x7c,0x09,0x9b,0x4b,0x05,0x00,0x91,0x0c,0x00,0x80,0xd2,0x7f,0x01,0x10,0xf1,0xe2,0x10,0x00,0x54,0x8c,0x78,0x2b,0xb8,0xc6,0x04,0x00,0x91,0xdf,0x00,0x05,0xeb,0x43,0xfe,0xff,0x54,0x06,0x00,0x80,0xd2,0x08,0x00,0x80,0xd2,0xdf,0x00,0x01,0xeb,0x02,0x03,0x00,0x54,0x09,0x48,0x88,0xd2,0xe9,0x01,0xa0,0xf2,0x1f,0x01,0x09,0xeb,0xa2,0x0f,0x00,0x54,0x08,0x05,0x00,0x91,0xdf,0x00,0x01,0xeb,0x02,0x0f,0x00,0x54,0x0a,0x78,0xa6,0x78,0x4b,0xfd,0x7f,0xd3,0x2b,0x0f,0x00,0xb5,0x4c,0x00,0x80,0xd2,0x4d,0x7d,0x0c,0x9b,0xa9,0x05,0x00,0x91,0x3f,0x01,0x10,0xf1,0x02,0x0e,0x00,0x54,0x8a,0x78,0x69,0xb8,0x4b,0x05,0x00,0x11,0x3f,0x01,0x10,0xf1,0x82,0x0d,0x00,0x54,0x8b,0x78,0x29,0xb8,0xc6,0x04,0x00,0x91,0xdf,0x00,0x01,0xeb,0x43,0xfd,0xff,0x54,0x06,0x00,0x80,0xd2,0x08,0x00,0x80,0xd2,0x09,0x00,0x80,0xd2,0x1f,0x01,0x05,0xeb,0x02,0x03,0x00,0x54,0x0a,0x48,0x88,0xd2,0xea,0x01,0xa0,0xf2,0x3f,0x01,0x0a,0xeb,0x22,0x0c,0x00,0x54,0x29,0x05,0x00,0x91,0x4b,0x00,0x80,0xd2,0x0a,0x7d,0x0b,0x9b,0x5f,0x01,0x10,0xf1,0x42,0x0b,0x00,0x54,0x86,0x78,0x2a,0xb8,0x4b,0x05,0x00,0x91,0x7f,0x01,0x10,0xf1,0xc2,0x0a,0x00,0x54,0x8c,0x78,0x6b,0xb8,0xc6,0x00,0x0c,0x0b,0x4b,0x05,0x00,0x91,0x0c,0x00,0x80,0xd2,0x7f,0x01,0x10,0xf1,0x02,0x0a,0x00,0x54,0x8c,0x78,0x2b,0xb8,0x08,0x05,0x00,0x91,0x1f,0x01,0x05,0xeb,0x43,0xfd,0xff,0x54,0x08,0x00,0x80,0xd2,0x09,0x00,0x80,0xd2,0x1f,0x01,0x01,0xeb,0x82,0x08,0x00,0x54,0x0a,0x48,0x88,0xd2,0xea,0x01,0xa0,0xf2,0x3f,0x01,0x0a,0xeb,0xc2,0x08,0x00,0x54,0x29,0x05,0x00,0x91,0x1f,0x01,0x01,0xeb,0x22,0x08,0x00,0x54,0x0b,0x78,0xa8,0x78,0x6c,0xfd,0x7f,0xd3,0x4c,0x08,0x00,0xb5,0x4d,0x00,0x80,0xd2,0x6a,0x7d,0x0d,0x9b,0x4c,0x05,0x00,0x91,0x9f,0x01,0x10,0xf1,0x22,0x07,0x00,0x54,0x8b,0x78,0x6c,0xb8,0x5f,0x01,0x10,0xf1,0xc2,0x06,0x00,0x54,0x8d,0x78,0x6a,0xb8,0xae,0x01,0x0b,0x0b,0xcf,0x00,0x80,0xd2,0xcc,0x7d,0x0f,0x9b,0x4d,0x05,0x00,0x91,0x6e,0x05,0x00,0x11,0xbf,0x01,0x10,0xf1,0xc2,0x05,0x00,0x54,0x8e,0x78,0x2d,0xb8,0xcd,0x00,0x80,0xd2,0x0e,0x7d,0x0d,0x9b,0xff,0x03,0x02,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xeb,0x2b,0x00,0xf9,0xec,0x2f,0x00,0xf9,0xed,0x33,0x00,0xf9,0xee,0x37,0x00,0xf9,0xfe,0x3b,0x00,0xf9,0xe0,0x0b,0x40,0xf9,0xe1,0x0f,0x40,0xf9,0xe2,0x37,0x40,0xf9,0xe3,0x2f,0x40,0xf9,0x4e,0xff,0xff,0x97,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xea,0x27,0x40,0xf9,0xeb,0x2b,0x40,0xf9,0xec,0x2f,0x40,0xf9,0xfe,0x3b,0x40,0xf9,0xff,0x03,0x02,0x91,0x08,0x05,0x00,0x91,0x1f,0x01,0x01,0xeb,0xc3,0xf7,0xff,0x54,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0xa1,0x00,0x80,0xd2,0xf8,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf6,0xff,0xff,0x17\n.previous\n"); +static const char ombr_leaf2_ident_osc_flow[] = "omega-ident 1 unit=osc_flow abi=2 profile=OM-2 src=561334dffdf9c38cab0f03a0d0f11a18dd3eab63efed08c14447e20693c38644 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2"; +__attribute__((visibility("default"))) const char *omega2_ident_osc_flow(void) +{ + return ombr_leaf2_ident_osc_flow; +} +__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr_leaf2_entry_osc_statement_flow\n.hidden ombr_leaf2_entry_osc_statement_flow\nombr_leaf2_entry_osc_statement_flow:\nhint #34\nb ombr_leaf2_code_osc_flow+0\n.previous\n"); +extern const unsigned char ombr_leaf2_entry_osc_statement_flow[] __attribute__((visibility("hidden"))); +/* export fn osc_statement_flow nodes view uchar * order edit ulong * flow edit uchar * to void */ +__attribute__((visibility("default"))) uint32_t omega2_osc_statement_flow(uint64_t *result, const uint8_t *o_nodes, uint64_t o_nodes_len, uint64_t *o_order, uint64_t o_order_len, uint8_t *o_flow, uint64_t o_flow_len) +{ + ombr_leaf_span sp[7]; + unsigned ns = 0; + uint64_t a[6] = {0}; + ombr_leaf2_out ou[6] = {{0, 0, 0}}; + unsigned no = 0; + if (ombr_leaf_span_add(sp, &ns, result, 1u, 1u, 8u, 1)) + return OMEGA_BAD_ARG; + if (ombr_leaf2_view(sp, &ns, o_nodes, o_nodes_len, 1u, 0)) + return OMEGA_BAD_ARG; + a[0] = (uint64_t)(uintptr_t)o_nodes; + a[1] = o_nodes_len; + if (ombr_leaf2_view(sp, &ns, o_order, o_order_len, 8u, 1)) + return OMEGA_BAD_ARG; + a[2] = (uint64_t)(uintptr_t)o_order; + a[3] = o_order_len; + if (ombr_leaf2_view(sp, &ns, o_flow, o_flow_len, 1u, 1)) + return OMEGA_BAD_ARG; + a[4] = (uint64_t)(uintptr_t)o_flow; + a[5] = o_flow_len; + if (ombr_leaf2_overlap(sp, ns)) + return OMEGA_BAD_ARG; + return ombr_leaf2_run(ombr_leaf2_entry_osc_statement_flow, a, result, 0, ou, no, 0); +} +__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr_leaf2_entry_osc_block_partition\n.hidden ombr_leaf2_entry_osc_block_partition\nombr_leaf2_entry_osc_block_partition:\nhint #34\nb ombr_leaf2_code_osc_flow+4\n.previous\n"); +extern const unsigned char ombr_leaf2_entry_osc_block_partition[] __attribute__((visibility("hidden"))); +/* export fn osc_block_partition blocks view uchar * insns view uchar * location out ulong 1 to ulong */ +__attribute__((visibility("default"))) uint32_t omega2_osc_block_partition(uint64_t *result, const uint8_t *o_blocks, uint64_t o_blocks_len, const uint8_t *o_insns, uint64_t o_insns_len, uint64_t *o_location) +{ + ombr_leaf_span sp[7]; + unsigned ns = 0; + uint64_t a[6] = {0}; + ombr_leaf2_out ou[6] = {{0, 0, 0}}; + unsigned no = 0; + if (ombr_leaf_span_add(sp, &ns, result, 1u, 1u, 8u, 1)) + return OMEGA_BAD_ARG; + if (ombr_leaf2_view(sp, &ns, o_blocks, o_blocks_len, 1u, 0)) + return OMEGA_BAD_ARG; + a[0] = (uint64_t)(uintptr_t)o_blocks; + a[1] = o_blocks_len; + if (ombr_leaf2_view(sp, &ns, o_insns, o_insns_len, 1u, 0)) + return OMEGA_BAD_ARG; + a[2] = (uint64_t)(uintptr_t)o_insns; + a[3] = o_insns_len; + if (ombr_leaf2_fixed(sp, &ns, o_location, 8u, 8u, 2)) + return OMEGA_BAD_ARG; + ou[no].slot = 4u; + ou[no].n = 8u; + ou[no].dst = o_location; + no++; + _Alignas(16) unsigned char ob[16]; + if (ombr_leaf2_overlap(sp, ns)) + return OMEGA_BAD_ARG; + return ombr_leaf2_run(ombr_leaf2_entry_osc_block_partition, a, result, 1, ou, no, ob); +} +__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr_leaf2_entry_osc_definite_inputs\n.hidden ombr_leaf2_entry_osc_definite_inputs\nombr_leaf2_entry_osc_definite_inputs:\nhint #34\nb ombr_leaf2_code_osc_flow+8\n.previous\n"); +extern const unsigned char ombr_leaf2_entry_osc_definite_inputs[] __attribute__((visibility("hidden"))); +/* export fn osc_definite_inputs transfers view ulong * inputs edit ulong * params ulong width ulong to void */ +__attribute__((visibility("default"))) uint32_t omega2_osc_definite_inputs(uint64_t *result, const uint64_t *o_transfers, uint64_t o_transfers_len, uint64_t *o_inputs, uint64_t o_inputs_len, uint64_t o_params, uint64_t o_width) +{ + ombr_leaf_span sp[7]; + unsigned ns = 0; + uint64_t a[6] = {0}; + ombr_leaf2_out ou[6] = {{0, 0, 0}}; + unsigned no = 0; + if (ombr_leaf_span_add(sp, &ns, result, 1u, 1u, 8u, 1)) + return OMEGA_BAD_ARG; + if (ombr_leaf2_view(sp, &ns, o_transfers, o_transfers_len, 8u, 0)) + return OMEGA_BAD_ARG; + a[0] = (uint64_t)(uintptr_t)o_transfers; + a[1] = o_transfers_len; + if (ombr_leaf2_view(sp, &ns, o_inputs, o_inputs_len, 8u, 1)) + return OMEGA_BAD_ARG; + a[2] = (uint64_t)(uintptr_t)o_inputs; + a[3] = o_inputs_len; + a[4] = o_params; + a[5] = o_width; + if (ombr_leaf2_overlap(sp, ns)) + return OMEGA_BAD_ARG; + return ombr_leaf2_run(ombr_leaf2_entry_osc_definite_inputs, a, result, 0, ou, no, 0); +} +__asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr_leaf2_entry_osc_layout_blocks\n.hidden ombr_leaf2_entry_osc_layout_blocks\nombr_leaf2_entry_osc_layout_blocks:\nhint #34\nb ombr_leaf2_code_osc_flow+12\n.previous\n"); +extern const unsigned char ombr_leaf2_entry_osc_layout_blocks[] __attribute__((visibility("hidden"))); +/* export fn osc_layout_blocks tags view short * source view ulong 24576 dest edit ulong 24576 blocks edit uint 1024 nblocks ulong to void */ +__attribute__((visibility("default"))) uint32_t omega2_osc_layout_blocks(uint64_t *result, const int16_t *o_tags, uint64_t o_tags_len, const uint64_t *o_source, uint64_t o_source_len, uint64_t *o_dest, uint64_t o_dest_len, uint32_t *o_blocks, uint64_t o_blocks_len, uint64_t o_nblocks) +{ + ombr_leaf_span sp[7]; + unsigned ns = 0; + uint64_t a[6] = {0}; + ombr_leaf2_out ou[6] = {{0, 0, 0}}; + unsigned no = 0; + if (ombr_leaf_span_add(sp, &ns, result, 1u, 1u, 8u, 1)) + return OMEGA_BAD_ARG; + if (ombr_leaf2_view(sp, &ns, o_tags, o_tags_len, 2u, 0)) + return OMEGA_BAD_ARG; + a[0] = (uint64_t)(uintptr_t)o_tags; + a[1] = o_tags_len; + if (ombr_leaf_span_add(sp, &ns, o_source, o_source_len, 24576u, 8u, 0)) + return OMEGA_BAD_ARG; + a[2] = (uint64_t)(uintptr_t)o_source; + if (ombr_leaf_span_add(sp, &ns, o_dest, o_dest_len, 24576u, 8u, 1)) + return OMEGA_BAD_ARG; + a[3] = (uint64_t)(uintptr_t)o_dest; + if (ombr_leaf_span_add(sp, &ns, o_blocks, o_blocks_len, 1024u, 4u, 1)) + return OMEGA_BAD_ARG; + a[4] = (uint64_t)(uintptr_t)o_blocks; + a[5] = o_nblocks; + if (ombr_leaf2_overlap(sp, ns)) + return OMEGA_BAD_ARG; + return ombr_leaf2_run(ombr_leaf2_entry_osc_layout_blocks, a, result, 0, ou, no, 0); +} __asm__(".section .text.omega_bridge,\"ax\",@progbits\n.balign 4\n.local ombr_leaf2_code_tensor_shape\n.hidden ombr_leaf2_code_tensor_shape\nombr_leaf2_code_tensor_shape:\n.byte 0x05,0x00,0x00,0x14,0x31,0x00,0x00,0x14,0x54,0x00,0x00,0x14,0x9a,0x00,0x00,0x14,0x09,0x01,0x00,0x14,0x3f,0x20,0x00,0xf1,0x48,0x05,0x00,0x54,0x23,0x00,0x80,0xd2,0x04,0x00,0x80,0xd2,0x05,0x00,0x80,0xd2,0x9f,0x00,0x01,0xeb,0x62,0x03,0x00,0x54,0x06,0x48,0x88,0xd2,0xe6,0x01,0xa0,0xf2,0xbf,0x00,0x06,0xeb,0xe2,0x03,0x00,0x54,0xa5,0x04,0x00,0x91,0x9f,0x00,0x01,0xeb,0x42,0x03,0x00,0x54,0x06,0x78,0x64,0xf8,0xdf,0x00,0x00,0xf1,0x61,0x00,0x00,0x54,0x40,0x00,0x80,0x92,0xc0,0x03,0x5f,0xd6,0x08,0x00,0xa8,0xd2,0xdf,0x00,0x08,0xeb,0x69,0x00,0x00,0x54,0xe0,0x00,0x80,0x92,0xc0,0x03,0x5f,0xd6,0x63,0x7c,0x06,0x9b,0x08,0x00,0xa8,0xd2,0x7f,0x00,0x08,0xeb,0x69,0x00,0x00,0x54,0xe0,0x00,0x80,0x92,0xc0,0x03,0x5f,0xd6,0x84,0x04,0x00,0x91,0x9f,0x00,0x01,0xeb,0xe3,0xfc,0xff,0x54,0x43,0x00,0x00,0xf9,0x00,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf8,0xff,0xff,0x17,0x3f,0x00,0x03,0xeb,0x21,0x04,0x00,0x54,0x3f,0x20,0x00,0xf1,0xe8,0x03,0x00,0x54,0x24,0x00,0x80,0xd2,0x05,0x00,0x80,0xd2,0x06,0x00,0x80,0xd2,0xbf,0x00,0x01,0xeb,0x42,0x02,0x00,0x54,0x08,0x48,0x88,0xd2,0xe8,0x01,0xa0,0xf2,0xdf,0x00,0x08,0xeb,0x82,0x02,0x00,0x54,0xc6,0x04,0x00,0x91,0x29,0x04,0x00,0xd1,0x28,0x01,0x05,0xcb,0x1f,0x01,0x03,0xeb,0xa2,0x01,0x00,0x54,0x44,0x78,0x28,0xf8,0x1f,0x01,0x01,0xeb,0x42,0x01,0x00,0x54,0x09,0x78,0x68,0xf8,0x84,0x7c,0x09,0x9b,0xa5,0x04,0x00,0x91,0xbf,0x00,0x01,0xeb,0x03,0xfe,0xff,0x54,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf8,0xff,0xff,0x17,0x3f,0x00,0x03,0xeb,0xa1,0x06,0x00,0x54,0x3f,0x20,0x00,0xf1,0x68,0x06,0x00,0x54,0x9f,0x00,0x05,0xeb,0x63,0x00,0x00,0x54,0xa0,0x00,0x80,0x92,0xc0,0x03,0x5f,0xd6,0xa8,0x04,0x00,0xd1,0x06,0x01,0x04,0xcb,0x08,0x00,0x80,0xd2,0x09,0x00,0x80,0xd2,0x1f,0x01,0x01,0xeb,0xc2,0x03,0x00,0x54,0x0a,0x48,0x88,0xd2,0xea,0x01,0xa0,0xf2,0x3f,0x01,0x0a,0xeb,0x62,0x04,0x00,0x54,0x29,0x05,0x00,0x91,0x1f,0x01,0x03,0xeb,0xc2,0x03,0x00,0x54,0x4a,0x78,0x68,0xf8,0x5f,0x01,0x00,0xf1,0x20,0x02,0x00,0x54,0x1f,0x01,0x01,0xeb,0x22,0x03,0x00,0x54,0x0b,0x78,0x68,0xf8,0x7f,0x01,0x00,0xf1,0x61,0x00,0x00,0x54,0xa0,0x00,0x80,0x92,0xc0,0x03,0x5f,0xd6,0x6c,0x05,0x00,0xd1,0x0a,0x02,0x00,0xb4,0xcd,0x08,0xca,0x9a,0x9f,0x01,0x0d,0xeb,0x69,0x00,0x00,0x54,0xa0,0x00,0x80,0x92,0xc0,0x03,0x5f,0xd6,0x8d,0x7d,0x0a,0x9b,0xc6,0x00,0x0d,0xcb,0x08,0x05,0x00,0x91,0x1f,0x01,0x01,0xeb,0x83,0xfc,0xff,0x54,0x00,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x41,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x61,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xf8,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf6,0xff,0xff,0x17,0x5f,0x00,0x01,0xeb,0x63,0x00,0x00,0x54,0x20,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x23,0x04,0x00,0xd1,0x64,0x00,0x02,0xcb,0x9f,0x00,0x01,0xeb,0xc2,0x00,0x00,0x54,0x00,0x78,0x64,0xf8,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0xbf,0x20,0x00,0xf1,0xa8,0x0d,0x00,0x54,0xbf,0x00,0x01,0xeb,0x63,0x0d,0x00,0x54,0xbf,0x00,0x03,0xeb,0x23,0x0d,0x00,0x54,0x06,0x00,0x80,0xd2,0x08,0x00,0x80,0xd2,0xdf,0x00,0x05,0xeb,0x82,0x0b,0x00,0x54,0x09,0x48,0x88,0xd2,0xe9,0x01,0xa0,0xf2,0x1f,0x01,0x09,0xeb,0xe2,0x0b,0x00,0x54,0x08,0x05,0x00,0x91,0xff,0x43,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xfe,0x27,0x00,0xf9,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x1b,0x40,0xf9,0xd4,0xff,0xff,0x97,0xe9,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xfe,0x27,0x40,0xf9,0xff,0x43,0x01,0x91,0xff,0x83,0x01,0xd1,0xe0,0x03,0x00,0xf9,0xe1,0x07,0x00,0xf9,0xe2,0x0b,0x00,0xf9,0xe3,0x0f,0x00,0xf9,0xe4,0x13,0x00,0xf9,0xe5,0x17,0x00,0xf9,0xe6,0x1b,0x00,0xf9,0xe8,0x1f,0x00,0xf9,0xe9,0x23,0x00,0xf9,0xea,0x27,0x00,0xf9,0xfe,0x2b,0x00,0xf9,0xe0,0x0b,0x40,0xf9,0xe1,0x0f,0x40,0xf9,0xe2,0x1b,0x40,0xf9,0xb9,0xff,0xff,0x97,0xea,0x03,0x00,0xaa,0xe0,0x03,0x40,0xf9,0xe1,0x07,0x40,0xf9,0xe2,0x0b,0x40,0xf9,0xe3,0x0f,0x40,0xf9,0xe4,0x13,0x40,0xf9,0xe5,0x17,0x40,0xf9,0xe6,0x1b,0x40,0xf9,0xe8,0x1f,0x40,0xf9,0xe9,0x23,0x40,0xf9,0xfe,0x2b,0x40,0xf9,0xff,0x83,0x01,0x91,0x3f,0x01,0x00,0xf1,0xeb,0x17,0x9f,0x9a,0x5f,0x01,0x00,0xf1,0xec,0x17,0x9f,0x9a,0x6d,0x01,0x0c,0xaa,0x6d,0x00,0x00,0xb4,0x40,0x00,0x80,0x92,0xc0,0x03,0x5f,0xd6,0x3f,0x01,0x0a,0xeb,0x20,0x01,0x00,0x54,0x3f,0x05,0x00,0xf1,0xeb,0x07,0x9f,0x9a,0x5f,0x05,0x00,0xf1,0xec,0x07,0x9f,0x9a,0x6d,0x01,0x0c,0x8a,0x6d,0x00,0x00,0xb4,0x40,0x00,0x80,0x92,0xc0,0x03,0x5f,0xd6,0xac,0x04,0x00,0xd1,0x8b,0x01,0x06,0xcb,0x3f,0x01,0x0a,0xeb,0xa9,0x00,0x00,0x54,0x7f,0x01,0x05,0xeb,0xc2,0x01,0x00,0x54,0x89,0x78,0x2b,0xf8,0x04,0x00,0x00,0x14,0x7f,0x01,0x05,0xeb,0x42,0x01,0x00,0x54,0x8a,0x78,0x2b,0xf8,0xc6,0x04,0x00,0x91,0xdf,0x00,0x05,0xeb,0xc3,0xf4,0xff,0x54,0x00,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf8,0xff,0xff,0x17,0x3f,0x00,0x03,0xeb,0x41,0x05,0x00,0x54,0x3f,0x20,0x00,0xf1,0x08,0x05,0x00,0x54,0x24,0x00,0x80,0xd2,0x05,0x00,0x80,0xd2,0x06,0x00,0x80,0xd2,0xbf,0x00,0x01,0xeb,0x42,0x03,0x00,0x54,0x08,0x48,0x88,0xd2,0xe8,0x01,0xa0,0xf2,0xdf,0x00,0x08,0xeb,0xa2,0x03,0x00,0x54,0xc6,0x04,0x00,0x91,0x29,0x04,0x00,0xd1,0x28,0x01,0x05,0xcb,0x1f,0x01,0x01,0xeb,0xc2,0x02,0x00,0x54,0x09,0x78,0x68,0xf8,0x3f,0x05,0x00,0xf1,0xea,0x07,0x9f,0x9a,0x1f,0x01,0x03,0xeb,0x22,0x02,0x00,0x54,0x4b,0x78,0x68,0xf8,0x7f,0x01,0x04,0xeb,0xec,0x07,0x9f,0x9a,0x4d,0x01,0x0c,0x8a,0x6d,0x00,0x00,0xb4,0x00,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0x84,0x7c,0x09,0x9b,0xa5,0x04,0x00,0x91,0xbf,0x00,0x01,0xeb,0x03,0xfd,0xff,0x54,0x20,0x00,0x80,0xd2,0xc0,0x03,0x5f,0xd6,0xe0,0x03,0x07,0xaa,0xf0,0x08,0x40,0xf9,0x00,0x02,0x1f,0xd6,0x61,0x00,0x80,0xd2,0xfc,0xff,0xff,0x17,0x81,0x00,0x80,0xd2,0xfa,0xff,0xff,0x17,0x21,0x01,0x80,0xd2,0xf8,0xff,0xff,0x17\n.previous\n"); static const char ombr_leaf2_ident_tensor_shape[] = "omega-ident 1 unit=tensor_shape abi=2 profile=OM-2 src=c28554bdff536175775cdf0bf99e71054300e9341059f24c9dbe65cccc0c0aac omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2"; __attribute__((visibility("default"))) const char *omega2_ident_tensor_shape(void) @@ -5121,6 +5242,38 @@ __attribute__((visibility("default"))) uint32_t omega2_tensor_is_row_major(uint6 * omega2_ and executes a trap instruction (__builtin_trap) on a nonzero status; it calls no C * library function. Regenerate it; do not edit it. */ #include "omega_api_decl.h" +/* export fn osc_statement_flow nodes view uchar * order edit ulong * flow edit uchar * to void */ +void osc_statement_flow(const uint8_t *o_nodes, size_t o_nodes_len, uint64_t *o_order, size_t o_order_len, uint8_t *o_flow, size_t o_flow_len) +{ + uint64_t r = 0; + if (omega2_osc_statement_flow(&r, o_nodes, o_nodes_len, o_order, o_order_len, o_flow, o_flow_len) != OMEGA_OK) + __builtin_trap(); + (void)r; +} +/* export fn osc_block_partition blocks view uchar * insns view uchar * location out ulong 1 to ulong */ +uint64_t osc_block_partition(const uint8_t *o_blocks, size_t o_blocks_len, const uint8_t *o_insns, size_t o_insns_len, uint64_t o_location[1]) +{ + uint64_t r = 0; + if (omega2_osc_block_partition(&r, o_blocks, o_blocks_len, o_insns, o_insns_len, o_location) != OMEGA_OK) + __builtin_trap(); + return r; +} +/* export fn osc_definite_inputs transfers view ulong * inputs edit ulong * params ulong width ulong to void */ +void osc_definite_inputs(const uint64_t *o_transfers, size_t o_transfers_len, uint64_t *o_inputs, size_t o_inputs_len, uint64_t o_params, uint64_t o_width) +{ + uint64_t r = 0; + if (omega2_osc_definite_inputs(&r, o_transfers, o_transfers_len, o_inputs, o_inputs_len, (uint64_t)o_params, (uint64_t)o_width) != OMEGA_OK) + __builtin_trap(); + (void)r; +} +/* export fn osc_layout_blocks tags view short * source view ulong 24576 dest edit ulong 24576 blocks edit uint 1024 nblocks ulong to void */ +void osc_layout_blocks(const int16_t *o_tags, size_t o_tags_len, const uint64_t o_source[24576], uint64_t o_dest[24576], uint32_t o_blocks[1024], uint64_t o_nblocks) +{ + uint64_t r = 0; + if (omega2_osc_layout_blocks(&r, o_tags, o_tags_len, o_source, 24576, o_dest, 24576, o_blocks, 1024, (uint64_t)o_nblocks) != OMEGA_OK) + __builtin_trap(); + (void)r; +} /* export fn tensor_shape_size dims view ulong * elems edit ulong 1 to long */ int64_t tensor_shape_size(const uint64_t *o_dims, size_t o_dims_len, uint64_t o_elems[1]) { diff --git a/src/omega_om_units.ident b/src/omega_om_units.ident index 1efa291c9..583d06ba9 100644 --- a/src/omega_om_units.ident +++ b/src/omega_om_units.ident @@ -34,5 +34,6 @@ omega-ident 1 unit=osc_scope abi=2 profile=OM-2 src=00be22c2c4868019d9f8bc71375a omega-ident 1 unit=osc_pool abi=2 profile=OM-2 src=e4198750f150c94c266f9e64627ec9ad1ecbd3f6dd462814038991ab0916b968 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=om/compiler/osc_pool.om omega-ident 1 unit=osc_trace abi=2 profile=OM-2 src=9db7adbb499a43db3ccff00093c4601eebc89450ea9f35e5d0a23ad9c014389a omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=om/compiler/osc_trace.om omega-ident 1 unit=osc_lifetimes abi=2 profile=OM-2 src=18c938959aaaa0a67d15a5cd71bbfa191c8b46e687ae78054e1a47035ab61352 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=om/compiler/osc_lifetimes.om +omega-ident 1 unit=osc_flow abi=2 profile=OM-2 src=561334dffdf9c38cab0f03a0d0f11a18dd3eab63efed08c14447e20693c38644 omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=om/compiler/osc_flow.om omega-ident 1 unit=tensor_shape abi=2 profile=OM-2 src=c28554bdff536175775cdf0bf99e71054300e9341059f24c9dbe65cccc0c0aac omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=src/tensor/tensor_shape.om omega-ident 1 unit=sgd_update abi=2 profile=OM-2 src=4900cd2a690ee463b79e6f1b1331b53e658423062a5b159b0ebdb6264afff17d omc=b6129ed51e07dd8ef7f33e78fdff99d6c4d914e3bccdaf8b344043b95017d4f2 path=src/train/sgd_update.om diff --git a/tests/compiler/neg/flow_return_from_regions.osc b/tests/compiler/neg/flow_return_from_regions.osc new file mode 100644 index 000000000..b062821c1 --- /dev/null +++ b/tests/compiler/neg/flow_return_from_regions.osc @@ -0,0 +1,10 @@ +// expect: UNSUPPORTED object=return line=9 +// transition: unreachable statement +fn f(flag: bool) -> u64 { + if flag { + pool p: [u64; 1] { return 1; } + } else { + arena a bound 1 { { return 2; } } + } + return unknown; +} diff --git a/tests/compiler/neg/flow_zero_trip_return.osc b/tests/compiler/neg/flow_zero_trip_return.osc new file mode 100644 index 000000000..43b6b121b --- /dev/null +++ b/tests/compiler/neg/flow_zero_trip_return.osc @@ -0,0 +1,6 @@ +// expect: MISSING_RETURN object=f line=6 +fn f(flag: bool) -> u64 { + while flag bound 1 { + return 1; + } +} diff --git a/tests/compiler/test_osc_flow.c b/tests/compiler/test_osc_flow.c new file mode 100644 index 000000000..51b873664 --- /dev/null +++ b/tests/compiler/test_osc_flow.c @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +#include "osc_ir.h" +#include "omega_native.h" + +#include +#include +#include + +static unsigned map_attempts; + +/* Standalone IR validation used to need only the caller's allocator. */ +void *__wrap_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset) +{ + (void)addr; (void)len; (void)prot; (void)flags; (void)fd; (void)offset; + map_attempts++; + errno = ENOMEM; + return MAP_FAILED; +} + +int main(void) +{ + static OscUnit unit; + OscFunc *f = &unit.funcs[0]; + unit.nfuncs = 1; + f->ninsns = f->nblocks = f->blocks[0].count = 1; + f->insns[0].op = OSC_I_RET; + f->insns[0].a = -1; + char error[128] = {0}; + if (osc_ir_validate(&unit, error, sizeof error) || map_attempts) { + fprintf(stderr, "standalone validation: %s, mmap attempts %u\n", error, map_attempts); + return 1; + } + + /* The scratch arrays have capacity for 512 blocks. Only block 0 is active. */ + static uint64_t source[24576], dest[24576]; + uint32_t blocks[1024] = {0}; + uint64_t result = 42; + int16_t tags[] = {0, 1}; + uint32_t status = omega2_osc_layout_blocks(&result, tags, 2, source, 24576, dest, 24576, blocks, 1024, 1); + if (status != 3 || result != 42 || blocks[1] || blocks[3]) { + fprintf(stderr, "inactive block tag: status %u, block counts %u %u\n", status, blocks[1], blocks[3]); + return 1; + } + puts("OSC_FLOW_PASS standalone validation without mmap; inactive block refused before mutation"); + return 0; +}