summaryrefslogtreecommitdiff
path: root/src/cuda-sim/ptx_ir.cc
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-07-17 19:37:23 -0800
committerTor Aamodt <[email protected]>2010-07-17 19:37:23 -0800
commit7e755bb656b68cfb628fcc0424b1325c32cb5d61 (patch)
treea054761e438c5d1f27ee9f2c92e76f476bdcbe31 /src/cuda-sim/ptx_ir.cc
parent619c0c87fd18a9b34d2bbcf9eb2711bbe07b8d9a (diff)
- added *implied* local memory stack pointer for functional execution
(still need to determine framesize during parsing, and need to support alternate mode were stack pointer is explicit register a la zev...) - define local param mapping to local memory for functional execution [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6875]
Diffstat (limited to 'src/cuda-sim/ptx_ir.cc')
-rw-r--r--src/cuda-sim/ptx_ir.cc25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/cuda-sim/ptx_ir.cc b/src/cuda-sim/ptx_ir.cc
index da1c49b..2597ac5 100644
--- a/src/cuda-sim/ptx_ir.cc
+++ b/src/cuda-sim/ptx_ir.cc
@@ -455,7 +455,7 @@ void add_identifier( const char *identifier, int array_dim, unsigned array_ident
g_sym_name_to_symbol_table[ identifier ] = g_current_symbol_table;
break;
case local_space:
- printf("GPGPU-Sim PTX: allocating local region for \"%s\" from 0x%x to 0x%lx (local memory space)\n",
+ printf("GPGPU-Sim PTX: allocating stack frame region for .local \"%s\" from 0x%x to 0x%lx\n",
identifier,
g_current_symbol_table->get_local_next(),
g_current_symbol_table->get_local_next() + num_bits/8 );
@@ -468,6 +468,15 @@ void add_identifier( const char *identifier, int array_dim, unsigned array_ident
printf("GPGPU-Sim PTX: encountered texture directive %s.\n", identifier);
break;
case param_space_local:
+ printf("GPGPU-Sim PTX: allocating stack frame region for .param \"%s\" from 0x%x to 0x%lx\n",
+ identifier,
+ g_current_symbol_table->get_local_next(),
+ g_current_symbol_table->get_local_next() + num_bits/8 );
+ fflush(stdout);
+ assert( (num_bits%8) == 0 );
+ g_last_symbol->set_address( g_current_symbol_table->get_local_next() );
+ g_current_symbol_table->alloc_local( num_bits/8 );
+ break;
case param_space_kernel:
break;
default:
@@ -475,12 +484,20 @@ void add_identifier( const char *identifier, int array_dim, unsigned array_ident
break;
}
-
+ assert( !ti.is_param_unclassified() );
if ( ti.is_param_kernel() ) {
g_func_info->add_param_name_type_size(g_entry_func_param_index,identifier, ti.scalar_type(), num_bits );
g_entry_func_param_index++;
- } else if ( ti.is_param_local() || ti.is_param_unclassified() ) {
- g_func_info->add_local_param_name_type_size( identifier, ti.scalar_type(), num_bits );
+ } else if ( ti.is_param_local() ) {
+ printf("GPGPU-Sim PTX: allocating stack frame region for input/output .param \"%s\" from 0x%x to 0x%lx\n",
+ identifier,
+ g_current_symbol_table->get_local_next(),
+ g_current_symbol_table->get_local_next() + num_bits/8 );
+ fflush(stdout);
+ assert( (num_bits%8) == 0 );
+ addr_t addr = g_current_symbol_table->get_local_next();
+ g_last_symbol->set_address( addr );
+ g_current_symbol_table->alloc_local( num_bits/8 );
}
}