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/a64/tests/oir/r-rot.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 / a64 / tests / oir / r-rot.oir` 96 lines ยท 1872 bytes Raw Blame History 1 omegair 1 2 type %t32 = array u8 8 3 type %t33 = ref edit host %t32 4 global @g0 %t32 zero 5 fn @f0 flags 0 %1:u64 -> void 6 block ^0 7 %2 = gaddr %t33 @g0 8 %3 = const u64 0 9 br ^1 %0 %3 %1 10 block ^1 %4:tok %5:u64 %6:u64 11 %7 = const u64 8 12 %8 = lt bool %5 %7 13 cbr %4 %8 ^2 ^3 14 block ^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 22 br ^1 %13 %16 %15 23 block ^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 28 ret %21 29 end 30 fn @f1 flags 0 %1:u8 %2:u8 -> u64 31 block ^0 32 %3 = rotl u8 %1 %2 33 %4 = rotr u8 %1 %2 34 %5 = conv u64 0 %3 35 %6 = conv u64 0 %4 36 %7 = const u64 8 37 %8 = shl u64 %5 %7 38 %9 = or u64 %8 %6 39 retv %0 %9 40 end 41 fn @f2 flags 0 %1:u16 %2:u16 -> u64 42 block ^0 43 %3 = rotl u16 %1 %2 44 %4 = rotr u16 %1 %2 45 %5 = conv u64 0 %3 46 %6 = conv u64 0 %4 47 %7 = const u64 16 48 %8 = shl u64 %5 %7 49 %9 = or u64 %8 %6 50 retv %0 %9 51 end 52 export @f3 flags 0 -> i32 53 block ^0 54 %1 = const u8 181 55 %2 = const u64 0 56 br ^1 %0 %2 %2 57 block ^1 %3:tok %4:u64 %5:u64 58 %6 = const u64 12 59 %7 = lt bool %4 %6 60 cbr %3 %7 ^2 ^3 61 block ^2 %8:tok 62 %9 = const u64 23 63 %10 = mul u64 %4 %9 64 %11 = conv u8 0 %10 65 %12 %13 = call u64 %8 @f1 %1 %11 66 %14 = const u64 46531 67 %15 = conv u16 0 %14 68 %16 = const u64 2731 69 %17 = mul u64 %4 %16 70 %18 = conv u16 0 %17 71 %19 %20 = call u64 %12 @f2 %15 %18 72 %21 = const u64 32 73 %22 = shl u64 %20 %21 74 %23 = or u64 %22 %13 75 %24 = call void %19 @f0 %23 76 %25 = const u64 31 77 %26 = mul u64 %5 %25 78 %27 = add u64 %26 %23 79 %28 = const u64 1 80 %29 = add u64 %4 %28 81 br ^1 %24 %29 %27 82 block ^3 %30:tok 83 %31 = const u64 32 84 %32 = shr u64 %5 %31 85 %33 = xor u64 %5 %32 86 %34 = const u64 16 87 %35 = shr u64 %33 %34 88 %36 = xor u64 %33 %35 89 %37 = const u64 8 90 %38 = shr u64 %36 %37 91 %39 = xor u64 %36 %38 92 %40 = const u64 63 93 %41 = and u64 %39 %40 94 %42 = conv i32 0 %41 95 retv %30 %42 96 end