From ac316d45e8818679efae8559eace010ae0487a99 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Sat, 27 Mar 2010 01:40:05 -0400 Subject: [PATCH] inorder: write-hints bug fix make sure to only read 1 src reg. for write-hint and any other similar 'store' instruction. Reading the source reg when its not necessary can cause the simulator to read from uninitialized values --- src/cpu/inorder/pipeline_traits.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cpu/inorder/pipeline_traits.cc b/src/cpu/inorder/pipeline_traits.cc index 8ff26dce2..397170163 100644 --- a/src/cpu/inorder/pipeline_traits.cc +++ b/src/cpu/inorder/pipeline_traits.cc @@ -116,7 +116,9 @@ bool createBackEndSchedule(DynInstPtr &inst) if ( inst->isLoad() ) { M->needs(DCache, CacheUnit::InitiateReadData); } else if ( inst->isStore() ) { - M->needs(RegManager, UseDefUnit::ReadSrcReg, 1); + if ( inst->numSrcRegs() >= 2 ) { + M->needs(RegManager, UseDefUnit::ReadSrcReg, 1); + } M->needs(AGEN, AGENUnit::GenerateAddr); M->needs(DCache, CacheUnit::InitiateWriteData); }