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/equiv/bitrev.unit.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 / seed / equiv / bitrev.unit.om` 18 lines ยท 480 bytes Raw Blame History 1 note irequiv fixture (issue 826): reverse the bits of a byte. 2 note bitrev8 is copied verbatim from tests/one_layer/omegese/dev/dev09.omegese 3 note (omega-mv `62d1d0d6`). bitrev8s is a refactor: a three-stage swap network. 4 fn bitrev8 x uchar to uchar 5 r = uchar 0 6 for i uint 8 7 r = shl r 1 8 b = and x 1 9 r = or r b 10 x = shr x 1 11 end 12 ret r 13 end 14 fn bitrev8s x uchar to uchar 15 x = or shr and x 240 4 shl and x 15 4 16 x = or shr and x 204 2 shl and x 51 2 17 ret or shr and x 170 1 shl and x 85 1 18 end