From 968fb5cdee848a18a6cef064fd740ad33cec018c Mon Sep 17 00:00:00 2001 From: Timothy Hayes Date: Fri, 10 Jan 2020 17:30:27 +0000 Subject: [PATCH] cpu: Add HTM Instruction Flags IsHtmStart: Starts a HTM transaction IsHtmStop: Stops (commits) a HTM transaction IsHtmCancel: Explicitely aborts a HTM transaction JIRA: https://gem5.atlassian.net/browse/GEM5-587 Change-Id: I33144f97a2009e28b0c64777f0313cd6eadb7ff9 Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30321 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/cpu/StaticInstFlags.py | 7 ++++++- src/cpu/static_inst.hh | 14 +++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/cpu/StaticInstFlags.py b/src/cpu/StaticInstFlags.py index f756ba171..1c2b63a2b 100644 --- a/src/cpu/StaticInstFlags.py +++ b/src/cpu/StaticInstFlags.py @@ -1,3 +1,4 @@ +# Copyright (c) 2020 ARM Limited # Copyright (c) 2003-2005 The Regents of The University of Michigan # Copyright (c) 2013 Advanced Micro Devices, Inc. # All rights reserved. @@ -109,5 +110,9 @@ class StaticInstFlags(Enum): 'IsMicroBranch', # This microop branches within the microcode for # a macroop 'IsDspOp', - 'IsSquashAfter' # Squash all uncommitted state after executed + 'IsSquashAfter', # Squash all uncommitted state after executed + # hardware transactional memory + 'IsHtmStart', # Starts a HTM transaction + 'IsHtmStop', # Stops (commits) a HTM transaction + 'IsHtmCancel' # Explicitely aborts a HTM transaction ] diff --git a/src/cpu/static_inst.hh b/src/cpu/static_inst.hh index b523ef935..146be8c72 100644 --- a/src/cpu/static_inst.hh +++ b/src/cpu/static_inst.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited + * Copyright (c) 2017, 2020 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -202,6 +202,18 @@ class StaticInst : public RefCounted, public StaticInstFlags bool isFirstMicroop() const { return flags[IsFirstMicroop]; } //This flag doesn't do anything yet bool isMicroBranch() const { return flags[IsMicroBranch]; } + // hardware transactional memory + // HtmCmds must be identified as such in order + // to provide them with necessary memory ordering semantics. + bool isHtmStart() const { return flags[IsHtmStart]; } + bool isHtmStop() const { return flags[IsHtmStop]; } + bool isHtmCancel() const { return flags[IsHtmCancel]; } + + bool + isHtmCmd() const + { + return isHtmStart() || isHtmStop() || isHtmCancel(); + } //@} void setFirstMicroop() { flags[IsFirstMicroop] = true; } -- 2.30.2