mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
minor updates
This commit is contained in:
parent
39a8579c27
commit
0b2f2a27ac
4 changed files with 7 additions and 20 deletions
|
@ -1,6 +1,5 @@
|
|||
#include <stdint.h>
|
||||
#include <vx_intrinsics.h>
|
||||
#include <vx_tex.h>
|
||||
#include "common.h"
|
||||
|
||||
uint32_t ilog2 (uint32_t value) {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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.
Loading…
Add table
Add a link
Reference in a new issue