summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cuda-sim/instructions.cc8
1 files changed, 8 insertions, 0 deletions
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);