Skip to content

Commit

Permalink
Clearing up debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Anunalla committed Oct 9, 2024
1 parent 5bb7906 commit 90e3bef
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 97 deletions.
40 changes: 1 addition & 39 deletions src/sst/elements/vanadis/inst/regfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,45 +194,7 @@ class VanadisRegisterFile
fp_reg_storage[index + i] = 0;
}
}

template <typename T>
void setIntReg2(const uint16_t reg, const T val, const bool sign_extend = true)
{
assert(reg < count_int_regs);

if ( LIKELY(reg != decoder_opts->getRegisterIgnoreWrites()) ) {
int index = get_reg_index(reg, 0);
T* reg_ptr_t = (T*)(&int_reg_storage[index]);
char* reg_ptr_c = (char*)(reg_ptr_t);

reg_ptr_t[0] = val;

// if we need to sign extend, check if the most-significant bit is a 1, if yes then
// fill with 0xFF, otherwise fill with 0x00
std::memset(
&reg_ptr_c[sizeof(T)],
sign_extend ? ((val & (static_cast<T>(1) << (sizeof(T) * 8 - 1))) == 0) ? 0x00 : 0xFF : 0x00,
int_reg_width - sizeof(T));
}
}

template <typename T>
void setFPReg2(const uint16_t reg, const T val)
{
assert(reg < count_fp_regs);
assert(sizeof(T) <= fp_reg_width);

uint8_t* val_ptr = (uint8_t*) &val;
int index = get_reg_index(reg, 1);
for(auto i = 0; i < sizeof(T); ++i) {
fp_reg_storage[index + i] = val_ptr[i];
}

// Pad with extra zeros if needed
for(auto i = sizeof(T); i < fp_reg_width; ++i) {
fp_reg_storage[index + i] = 0;
}
}


uint32_t getHWThread() const { return hw_thread; }
uint16_t getThreadCount() const { return threadCount; }
Expand Down
Loading

0 comments on commit 90e3bef

Please sign in to comment.