mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-07 06:58:15 +01:00
A64: Implement pcrel
This commit is contained in:
parent
c09e69bb97
commit
5a1d88c5dc
6 changed files with 43 additions and 6 deletions
|
|
@ -30,8 +30,8 @@ std::vector<Matcher<V>> GetDecodeTable() {
|
|||
#define INST(fn, name, bitstring) Decoder::detail::detail<Matcher<V>>::GetMatcher(fn, name, bitstring)
|
||||
|
||||
// Data processing - Immediate - PC relative addressing
|
||||
//INST(&V::ADR, "ADR", "0ii10000iiiiiiiiiiiiiiiiiiiddddd"),
|
||||
//INST(&V::ADRP, "ADRP", "1ii10000iiiiiiiiiiiiiiiiiiiddddd"),
|
||||
INST(&V::ADR, "ADR", "0ii10000iiiiiiiiiiiiiiiiiiiddddd"),
|
||||
INST(&V::ADRP, "ADRP", "1ii10000iiiiiiiiiiiiiiiiiiiddddd"),
|
||||
|
||||
// Data processing - Immediate - Add/Sub
|
||||
INST(&V::ADD_imm, "ADD (immediate)", "z0010001ssiiiiiiiiiiiinnnnnddddd"),
|
||||
|
|
|
|||
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