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/codegen/cg_fields.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 / codegen / cg_fields.om` 47 lines ยท 1151 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note ABI raw slots: op,dst,src1,src2,src3,ureg,imm,control,uniform,p0,not,bar,dsub,s1sub,s2sub,s3sub. 3 note kind 0 packs encoder records (bar at bit 8); kind 1 unpacks emitter records (bar at bit 48). 4 note kind 2 converts sixteen little-endian instruction bytes in raw to four u32 words. 5 fn cg_fields kind ulong raw edit ulong 16 rec edit ulong 8 to ulong 6 if eq kind 0 7 for i ulong 6 8 put rec i get raw i 9 end 10 put rec 6 or get raw 6 shl get raw 7 32 11 f = or get raw 8 shl get raw 9 1 12 f = or f shl get raw 10 2 13 f = or f shl get raw 11 8 14 for i ulong 4 15 f = or f shl get raw add i 12 add 16 mul i 8 16 end 17 put rec 7 f 18 ret 0 19 end 20 if eq kind 1 21 for i ulong 6 22 put raw i get rec i 23 end 24 put raw 6 and get rec 6 `4294967295` 25 put raw 7 shr get rec 6 32 26 f = get rec 7 27 put raw 8 and f 1 28 put raw 9 and shr f 1 1 29 put raw 10 and shr f 2 1 30 put raw 11 and shr f 48 255 31 for i ulong 4 32 put raw add i 12 and shr f add 16 mul i 8 255 33 end 34 ret 0 35 end 36 if eq kind 2 37 for i ulong 4 38 b = mul i 4 39 w = or get raw b shl get raw add b 1 8 40 w = or w shl get raw add b 2 16 41 w = or w shl get raw add b 3 24 42 put raw i w 43 end 44 ret 0 45 end 46 ret 4 47 end