From f7b0a1afa74159acc68d96fe586d3db60063fe59 Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Tue, 3 Oct 2023 21:56:14 -0700 Subject: [PATCH] oaknut: Add LRCPC instructions These are only the LRCPC instructions(`LDAPR*`) and not LRCPC2 or LRCPC3. --- .../impl/mnemonics_generic_v8.3.inc.hpp | 19 ++++++++++++++++++- tests/general.cpp | 6 ++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/include/oaknut/impl/mnemonics_generic_v8.3.inc.hpp b/include/oaknut/impl/mnemonics_generic_v8.3.inc.hpp index 0938fd2..e574c70 100644 --- a/include/oaknut/impl/mnemonics_generic_v8.3.inc.hpp +++ b/include/oaknut/impl/mnemonics_generic_v8.3.inc.hpp @@ -1,2 +1,19 @@ // SPDX-FileCopyrightText: Copyright (c) 2023 merryhime -// SPDX-License-Identifier: MIT \ No newline at end of file +// SPDX-License-Identifier: MIT + +void LDAPR(WReg wt, XRegSp xn) +{ + emit<"1011100010111111110000nnnnnttttt", "t", "n">(wt, xn); +} +void LDAPR(XReg xt, XRegSp xn) +{ + emit<"1111100010111111110000nnnnnttttt", "t", "n">(xt, xn); +} +void LDAPRB(WReg wt, XRegSp xn) +{ + emit<"0011100010111111110000nnnnnttttt", "t", "n">(wt, xn); +} +void LDAPRH(WReg wt, XRegSp xn) +{ + emit<"0111100010111111110000nnnnnttttt", "t", "n">(wt, xn); +} \ No newline at end of file diff --git a/tests/general.cpp b/tests/general.cpp index 2caf465..7e774c7 100644 --- a/tests/general.cpp +++ b/tests/general.cpp @@ -324,6 +324,12 @@ T(0xd40cec82, HVC(0x6764)) T(0xd5033cdf, ISB((BarrierOp)12)) T(0xd50339df, ISB((BarrierOp)9)) T(0xd5033fdf, ISB()) +T(0xb8bfc020, LDAPR(W0, X1)) +T(0xf8bfc000, LDAPR(X0, X0)) +T(0xb8bfc012, LDAPR(W18, X0)) +T(0xf8bfc00f, LDAPR(X15, X0)) +T(0x38bfc000, LDAPRB(W0, X0)) +T(0x78bfc220, LDAPRH(W0, X17)) T(0x88dffded, LDAR(W13, X15)) T(0x88dffe4a, LDAR(W10, X18)) T(0x88dffcfe, LDAR(W30, X7))