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
CUDApp / src / omega_dis_words.h
| 1 | /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ |
| 2 | #ifndef OMEGA_DIS_WORDS_H |
| 3 | #define OMEGA_DIS_WORDS_H |
| 4 | #include "cudapp_native.h" |
| 5 | #include <stdlib.h> |
| 6 | #ifndef CUDAPP_MIGRATION_PENDING_C_DISASM_WORDS |
| 7 | #define CUDAPP_MIGRATION_PENDING_C_DISASM_WORDS 0 |
| 8 | #endif |
| 9 | static inline uint64_t omega_dis_word(const uint8_t *b, uint64_t mode, uint64_t at, uint64_t prev) { |
| 10 | #if CUDAPP_MIGRATION_PENDING_C_DISASM_WORDS |
| 11 | uint64_t v = 0; |
| 12 | for (int i = 7; i >= 0; i--) v = v << 8 | b[i]; |
| 13 | return mode ? ((v & 0xfff) == 0x94d ? at + 16 : prev) : v; |
| 14 | #else |
| 15 | uint64_t r; |
| 16 | if (omega_dis_words(&r, b, 8, mode, at, prev)) abort(); |
| 17 | return r; |
| 18 | #endif |
| 19 | } |
| 20 | #endif |