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
omega-mv / seed / qualification / om2 / sec / s3s4 / unroll-nest.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note Contract section 4 lines 87-92 and 105: nested unrolled loops, 8 x 8 = 64 copies of the inner body |
| 3 | note with i and j bound to constants; the folded index add mul i 8 j into the 64-element array m is a |
| 4 | note constant in range (no error 21). Removing unroll (twin unroll-nest-rolled.om) changes nothing. |
| 5 | note Expected stdout: oracle/s3s4/exp/unroll-nest.out (python3, oracle/s3s4/oracle.py). |
| 6 | om2 |
| 7 | fn main to int |
| 8 | m = new ulong 64 0 |
| 9 | f = ulong 14695981039346656037 |
| 10 | for i ulong 8 unroll |
| 11 | for j ulong 8 unroll |
| 12 | f = mul xor f add mul i 8 j 1099511628211 |
| 13 | put m add mul i 8 j add mul i 1000 j |
| 14 | end |
| 15 | end |
| 16 | pu f |
| 17 | g = ulong 0 |
| 18 | for k ulong 64 |
| 19 | g = add mul g 3 get m k |
| 20 | end |
| 21 | pu g |
| 22 | ret 0 |
| 23 | end |