a32_emit_x64: Implement fastmem

This commit is contained in:
MerryMage 2020-04-08 16:56:57 +01:00
parent f9b9081d4c
commit 4636055646
11 changed files with 180 additions and 15 deletions

View file

@ -4,6 +4,7 @@
* General Public License version 2 or any later version.
*/
#include <iterator>
#include <unordered_map>
#include "backend/x64/block_of_code.h"
@ -28,6 +29,10 @@ using namespace Xbyak::util;
EmitContext::EmitContext(RegAlloc& reg_alloc, IR::Block& block)
: reg_alloc(reg_alloc), block(block) {}
size_t EmitContext::GetInstOffset(IR::Inst* inst) const {
return static_cast<size_t>(std::distance(block.begin(), IR::Block::iterator(inst)));
}
void EmitContext::EraseInstruction(IR::Inst* inst) {
block.Instructions().erase(inst);
inst->ClearArgs();