interplane.Get Omega
Read in your language

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

branch main Branches Tags History

CUDApp / om / apiviews / no_avbf.om

27 lines · 703 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Freestanding scalar ABI for bf16.om. Float bit transport stays in C;
3note both NaN policies and round-to-nearest-even are seeded Omega.
4note Keep equivalent to canonical av_rne/av_stbf; no_avbf is the sole export.
5fn na_rne u uint to uint
6a = and u 2139095040
7if eq a 2139095040
8if ne and u 8388607 0
9ret or shr u 16 64
10end
11ret shr u 16
12end
13ret shr add add u 32767 and shr u 16 1 16
14end
15fn na_stbf u uint to uint
16if gt and u 2147483647 2139095040
17ret 32704
18end
19ret shr add add u 32767 and shr u 16 1 16
20end
21fn no_avbf md ulong raw ulong to ulong
22u = uint raw
23if eq md 0
24ret ulong and na_rne u 65535
25end
26ret ulong and na_stbf u 65535
27end