From 163065d79ee6fd1b078b4301bb5d909c957071e2 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Mon, 21 Jan 2019 14:43:11 +0000 Subject: [PATCH] arch-arm: IsStoreConditional flag set depending on flavor This patch is aligning A32 with A64 where the IsStoreConditional flag doesn't have to be specified manually in the instruction implementation, but will be automatically added to any exclusive store. Change-Id: Id02ed6fc2beeca6d125017393714a7c6eb3d8a33 Signed-off-by: Giacomo Travaglini Reviewed-by: Nikos Nikoleris Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/15816 Maintainer: Andreas Sandberg --- src/arch/arm/isa/insts/str.isa | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/arch/arm/isa/insts/str.isa b/src/arch/arm/isa/insts/str.isa index c165eaf1a..ea412aa8d 100644 --- a/src/arch/arm/isa/insts/str.isa +++ b/src/arch/arm/isa/insts/str.isa @@ -48,8 +48,7 @@ let {{ execBase = 'Store' def __init__(self, mnem, post, add, writeback, size=4, - sign=False, user=False, flavor="normal", - instFlags = []): + sign=False, user=False, flavor="normal"): super(StoreInst, self).__init__() self.name = mnem @@ -60,7 +59,7 @@ let {{ self.sign = sign self.user = user self.flavor = flavor - self.instFlags = instFlags + self.instFlags = [] if self.add: self.op = " +" else: @@ -185,6 +184,7 @@ let {{ self.memFlags.append("ArmISA::TLB::UserMode") if self.flavor == "exclusive": + self.instFlags.append("IsStoreConditional") self.memFlags.append("Request::LLSC") elif self.flavor != "fp": self.memFlags.append("ArmISA::TLB::AllowUnaligned") @@ -259,6 +259,7 @@ let {{ # Add memory request flags where necessary if self.flavor == "exclusive": + self.instFlags.append("IsStoreConditional") self.memFlags.append("Request::LLSC") self.memFlags.append("ArmISA::TLB::AlignDoubleWord") else: @@ -379,14 +380,14 @@ let {{ buildDoubleStores("strd") - StoreImmEx("strex", False, True, False, size=4, flavor="exclusive", - instFlags = ['IsStoreConditional']).emit() - StoreImmEx("strexh", False, True, False, size=2, flavor="exclusive", - instFlags = ['IsStoreConditional']).emit() - StoreImmEx("strexb", False, True, False, size=1, flavor="exclusive", - instFlags = ['IsStoreConditional']).emit() - StoreDoubleImmEx("strexd", False, True, False, flavor="exclusive", - instFlags = ['IsStoreConditional']).emit() + StoreImmEx("strex", False, True, False, size=4, + flavor="exclusive").emit() + StoreImmEx("strexh", False, True, False, size=2, + flavor="exclusive").emit() + StoreImmEx("strexb", False, True, False, size=1, + flavor="exclusive").emit() + StoreDoubleImmEx("strexd", False, True, False, + flavor="exclusive").emit() StoreImm("vstr", False, True, False, size=4, flavor="fp").emit() StoreImm("vstr", False, False, False, size=4, flavor="fp").emit() -- 2.30.2