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/CUDApp/blob/main/native/nvrm/wire.om # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / native / nvrm / wire.om` 107 lines · 1980 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 note NVIDIA580.173.02 nvos.h NVOS00/21/33/46/47/54 and Unix NVOS33 fd wrapper. 3 note Scalars are ordered exactly as fields in the vendor declaration, excluding padding. 4 note No native struct representation is used. All padding and initial status bytes are zero. 5 fn nvrm_wire_store b edit uchar 64 off ulong v ulong n ulong to void 6 for i ulong n 7 put b add off i uchar and shr v mul i 8 255 8 end 9 end 10 fn nvrm_pack op ulong a view ulong 16 b edit uchar 64 to ulong 11 for i ulong 64 12 put b i 0 13 end 14 if or eq op 1 eq op 2 15 for i ulong 4 16 nvrm_wire_store b mul i 4 get a i 4 17 end 18 nvrm_wire_store b 16 get a 4 8 19 nvrm_wire_store b 24 get a 5 4 20 ret 32 21 end 22 if eq op 3 23 for i ulong 3 24 nvrm_wire_store b mul i 4 get a i 4 25 end 26 ret 16 27 end 28 if eq op 4 29 for i ulong 3 30 nvrm_wire_store b mul i 4 get a i 4 31 end 32 for i ulong 3 33 nvrm_wire_store b add 16 mul i 8 get a add i 3 8 34 end 35 nvrm_wire_store b 44 get a 6 4 36 nvrm_wire_store b 48 get a 7 4 37 ret 56 38 end 39 if eq op 5 40 for i ulong 4 41 nvrm_wire_store b mul i 4 get a i 4 42 end 43 nvrm_wire_store b 16 get a 4 8 44 nvrm_wire_store b 24 get a 5 8 45 for i ulong 3 46 nvrm_wire_store b add 32 mul i 4 get a add i 6 4 47 end 48 nvrm_wire_store b 48 get a 9 8 49 ret 64 50 end 51 if eq op 6 52 for i ulong 5 53 nvrm_wire_store b mul i 4 get a i 4 54 end 55 nvrm_wire_store b 24 get a 5 8 56 nvrm_wire_store b 32 get a 6 8 57 ret 48 58 end 59 if eq op 7 60 nvrm_wire_store b 0 get a 0 4 61 ret 4 62 end 63 ret 0 64 end 65 fn nvrm_wire_load b view uchar 64 off ulong n ulong to ulong 66 v = ulong 0 67 for i ulong n 68 v = or v shl ulong get b add off i mul i 8 69 end 70 ret v 71 end 72 fn nvrm_wire_reply op ulong b view uchar 64 r edit ulong 2 to ulong 73 at = ulong 0 74 if or eq op 1 eq op 2 75 at = 28 76 else 77 if eq op 3 78 at = 12 79 else 80 if eq op 4 81 at = 40 82 else 83 if eq op 5 84 at = 56 85 else 86 if eq op 6 87 at = 40 88 else 89 ret 1 90 end 91 end 92 end 93 end 94 end 95 put r 0 nvrm_wire_load b at 4 96 put r 1 0 97 if eq op 1 98 put r 1 nvrm_wire_load b 8 4 99 end 100 if eq op 4 101 put r 1 nvrm_wire_load b 32 8 102 end 103 if eq op 5 104 put r 1 nvrm_wire_load b 48 8 105 end 106 ret 0 107 end