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/gpu/nvidia/om/components/api_ew_plan.om # 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 / gpu / nvidia / om / components / api_ew_plan.om` 79 lines ยท 951 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 fn api_ew_plan mode ulong a edit ulong 16 to ulong 3 n = get a 0 4 if eq mode 4 5 if or eq n 0 gt get a 2 get a 3 6 ret 1 7 end 8 ret 0 9 end 10 dim = get a 1 11 if eq mode 0 12 if or eq n 0 or eq dim 0 ne rem dim 128 0 13 ret 1 14 end 15 if gt dim 16384 16 ret 2 17 end 18 end 19 if eq mode 1 20 if or eq n 0 or lt dim 2 ne and dim 1 0 21 ret 1 22 end 23 if gt dim 2048 24 ret 2 25 end 26 end 27 if le mode 1 28 nr = n 29 if gt nr 1024 30 nr = 1024 31 end 32 put a 8 nr 33 put a 9 mul mul nr dim 4 34 if eq mode 0 35 put a 10 div dim 128 36 f = div f32 1 f32 dim 37 put a 11 ulong bitcast uint f 38 else 39 put a 10 div dim 2 40 end 41 ret 0 42 end 43 if eq mode 2 44 if eq n 0 45 ret 1 46 end 47 ni = n 48 if gt ni 131072 49 ni = 131072 50 end 51 put a 8 ni 52 put a 9 div add ni 127 128 53 put a 10 mul ni 4 54 ret 0 55 end 56 if eq mode 3 57 if or eq n 0 ne rem n 128 0 58 ret 1 59 end 60 ret 0 61 end 62 if eq mode 5 63 if gt n 3 64 ret 1 65 end 66 ret 0 67 end 68 if eq mode 6 69 if or eq n 0 gt n `9223372036854775807` 70 n = 1 71 end 72 if gt n 3 73 n = 3 74 end 75 put a 8 n 76 ret 0 77 end 78 ret 1 79 end