From 6cbacfbc49f88aaaf136bc3167467a4d6a2b7a9e Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 1 Nov 2020 04:23:01 -0800 Subject: [PATCH] mips: Convert MIPS to use local register index storage. Change-Id: Ib691f3dd666c0877fc53b2f50dbaaf7bb4a6905b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36880 Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- src/arch/mips/isa/formats/basic.isa | 16 ++++++++++------ src/arch/mips/isa/formats/mem.isa | 5 ++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/arch/mips/isa/formats/basic.isa b/src/arch/mips/isa/formats/basic.isa index 17d08ef3b..765dae275 100644 --- a/src/arch/mips/isa/formats/basic.isa +++ b/src/arch/mips/isa/formats/basic.isa @@ -35,19 +35,23 @@ def template BasicDeclare {{ */ class %(class_name)s : public %(base_class)s { + private: + %(reg_idx_arr_decl)s; public: - /// Constructor. - %(class_name)s(MachInst machInst); - Fault execute(ExecContext *, - Trace::InstRecord *) const override; + /// Constructor. + %(class_name)s(MachInst machInst); + Fault execute(ExecContext *, + Trace::InstRecord *) const override; }; }}; // Basic instruction class constructor template. def template BasicConstructor {{ - %(class_name)s::%(class_name)s(MachInst machInst) : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) + %(class_name)s::%(class_name)s(MachInst machInst) : + %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) { - %(constructor)s; + %(set_reg_idx_arr)s; + %(constructor)s; } }}; diff --git a/src/arch/mips/isa/formats/mem.isa b/src/arch/mips/isa/formats/mem.isa index a31485dd6..ac56803c0 100644 --- a/src/arch/mips/isa/formats/mem.isa +++ b/src/arch/mips/isa/formats/mem.isa @@ -129,8 +129,10 @@ def template LoadStoreDeclare {{ */ class %(class_name)s : public %(base_class)s { - public: + private: + %(reg_idx_arr_decl)s; + public: /// Constructor. %(class_name)s(ExtMachInst machInst); @@ -146,6 +148,7 @@ def template LoadStoreConstructor {{ %(class_name)s::%(class_name)s(ExtMachInst machInst) : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) { + %(set_reg_idx_arr)s; %(constructor)s; } }}; -- 2.30.2