mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 21:39:10 -04:00
count_leading_zeros fix
This commit is contained in:
parent
87e613d29d
commit
b634f9f47d
2 changed files with 10 additions and 10 deletions
|
@ -20,9 +20,9 @@ template <typename T>
|
|||
constexpr uint32_t count_leading_zeros(T value) {
|
||||
static_assert(std::is_integral<T>::value, "invalid data type");
|
||||
if constexpr (sizeof(T) > 4) {
|
||||
return value ? __builtin_clzll(value) : (sizeof(T) * 8);
|
||||
return value ? __builtin_clzll(value) - (64 - sizeof(T) * 8) : sizeof(T) * 8;
|
||||
} else {
|
||||
return value ? __builtin_clz(value) : (sizeof(T) * 8);
|
||||
return value ? __builtin_clz(value) - (32 - sizeof(T) * 8) : sizeof(T) * 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
#define MEM_CLOCK_RATIO 1
|
||||
#endif
|
||||
|
||||
#define LSU_WORD_SIZE (XLEN / 8)
|
||||
#define LSU_CHANNELS NUM_LSU_LANES
|
||||
#define LSU_NUM_REQS (NUM_LSU_BLOCKS * LSU_CHANNELS)
|
||||
inline constexpr int LSU_WORD_SIZE = (XLEN / 8);
|
||||
inline constexpr int LSU_CHANNELS = NUM_LSU_LANES;
|
||||
inline constexpr int LSU_NUM_REQS = (NUM_LSU_BLOCKS * LSU_CHANNELS);
|
||||
|
||||
#define DCACHE_WORD_SIZE LSU_LINE_SIZE
|
||||
#define DCACHE_CHANNELS UP((NUM_LSU_LANES * (XLEN / 8)) / DCACHE_WORD_SIZE)
|
||||
#define DCACHE_NUM_REQS (NUM_LSU_BLOCKS * DCACHE_CHANNELS)
|
||||
inline constexpr int DCACHE_WORD_SIZE = LSU_LINE_SIZE;
|
||||
inline constexpr int DCACHE_CHANNELS = UP((NUM_LSU_LANES * (XLEN / 8)) / DCACHE_WORD_SIZE);
|
||||
inline constexpr int DCACHE_NUM_REQS = (NUM_LSU_BLOCKS * DCACHE_CHANNELS);
|
||||
|
||||
#define NUM_SOCKETS UP(NUM_CORES / SOCKET_SIZE)
|
||||
inline constexpr int NUM_SOCKETS = UP(NUM_CORES / SOCKET_SIZE);
|
||||
|
||||
#define PER_ISSUE_WARPS NUM_WARPS / ISSUE_WIDTH
|
||||
inline constexpr int PER_ISSUE_WARPS = NUM_WARPS / ISSUE_WIDTH;
|
Loading…
Add table
Add a link
Reference in a new issue