From 0b2f2a27ac698ecd2b861a6f52aea3772225dae2 Mon Sep 17 00:00:00 2001 From: Blaise Tine Date: Sat, 27 Mar 2021 21:27:08 -0400 Subject: [PATCH] minor updates --- driver/tests/tex_demo/kernel.c | 1 - runtime/include/vx_intrinsics.h | 7 +++++++ runtime/include/vx_tex.h | 19 ------------------- runtime/libvortexrt.a | Bin 13130 -> 13130 bytes 4 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 runtime/include/vx_tex.h diff --git a/driver/tests/tex_demo/kernel.c b/driver/tests/tex_demo/kernel.c index 8875ed13..89f7cafb 100644 --- a/driver/tests/tex_demo/kernel.c +++ b/driver/tests/tex_demo/kernel.c @@ -1,6 +1,5 @@ #include #include -#include #include "common.h" uint32_t ilog2 (uint32_t value) { diff --git a/runtime/include/vx_intrinsics.h b/runtime/include/vx_intrinsics.h index c9bb2ff9..3e582678 100644 --- a/runtime/include/vx_intrinsics.h +++ b/runtime/include/vx_intrinsics.h @@ -52,6 +52,13 @@ extern "C" { __asm__ __volatile__ ("csrc " __ASM_STR(csr) ", %0" :: "rK" (__v) : "memory"); \ }) +// Texture load +#define vx_tex(unit, u, v, l) ({ \ + register unsigned __r; \ + __asm__ __volatile__ (".insn r4 0x6b, 5, " __ASM_STR(unit) ", %0, %1, %2, %3" : "=r"(__r) : "r"(u), "r"(v), "r"(l)); \ + __r; \ +}) + // Set thread mask inline void vx_tmc(unsigned num_threads) { asm volatile (".insn s 0x6b, 0, x0, 0(%0)" :: "r"(num_threads)); diff --git a/runtime/include/vx_tex.h b/runtime/include/vx_tex.h deleted file mode 100644 index 85e30857..00000000 --- a/runtime/include/vx_tex.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef VX_TEX_H -#define VX_TEX_H - -#ifdef __cplusplus -extern "C" { -#endif - -unsigned vx_tex(unsigned unit, unsigned u, unsigned v, unsigned lod) { - unsigned result; - unsigned lod_unit = (unit << 24) | lod; - asm volatile (".insn r4 0x6b, 5, 0, %0, %1, %2, %3" : "=r"(result) : "r"(u), "r"(v), "r"(lod_unit)); - return result; -} - -#ifdef __cplusplus -} -#endif - -#endif \ No newline at end of file diff --git a/runtime/libvortexrt.a b/runtime/libvortexrt.a index d006ab256e06f0065aa676c520074654dcfaf85c..bc47d2df7223b1229e09a121ff3ab96b89cc8f70 100644 GIT binary patch delta 53 xcmX?=b}DUx9J7gu=|)9mMiwA#ve|>NfgQp+!=b|rVg2Ej5Cy5)EUsuQ1OT3@4io?Y delta 53 xcmX?=b}DUx9J7&$`9?)$MiwA#yxD`XfgQp+!=b|rVg2Ej5Cy5)EUsuQ1OT2(4iNwV