Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/seed/ng/tests/ir/a-arith.oir # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / ng / tests / ir / a-arith.oir` 80 lines ยท 1563 bytes Raw Blame History 1 omegair 1 2 fn @f0 flags 0 %1:i32 %2:i32 -> i32 3 block ^0 4 %3 = chk.add 1 %0 %1 %2 5 %4 = add i32 %1 %2 6 %5 = chk.divz 2 %3 %2 7 %6 = chk.divovf 1 %5 %4 %2 8 %7 = div i32 %4 %2 9 %8 = rem i32 %4 %2 10 %9 = mul i32 %7 %8 11 %10 = const i32 -7 12 %11 = lt bool %9 %10 13 %12 = select i32 %11 %9 %10 14 %13 = chk.true 9 %6 %11 15 fact.true 0 %11 16 retv %13 %12 17 end 18 fn @f1 flags 0 %1:f64 -> i64 19 block ^0 20 %2 = const f64 0x3ff0000000000000 21 %3 = fma f64 %1 %2 %2 22 %4 = fsqrt f64 %3 23 %5 = fabs f64 %4 24 %6 = fmath f64 0 %5 25 %7 = conv f32 1 %6 26 %8 = conv f64 0 %7 27 %9 = chk.conv i64 5 %0 %8 28 %10 = conv i64 0 %8 29 %11 = bitcast u64 %8 30 %12 = const f16 0x3c00 31 %13 = conv f32 0 %12 32 %14 = neg f32 %13 33 %15 = min f32 %13 %14 34 %16 = eq bool %15 %14 35 retv %9 %10 36 end 37 fn @f2 flags 0 %1:u64 -> u64 38 block ^0 39 %2 = const u64 0 40 br ^1 %0 %2 %2 41 block ^1 %3:tok %4:u64 %5:u64 42 %6 = lt bool %4 %1 43 cbr %3 %6 ^2 ^3 44 block ^2 %7:tok 45 %8 = chk.fuel 4 %7 %4 %1 46 %9 = const u64 1 47 %10 = add u64 %4 %9 48 %11 = add u64 %5 %4 49 br ^1 %8 %10 %11 50 block ^3 %12:tok 51 retv %12 %5 52 end 53 export @f3 flags 0 -> i32 54 block ^0 55 %1 = const i32 3 56 %2 = const i32 4 57 %3 %4 = call i32 %0 @f0 %1 %2 58 %5 = const f64 0x4000000000000000 59 %6 %7 = call i64 %3 @f1 %5 60 %8 = const u64 10 61 %9 %10 = call u64 %6 @f2 %8 62 %11 = chk.shift 7 %9 %2 63 %12 = chk.shl 1 %11 %1 %2 64 %13 = shl i32 %1 %2 65 %14 = shr i32 %13 %2 66 %15 = chk.neg 1 %12 %14 67 %16 = neg i32 %14 68 %17 = chk.sub 1 %15 %16 %1 69 %18 = chk.mul 1 %17 %16 %1 70 %19 = const u32 5 71 %20 = rotl u32 %19 %19 72 %21 = xor u32 %20 %19 73 %22 = not u32 %21 74 %23 = eq bool %22 %19 75 cbr %18 %23 ^1 ^2 76 block ^1 %24:tok 77 trap 3 %24 78 block ^2 %25:tok 79 exit %25 %4 80 end