mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2025-12-28 02:05:00 +01:00
A64: Implement pcrel
This commit is contained in:
parent
c09e69bb97
commit
5a1d88c5dc
6 changed files with 43 additions and 6 deletions
27
src/frontend/A64/translate/impl/data_processing_pcrel.cpp
Normal file
27
src/frontend/A64/translate/impl/data_processing_pcrel.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* 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 "frontend/A64/translate/impl/impl.h"
|
||||
|
||||
namespace Dynarmic {
|
||||
namespace A64 {
|
||||
|
||||
bool TranslatorVisitor::ADR(Imm<2> immlo, Imm<19> immhi, Reg Rd) {
|
||||
u64 imm = concatenate(immhi, immlo).ZeroExtend<u64>();
|
||||
u64 base = ir.PC();
|
||||
X(64, Rd, ir.Imm64(base + imm));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TranslatorVisitor::ADRP(Imm<2> immlo, Imm<19> immhi, Reg Rd) {
|
||||
u64 imm = concatenate(immhi, immlo).ZeroExtend<u64>() << 12;
|
||||
u64 base = ir.PC() & ~u64(0xFFF);
|
||||
X(64, Rd, ir.Imm64(base + imm));
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace A64
|
||||
} // namespace Dynarmic
|
||||
Loading…
Add table
Add a link
Reference in a new issue