diff --git a/runtime/include/vx_intrinsics.h b/runtime/include/vx_intrinsics.h index 9c3149d7..abbca493 100644 --- a/runtime/include/vx_intrinsics.h +++ b/runtime/include/vx_intrinsics.h @@ -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)); diff --git a/tests/regression/sort/main.cpp b/tests/regression/sort/main.cpp index c5f23141..96032a91 100644 --- a/tests/regression/sort/main.cpp +++ b/tests/regression/sort/main.cpp @@ -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;