interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / gpu / nvidia / checks / arest-cache.om

30 lines · 926 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note gpu/nvidia/checks/arest-cache.om: arcache (gpu/nvidia/om/apirest/cache.om); Q is its 8 q words, the key word (its 4 low bytes, little-endian, are the key) and 17 records of 8 bytes, each word the record's bytes little-endian (the test's struct: valid, pinned, 2 pad, a 4-byte key). Composed before arest.om.
3text t_name "AREST-CACHE"
4text t_au "cache"
5note the 17 records from word s of q, 8 bytes each, little-endian
6fn arrec q view ulong 64 s ulong x edit uchar 136 to void
7for i ulong 17
8w = get q add s i
9c = mul i 8
10for b ulong 8
11put x add c b uchar and shr w mul b 8 255
12end
13end
14end
15fn arop q view ulong 64 nq ulong ny ulong o edit ulong 128 to ulong
16if or ne nq 26 ne ny 0
17ckbad
18end
19a = new ulong 8 0
20for i ulong 8
21put a i get q i
22end
23key = new uchar 4 0
24for b ulong 4
25put key b uchar and shr get q 8 mul b 8 255
26end
27x = new uchar 136 0
28arrec q 9 x
29ret arcache a x key
30end