mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-01 04:04:30 +01:00
A64: Backend framework
This commit is contained in:
parent
e161cf16f5
commit
d1eb757f93
48 changed files with 1183 additions and 90 deletions
58
src/backend_x64/callback.cpp
Normal file
58
src/backend_x64/callback.cpp
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2018 MerryMage
|
||||
* This software may be used and distributed according to the terms of the GNU
|
||||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#include "backend_x64/block_of_code.h"
|
||||
#include "backend_x64/callback.h"
|
||||
|
||||
namespace Dynarmic {
|
||||
namespace BackendX64 {
|
||||
|
||||
void SimpleCallback::EmitCall(BlockOfCode* code, std::function<void()> l) {
|
||||
l();
|
||||
code->CallFunction(fn);
|
||||
}
|
||||
|
||||
void SimpleCallback::EmitCall(BlockOfCode* code, std::function<void(Xbyak::Reg64)> l) {
|
||||
l(code->ABI_PARAM1);
|
||||
code->CallFunction(fn);
|
||||
}
|
||||
|
||||
void SimpleCallback::EmitCall(BlockOfCode* code, std::function<void(Xbyak::Reg64, Xbyak::Reg64)> l) {
|
||||
l(code->ABI_PARAM1, code->ABI_PARAM2);
|
||||
code->CallFunction(fn);
|
||||
}
|
||||
|
||||
void SimpleCallback::EmitCall(BlockOfCode* code, std::function<void(Xbyak::Reg64, Xbyak::Reg64, Xbyak::Reg64)> l) {
|
||||
l(code->ABI_PARAM1, code->ABI_PARAM2, code->ABI_PARAM3);
|
||||
code->CallFunction(fn);
|
||||
}
|
||||
|
||||
void ArgCallback::EmitCall(BlockOfCode* code, std::function<void()> l) {
|
||||
code->mov(code->ABI_PARAM1, arg);
|
||||
l();
|
||||
code->CallFunction(fn);
|
||||
}
|
||||
|
||||
void ArgCallback::EmitCall(BlockOfCode* code, std::function<void(Xbyak::Reg64)> l) {
|
||||
code->mov(code->ABI_PARAM1, arg);
|
||||
l(code->ABI_PARAM2);
|
||||
code->CallFunction(fn);
|
||||
}
|
||||
|
||||
void ArgCallback::EmitCall(BlockOfCode* code, std::function<void(Xbyak::Reg64, Xbyak::Reg64)> l) {
|
||||
code->mov(code->ABI_PARAM1, arg);
|
||||
l(code->ABI_PARAM2, code->ABI_PARAM3);
|
||||
code->CallFunction(fn);
|
||||
}
|
||||
|
||||
void ArgCallback::EmitCall(BlockOfCode* code, std::function<void(Xbyak::Reg64, Xbyak::Reg64, Xbyak::Reg64)> l) {
|
||||
code->mov(code->ABI_PARAM1, arg);
|
||||
l(code->ABI_PARAM2, code->ABI_PARAM3, code->ABI_PARAM4);
|
||||
code->CallFunction(fn);
|
||||
}
|
||||
|
||||
} // namespace BackendX64
|
||||
} // namespace Dynarmic
|
||||
Loading…
Add table
Add a link
Reference in a new issue