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 / ng / a64 / tests / oir / mem2.oir

134 lines · 2912 bytes Raw Blame History
1omegair 1
2type %t32 = array u8 16
3type %t33 = ref edit host %t32
4type %t34 = array i64 16
5type %t35 = ref edit host %t34
6type %t36 = array u16 16
7type %t37 = ref edit host %t36
8type %t38 = array i32 16
9type %t39 = ref edit host %t38
10type %t40 = ref view host %t32
11global @g0 %t32 data 00ff7f80010203fefdfc102030405060
12global @g1 %t34 zero
13global @g2 %t36 zero
14global @g3 %t38 zero
15global @g4 %t32 zero
16fn @f0 flags 0 %1:u64 -> void
17block ^0
18%2 = const u64 0
19br ^1 %0 %2
20block ^1 %3:tok %4:u64
21%5 = const u64 16
22%6 = lt bool %4 %5
23cbr %3 %6 ^2 ^3
24block ^2 %7:tok
25%8 = gaddr %t40 @g0
26%9 = gaddr %t35 @g1
27%10 = gaddr %t37 @g2
28%11 = gaddr %t39 @g3
29%12 = const u64 1
30%13 = chk.bounds 3 %7 %8 %4 %12
31%14 = load u8 %13 %8 %4
32%15 = conv i64 0 %14
33%16 = bitcast i64 %1
34%17 = mul i64 %15 %16
35%18 = const i64 -1000003
36%19 = add i64 %17 %18
37%20 = chk.bounds 3 %13 %9 %4 %12
38%21 = store %20 %9 %4 %19
39%22 = conv u16 0 %19
40%23 = chk.bounds 3 %21 %10 %4 %12
41%24 = store %23 %10 %4 %22
42%25 = conv i32 0 %19
43%26 = chk.bounds 3 %24 %11 %4 %12
44%27 = store %26 %11 %4 %25
45%28 = const u8 77
46%29 = xor u8 %14 %28
47%30 = gaddr %t33 @g4
48%31 = chk.bounds 3 %27 %30 %4 %12
49%32 = store %31 %30 %4 %29
50%33 = add u64 %4 %12
51br ^1 %32 %33
52block ^3 %34:tok
53ret %34
54end
55fn @f1 flags 0 -> u64
56block ^0
57%1 = gaddr %t35 @g1
58%2 = gaddr %t37 @g2
59%3 = gaddr %t39 @g3
60%4 = gaddr %t33 @g4
61%5 = const u64 0
62br ^1 %0 %5 %5
63block ^1 %6:tok %7:u64 %8:u64
64%9 = const u64 16
65%10 = lt bool %7 %9
66cbr %6 %10 ^2 ^3
67block ^2 %11:tok
68%12 = const u64 1
69%13 = chk.bounds 3 %11 %1 %7 %12
70%14 = load i64 %13 %1 %7
71%15 = bitcast u64 %14
72%16 = chk.bounds 3 %13 %2 %7 %12
73%17 = load u16 %16 %2 %7
74%18 = conv u64 0 %17
75%19 = chk.bounds 3 %16 %3 %7 %12
76%20 = load i32 %19 %3 %7
77%21 = conv i64 0 %20
78%22 = bitcast u64 %21
79%23 = chk.bounds 3 %19 %4 %7 %12
80%24 = load u8 %23 %4 %7
81%25 = conv u64 0 %24
82%26 = const u64 1099511628211
83%27 = mul u64 %8 %26
84%28 = xor u64 %27 %15
85%29 = add u64 %28 %18
86%30 = xor u64 %29 %22
87%31 = add u64 %30 %25
88%32 = add u64 %7 %12
89br ^1 %23 %32 %31
90block ^3 %33:tok
91retv %33 %8
92end
93fn @f2 flags 0 %1:u64 -> void
94block ^0
95%2 = gaddr %t33 @g4
96%3 = const u64 0
97br ^1 %0 %3 %1
98block ^1 %4:tok %5:u64 %6:u64
99%7 = const u64 8
100%8 = lt bool %5 %7
101cbr %4 %8 ^2 ^3
102block ^2 %9:tok
103%10 = const u64 1
104%11 = chk.bounds 3 %9 %2 %5 %10
105%12 = conv u8 0 %6
106%13 = store %11 %2 %5 %12
107%14 = const u64 8
108%15 = shr u64 %6 %14
109%16 = add u64 %5 %10
110br ^1 %13 %16 %15
111block ^3 %17:tok
112%18 = const i32 1
113%19 = const u64 0
114%20 = chk.slice 3 %17 %2 %19 %7
115%21 %22 = host i64 54 %20 %18 %2 %19 %7
116ret %21
117end
118export @f3 flags 0 -> i32
119block ^0
120%1 = const u64 18446744073709551557
121%2 = call void %0 @f0 %1
122%3 %4 = call u64 %2 @f1
123%5 = call void %3 @f2 %4
124%6 = gaddr %t33 @g4
125%7 = const i32 1
126%8 = const u64 0
127%9 = const u64 16
128%10 = chk.slice 3 %5 %6 %8 %9
129%11 %12 = host i64 54 %10 %7 %6 %8 %9
130%13 = const u64 255
131%14 = and u64 %4 %13
132%15 = conv i32 0 %14
133retv %11 %15
134end