omega-mcp
aien-dev/omega-mcp
Brought by drakestapleton
omega-mcp / data / examples / om2_unroll.om
| 1 | om2 |
| 2 | note unroll compiles the body K times with a constant counter; inline compiles each call in place |
| 3 | fn sq x ulong to ulong inline |
| 4 | ret mul x x |
| 5 | end |
| 6 | fn main to int |
| 7 | s = ulong 0 |
| 8 | for i ulong 4 unroll |
| 9 | s = add s sq i |
| 10 | end |
| 11 | ret int s |
| 12 | end |