From 8525c81b63d7e2e925233acc642127b9e67fd966 Mon Sep 17 00:00:00 2001 From: Wilson Fung Date: Tue, 19 Mar 2013 11:22:52 -0800 Subject: Integrate mov.pred fix from TM branch. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 15538] --- CHANGES | 2 ++ src/cuda-sim/instructions.cc | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 700fb1d..5630583 100644 --- a/CHANGES +++ b/CHANGES @@ -67,6 +67,8 @@ Version 3.2.0+edits (development branch) versus 3.2.0 GPGPUSIM_ROOT was not the first entry in the list;. - Fixed a GPUWattch bug where the performance counters were not being correctly reset when a kernel completes. + - Fixed implementation for mov.pred with literal input (need to explicitly + treat zero as false and non-zero as true). Version 3.2.0 versus 3.1.2 - Added GPUWattch GPGPU power model based on McPAT 0.8beta. diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc index 49b27d2..89212f2 100644 --- a/src/cuda-sim/instructions.cc +++ b/src/cuda-sim/instructions.cc @@ -2574,6 +2574,14 @@ void mov_impl( const ptx_instruction *pI, ptx_thread_info *thread ) } else { thread->set_operand_value(dst,tmp_bits, i_type, thread, pI); } + } else if (i_type == PRED_TYPE and src1.is_literal() == true) { + // in ptx, literal input translate to predicate as 0 = false and 1 = true + // we have adopted the opposite to simplify implementation of zero flags in ptxplus + data = thread->get_operand_value(src1, dst, i_type, thread, 1); + + ptx_reg_t finaldata; + finaldata.pred = (data.u32 == 0)? 1 : 0; // setting zero-flag in predicate + thread->set_operand_value(dst, finaldata, i_type, thread, pI); } else { data = thread->get_operand_value(src1, dst, i_type, thread, 1); -- cgit v1.3