sv_freg_t fsgnj128(sv_freg_t a, sv_freg_t b, bool n, bool x);
+ sv_reg_t adjust_load(sv_reg_t const& v, size_t width, bool ext);
#include "sv_insn_decl.h"
};
#include "sv_mmu.h"
-#define sv_load_func(type) \
+#define sv_load_func(type, ext) \
sv_reg_t sv_mmu_t::load_##type(reg_t const& addr) { \
type##_t v = mmu_t::load_##type(addr); \
- return sv_reg_t(v); \
+ return proc->s.adjust_load(sv_reg_t(v), sizeof(type##_t), ext); \
}
// load value from memory at aligned address; zero extend to register width
-sv_load_func(uint8)
-sv_load_func(uint16)
-sv_load_func(uint32)
-sv_load_func(uint64)
+sv_load_func(uint8, true )
+sv_load_func(uint16, true )
+sv_load_func(uint32, true )
+sv_load_func(uint64, true )
// load value from memory at aligned address; sign extend to register width
-sv_load_func(int8)
-sv_load_func(int16)
-sv_load_func(int32)
-sv_load_func(int64)
+sv_load_func(int8, false )
+sv_load_func(int16, false )
+sv_load_func(int32, false )
+sv_load_func(int64, false )
#define sv_store_func(type) \
void sv_mmu_t::store_##type(sv_reg_t const& addr, type##_t val) { \