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 / host / tests / cpufence.om

43 lines · 667 bytes Raw Blame History
1note cpufence / cpurelax (#939): store the payload, publish it with a fence, then set the flag. A bounded
2note poll spins with cpurelax. Values live in registers across both words must survive them. Exit 42.
3global data ulong 4
4global flag ulong 1
5fn publish v ulong to ulong
6put data 2 v
7cpufence
8put flag 0 v
9ret get flag 0
10end
11fn main to int
12a = ulong 11
13b = ulong 22
14put data 0 a
15put data 1 b
16cpufence
17put flag 0 1
18n = ulong 0
19while lt n 3
20cpurelax
21n = add n 1
22end
23cpufence
24if ne get flag 0 1
25ret 1
26end
27if ne add get data 0 get data 1 33
28ret 2
29end
30if ne publish 7 7
31ret 3
32end
33if ne get data 2 7
34ret 4
35end
36if ne add a b 33
37ret 5
38end
39if ne n 3
40ret 6
41end
42ret 42
43end