diff options
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | src/cuda-sim/instructions.cc | 8 |
2 files changed, 10 insertions, 0 deletions
@@ -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); |
