minor update

This commit is contained in:
Blaise Tine 2021-11-14 09:06:13 -05:00
parent 27a65fdee7
commit 1501360f4b
2 changed files with 21 additions and 1 deletions

View file

@ -117,6 +117,26 @@ extern "C" {
__r; \
})
// Lerp instruction
#define vx_lerp(a, b, s) ({ \
unsigned __r; \
unsigned __a = a; \
unsigned __b = b; \
unsigned __s = s; \
__asm__ __volatile__ (".insn r4 0x6b, 7, " __ASM_STR(unit) ", %0, %1, %2, %3" : "=r"(__r : "r"(__a), "r"(__b), "r"(__s)); \
__r; \
})
// Conditional move
#define vx_cmov(c, t, f) ({ \
unsigned __r; \
unsigned __c = c; \
unsigned __t = t; \
unsigned __f = f; \
__asm__ __volatile__ (".insn r4 0x6b, 6, " __ASM_STR(unit) ", %0, %1, %2, %3" : "=r"(__r : "r"(__c), "r"(__t), "r"(__f)); \
__r; \
})
// Set thread mask
inline void vx_tmc(unsigned thread_mask) {
asm volatile (".insn s 0x6b, 0, x0, 0(%0)" :: "r"(thread_mask));

View file

@ -98,7 +98,7 @@ int run_test(const kernel_arg_t& kernel_arg,
// wait for completion
std::cout << "wait for completion" << std::endl;
RT_CHECK(vx_ready_wait(device, -1));
RT_CHECK(vx_ready_wait(device, MAX_TIMEOUT));
// download destination buffer
std::cout << "download destination buffer" << std::endl;