better algorithm to load bytes

This commit is contained in:
2026-03-27 18:59:36 -06:00
parent c6c63d6391
commit 3d80b690c4
9 changed files with 135 additions and 89 deletions

View File

@@ -1,5 +1,9 @@
#include "RAM.hpp"
#include <spider/runtime/cpu/Register.hpp>
#include <spider/runtime/memory/Types.hpp>
#include <cstring>
namespace spider {
@@ -72,6 +76,11 @@ namespace spider {
return (i < _size) ? _mem[i] : _oob;
}
void RAM::loadRegister(u64 i, u8 size_code, register_t* r) {
i = std::min(i, _size);
spider::loadRegister[size_code](r, _mem + i, _size - i);
}
// Misc //
void RAM::resize(u64 new_size) {