alpha: Implement HWREI in the ISA.
authorGabe Black <gabeblack@google.com>
Sun, 28 Apr 2019 03:37:44 +0000 (20:37 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 30 Apr 2019 02:52:08 +0000 (02:52 +0000)
This moves it out of generic interfaces and the CPU implementations.

Change-Id: I6767d6b26d0ae128b5bdad5830dce838be74e256
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18431
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/alpha/isa/decoder.isa

index 8789fa905506b11bd4abb0e85a5566d7332257bf..5635d381abf2307656c8e8b3559e579d9858ab9c 100644 (file)
@@ -930,7 +930,24 @@ decode OPCODE default Unknown::unknown() {
   0x1e: decode PALMODE {
       0: OpcdecFault::hw_rei();
         format BasicOperate {
-          1: hw_rei({{ xc->hwrei(); }}, IsSerializing, IsSerializeBefore);
+          1: hw_rei({{
+                Addr pc = PC;
+                if (!(pc & 0x3))
+                    return std::make_shared<UnimplementedOpcodeFault>();
+
+                LockFlag = false;
+                NPC = IprExcAddr;
+
+                ThreadContext *tc = xc->tcBase();
+                auto *base_stats = tc->getKernelStats();
+                auto *stats = dynamic_cast<AlphaISA::Kernel::Statistics *>(
+                        base_stats);
+                assert(stats || !base_stats);
+                if (stats)
+                    stats->hwrei();
+
+                CPA::cpa()->swAutoBegin(tc, IprExcAddr);
+          }}, IsSerializing, IsSerializeBefore);
         }
     }