From e42ab95fb7d9b823721ff0b5147bf96bb7bf1b80 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 1 Nov 2020 17:25:17 -0800 Subject: [PATCH] power: Convert POWER to use local reg index storage. Change-Id: Ieea4ade247f89b23266a383b604c17e740d44e3d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36882 Reviewed-by: Sandipan Das Maintainer: Gabe Black Tested-by: kokoro --- src/arch/power/isa/formats/basic.isa | 16 +++++++---- src/arch/power/isa/formats/integer.isa | 38 +++++++++++++++----------- src/arch/power/isa/formats/mem.isa | 5 +++- 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/arch/power/isa/formats/basic.isa b/src/arch/power/isa/formats/basic.isa index 0ccef6aba..20d380f09 100644 --- a/src/arch/power/isa/formats/basic.isa +++ b/src/arch/power/isa/formats/basic.isa @@ -33,19 +33,23 @@ def template BasicDeclare {{ */ class %(class_name)s : public %(base_class)s { + private: + %(reg_idx_arr_decl)s; + public: - /// Constructor. - %(class_name)s(ExtMachInst machInst); - Fault execute(ExecContext *, - Trace::InstRecord *) const override; + /// Constructor. + %(class_name)s(ExtMachInst machInst); + Fault execute(ExecContext *, Trace::InstRecord *) const override; }; }}; // Basic instruction class constructor template. def template BasicConstructor {{ - %(class_name)s::%(class_name)s(ExtMachInst machInst) : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) + %(class_name)s::%(class_name)s(ExtMachInst machInst) : + %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) { - %(constructor)s; + %(set_reg_idx_arr)s; + %(constructor)s; } }}; diff --git a/src/arch/power/isa/formats/integer.isa b/src/arch/power/isa/formats/integer.isa index 3b24927ad..50badce53 100644 --- a/src/arch/power/isa/formats/integer.isa +++ b/src/arch/power/isa/formats/integer.isa @@ -34,32 +34,38 @@ // Instruction class constructor template when Rc is set. def template IntRcConstructor {{ - %(class_name)s::%(class_name)s(ExtMachInst machInst) : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) - { - %(constructor)s; - rcSet = true; - } + %(class_name)s::%(class_name)s(ExtMachInst machInst) : + %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) + { + %(set_reg_idx_arr)s; + %(constructor)s; + rcSet = true; + } }}; // Instruction class constructor template when OE is set. def template IntOeConstructor {{ - %(class_name)s::%(class_name)s(ExtMachInst machInst) : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) - { - %(constructor)s; - oeSet = true; - } + %(class_name)s::%(class_name)s(ExtMachInst machInst) : + %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) + { + %(set_reg_idx_arr)s; + %(constructor)s; + oeSet = true; + } }}; // Instruction class constructor template when both Rc and OE are set. def template IntRcOeConstructor {{ - %(class_name)s::%(class_name)s(ExtMachInst machInst) : %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) - { - %(constructor)s; - rcSet = true; - oeSet = true; - } + %(class_name)s::%(class_name)s(ExtMachInst machInst) : + %(base_class)s("%(mnemonic)s", machInst, %(op_class)s) + { + %(set_reg_idx_arr)s; + %(constructor)s; + rcSet = true; + oeSet = true; + } }}; diff --git a/src/arch/power/isa/formats/mem.isa b/src/arch/power/isa/formats/mem.isa index 1f10a5a18..c7be2b10d 100644 --- a/src/arch/power/isa/formats/mem.isa +++ b/src/arch/power/isa/formats/mem.isa @@ -37,8 +37,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); @@ -54,6 +56,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