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 / omc / om2 / s5 / scrub-flive.om

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