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 / c-conv-u64-i64.oir

48 lines · 967 bytes Raw Blame History
1omegair 1
2type %t32 = array u8 8
3type %t33 = ref edit host %t32
4global @g0 %t32 zero
5fn @f0 flags 0 %1:u64 -> void
6block ^0
7%2 = gaddr %t33 @g0
8%3 = const u64 0
9br ^1 %0 %3 %1
10block ^1 %4:tok %5:u64 %6:u64
11%7 = const u64 8
12%8 = lt bool %5 %7
13cbr %4 %8 ^2 ^3
14block ^2 %9:tok
15%10 = const u64 1
16%11 = chk.bounds 3 %9 %2 %5 %10
17%12 = conv u8 0 %6
18%13 = store %11 %2 %5 %12
19%14 = const u64 8
20%15 = shr u64 %6 %14
21%16 = add u64 %5 %10
22br ^1 %13 %16 %15
23block ^3 %17:tok
24%18 = const i32 1
25%19 = const u64 0
26%20 = chk.slice 3 %17 %2 %19 %7
27%21 %22 = host i64 54 %20 %18 %2 %19 %7
28ret %21
29end
30fn @f1 flags 0 %1:u64 -> i64
31block ^0
32%2 = chk.conv i64 5 %0 %1
33%3 = conv i64 0 %1
34retv %2 %3
35end
36export @f2 flags 0 -> i32
37block ^0
38%1 = const u64 9223372036854775807
39%2 %3 = call i64 %0 @f1 %1
40%4 = bitcast u64 %3
41%5 = call void %2 @f0 %4
42%6 = const u64 9223372036854775808
43%7 %8 = call i64 %5 @f1 %6
44%9 = bitcast u64 %8
45%10 = call void %7 @f0 %9
46%11 = const i32 0
47retv %10 %11
48end