summaryrefslogtreecommitdiff
path: root/src/cuda-sim/ptx_sim.cc
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-07-18 02:20:50 -0800
committerTor Aamodt <[email protected]>2010-07-18 02:20:50 -0800
commitcc404275f9226185e436e1da483ee58ee85c38ca (patch)
treee133be6f3a1bb897593328e438196a04dc88b47d /src/cuda-sim/ptx_sim.cc
parent7e755bb656b68cfb628fcc0424b1325c32cb5d61 (diff)
- simple device printf support added (supports %u, %d, %f)
- add support to call_impl for passing values in through local param space (need to add support for return) - track local framesize during ptx parsing / update local stack-pointer during call/return - detect appropriate param space for ld.param (and st.param) depending upon address symbol's scope - putting back the crazy math for local mem allocation (seems to be required) - bug fix for global byte array initialization - force ld and st w/o space specifier to be generic_space - make type_decode method of type_info_key - adjust debug printing so listing of code and CFG information requires higher numbers (100 and 50) - local param ld/st accesses treated like local ld/st for timing model [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6878]
Diffstat (limited to 'src/cuda-sim/ptx_sim.cc')
-rw-r--r--src/cuda-sim/ptx_sim.cc13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/cuda-sim/ptx_sim.cc b/src/cuda-sim/ptx_sim.cc
index 85e6185..dffc128 100644
--- a/src/cuda-sim/ptx_sim.cc
+++ b/src/cuda-sim/ptx_sim.cc
@@ -358,6 +358,7 @@ void ptx_thread_info::callstack_push( unsigned pc, unsigned rpc, const symbol *r
m_last_was_call = true;
m_callstack.push_back( stack_entry(m_symbol_table,m_func_info,pc,rpc,return_var_src,return_var_dst,call_uid) );
m_regs.push_back( reg_map_t() );
+ m_local_mem_stack_pointer += m_func_info->local_mem_framesize();
}
#define POST_DOMINATOR 1 /* must match definition in shader.h */
@@ -368,7 +369,9 @@ extern void set_operand_value( const symbol *dst, const ptx_reg_t &data );
bool ptx_thread_info::callstack_pop()
{
assert( !m_callstack.empty() );
+ assert( m_local_mem_stack_pointer >= m_func_info->local_mem_framesize() );
m_func_info = m_callstack.back().m_func_info;
+ m_local_mem_stack_pointer -= m_func_info->local_mem_framesize();
m_symbol_table = m_callstack.back().m_symbol_table;
m_NPC = m_callstack.back().m_PC;
m_RPC_updated = true;
@@ -448,16 +451,6 @@ void ptx_thread_info::dump_modifiedregs()
}
}
-void ptx_thread_info::push_local_mem_stack()
-{
- m_local_mem_stack_pointer += m_func_info->local_mem_framesize();
-}
-
-void ptx_thread_info::pop_local_mem_stack()
-{
- m_local_mem_stack_pointer -= m_func_info->local_mem_framesize();
-}
-
void ptx_thread_info::set_npc( const function_info *f )
{
m_NPC = f->get_start_PC();