minor update
This commit is contained in:
@@ -117,6 +117,26 @@ extern "C" {
|
|||||||
__r; \
|
__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
|
// Set thread mask
|
||||||
inline void vx_tmc(unsigned thread_mask) {
|
inline void vx_tmc(unsigned thread_mask) {
|
||||||
asm volatile (".insn s 0x6b, 0, x0, 0(%0)" :: "r"(thread_mask));
|
asm volatile (".insn s 0x6b, 0, x0, 0(%0)" :: "r"(thread_mask));
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ int run_test(const kernel_arg_t& kernel_arg,
|
|||||||
|
|
||||||
// wait for completion
|
// wait for completion
|
||||||
std::cout << "wait for completion" << std::endl;
|
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
|
// download destination buffer
|
||||||
std::cout << "download destination buffer" << std::endl;
|
std::cout << "download destination buffer" << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user