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 / omc / om2 / s5 / scrub-flive.om
| 1 | note S5 scrub: live floats survive. An f32/f64 local name lives in the V twin of its pool slot (v16 + j), |
| 2 | note a held float operand and an earlier float call argument in twins, a float parameter in its x register |
| 3 | note (checks 22-24: a regression guard, x registers were already spared). scrub zeroes the dead twins only |
| 4 | note (OMEGESE 9.13.1). Exit 0, else the check's number. omc 24caacf4 (main after #853 and #875) zeroed |
| 5 | note V0-V31: exit 1, and each of checks 2, 3, 4 and 21 alone also fails there. |
| 6 | om2 |
| 7 | fn two a f64 b f64 to f64 |
| 8 | ret add mul a f64 10.0 b |
| 9 | end |
| 10 | fn keepf a f64 b f64 to int |
| 11 | x = add a f64 2.25 |
| 12 | k = scrub 64 |
| 13 | if ne k 0 |
| 14 | ret 20 |
| 15 | end |
| 16 | if ne x f64 3.75 |
| 17 | ret 21 |
| 18 | end |
| 19 | if ne a f64 1.5 |
| 20 | ret 22 |
| 21 | end |
| 22 | b = add b f64 1.0 |
| 23 | k = scrub 16 |
| 24 | if ne b f64 3.5 |
| 25 | ret 23 |
| 26 | end |
| 27 | if ne add a b f64 5.0 |
| 28 | ret 24 |
| 29 | end |
| 30 | ret 0 |
| 31 | end |
| 32 | fn main to int |
| 33 | f = f64 1.5 |
| 34 | g = f64 2.5 |
| 35 | k = scrub 16 |
| 36 | h = add f g |
| 37 | if ne h f64 4.0 |
| 38 | ret 1 |
| 39 | end |
| 40 | s = f32 0.75 |
| 41 | k = scrub 32 |
| 42 | if ne s f32 0.75 |
| 43 | ret 2 |
| 44 | end |
| 45 | y = add mul f g f64 scrub 32 |
| 46 | if ne y f64 3.75 |
| 47 | ret 3 |
| 48 | end |
| 49 | w = two mul f g f64 scrub 16 |
| 50 | if ne w f64 37.5 |
| 51 | ret 4 |
| 52 | end |
| 53 | r = keepf f g |
| 54 | if ne r 0 |
| 55 | ret r |
| 56 | end |
| 57 | if ne f f64 1.5 |
| 58 | ret 5 |
| 59 | end |
| 60 | if ne g f64 2.5 |
| 61 | ret 6 |
| 62 | end |
| 63 | ret 0 |
| 64 | end |