interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / qualification / om2 / sec / s3s4 / unroll-growth-om1.om

34 lines · 1042 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note OM-1 TWIN of unroll-growth-rolled.om for the pinned compiler 734f0a39: same exit status.
3note Contract section 4 lines 109-111: a function's emitted words after unrolling are at most 65536,
4note else error 14 (obligation=growth). Two nested unroll 64 loops make 4096 copies of a 12-statement
5note body of unsigned ops on run-time values (each statement at least two instructions, so at least
6note 98304 words). Each loop alone is within the 64-copy bound; the word bound refuses it.
7note Twin unroll-growth-diag.om checks the om2 diag record.
8note OM-1 unit: this line replaces the om2 line
9fn grow a ulong to ulong
10x = a
11s = add a 1
12t = add a 2
13u = add a 3
14for i ulong 64
15for j ulong 64
16x = add mul x 3 add s add i j
17s = xor s shr x 7
18t = add t mul s x
19u = xor u shl t 3
20x = add x mul u 5
21s = add s xor x t
22t = xor t shr s 11
23u = add u mul t 9
24x = xor x add u s
25s = mul s add x 1
26t = add t xor u 13
27u = xor u add s t
28end
29end
30ret xor xor x s xor t u
31end
32fn main to int
33ret int and grow 5 255
34end