summaryrefslogtreecommitdiff
path: root/src/cuda-sim
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2013-03-19 11:22:52 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:50:05 -0700
commit8525c81b63d7e2e925233acc642127b9e67fd966 (patch)
treec3d65d0a99494bcd02a2433d0e872d0f35bdf6a8 /src/cuda-sim
parent330d2918e88419b3096fb57b58d222d5bccf2b14 (diff)
Integrate mov.pred fix from TM branch.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 15538]
Diffstat (limited to 'src/cuda-sim')
-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);