minor updates
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <vx_intrinsics.h>
|
#include <vx_intrinsics.h>
|
||||||
#include <vx_tex.h>
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
uint32_t ilog2 (uint32_t value) {
|
uint32_t ilog2 (uint32_t value) {
|
||||||
|
|||||||
@@ -52,6 +52,13 @@ extern "C" {
|
|||||||
__asm__ __volatile__ ("csrc " __ASM_STR(csr) ", %0" :: "rK" (__v) : "memory"); \
|
__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
|
// Set thread mask
|
||||||
inline void vx_tmc(unsigned num_threads) {
|
inline void vx_tmc(unsigned num_threads) {
|
||||||
asm volatile (".insn s 0x6b, 0, x0, 0(%0)" :: "r"(num_threads));
|
asm volatile (".insn s 0x6b, 0, x0, 0(%0)" :: "r"(num_threads));
|
||||||
|
|||||||
@@ -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
|
|
||||||
Binary file not shown.
Reference in New Issue
Block a user