Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/39316 )

Change subject: arm: Use the "reg" ABI for gem5 ops.
......................................................................

arm: Use the "reg" ABI for gem5 ops.

The generic PseudoInstABI just calls back into the ISA specific
getArgument function, and that adds a lot of handling for cases that
aren't used and, besides those, basically just boils down to the "reg"
ABI anyway.

Change-Id: I57e738631dbccbf89cba3a6ca62b1f954b39e959
---
M src/arch/arm/isa/includes.isa
M src/arch/arm/isa/insts/m5ops.isa
M src/arch/arm/tlb.cc
3 files changed, 15 insertions(+), 3 deletions(-)



diff --git a/src/arch/arm/isa/includes.isa b/src/arch/arm/isa/includes.isa
index 13b47c8..6af382a 100644
--- a/src/arch/arm/isa/includes.isa
+++ b/src/arch/arm/isa/includes.isa
@@ -105,6 +105,7 @@
 #include "arch/arm/htm.hh"
 #include "arch/arm/isa_traits.hh"
 #include "arch/arm/pauth_helpers.hh"
+#include "arch/arm/reg_abi.hh"
 #include "arch/arm/semihosting.hh"
 #include "arch/arm/utility.hh"
 #include "arch/generic/memhelpers.hh"
diff --git a/src/arch/arm/isa/insts/m5ops.isa b/src/arch/arm/isa/insts/m5ops.isa
index 48d533d..f3a8eeb 100644
--- a/src/arch/arm/isa/insts/m5ops.isa
+++ b/src/arch/arm/isa/insts/m5ops.isa
@@ -38,8 +38,13 @@
 let {{
     gem5OpCode = '''
     uint64_t ret;
-    bool recognized = PseudoInst::pseudoInst<PseudoInstABI>(
-            xc->tcBase(), bits(machInst, 23, 16), ret);
+    bool recognized;
+    int func = bits(machInst, 23, 16);
+    auto *tc = xc->tcBase();
+    if (inAArch64(tc))
+        recognized = PseudoInst::pseudoInst<RegABI64>(tc, func, ret);
+    else
+        recognized = PseudoInst::pseudoInst<RegABI32>(tc, func, ret);
     if (!recognized)
         fault = std::make_shared<UndefinedInstruction>(machInst, true);
     '''
diff --git a/src/arch/arm/tlb.cc b/src/arch/arm/tlb.cc
index 5d2ed90..91c7088 100644
--- a/src/arch/arm/tlb.cc
+++ b/src/arch/arm/tlb.cc
@@ -47,6 +47,7 @@
 #include "arch/arm/faults.hh"
 #include "arch/arm/isa.hh"
 #include "arch/arm/pagetable.hh"
+#include "arch/arm/reg_abi.hh"
 #include "arch/arm/self_debug.hh"
 #include "arch/arm/stage2_lookup.hh"
 #include "arch/arm/stage2_mmu.hh"
@@ -146,9 +147,14 @@
             [func, mode](ThreadContext *tc, PacketPtr pkt) -> Cycles
             {
                 uint64_t ret;
-                PseudoInst::pseudoInst<PseudoInstABI>(tc, func, ret);
+                if (inAArch64(tc))
+                    PseudoInst::pseudoInst<RegABI64>(tc, func, ret);
+                else
+                    PseudoInst::pseudoInst<RegABI32>(tc, func, ret);
+
                 if (mode == Read)
                     pkt->setLE(ret);
+
                 return Cycles(1);
             }
         );

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/39316
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I57e738631dbccbf89cba3a6ca62b1f954b39e959
Gerrit-Change-Number: 39316
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to