From 11b308e7363e937966b035b4891db32b4eece3bf Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Fri, 1 Oct 2010 08:55:28 -0800 Subject: integrating recent changes from fermi-test into fermi (i'll use "fermi" for more disruptive changes to the pipeline model such as updating the MSHRs and getting rid of the warp tracker, ripping out DWF, etc...) [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7805] --- src/cuda-sim/ptx_parser.cc | 61 +++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 17 deletions(-) (limited to 'src/cuda-sim/ptx_parser.cc') diff --git a/src/cuda-sim/ptx_parser.cc b/src/cuda-sim/ptx_parser.cc index d4a892f..5a65481 100644 --- a/src/cuda-sim/ptx_parser.cc +++ b/src/cuda-sim/ptx_parser.cc @@ -68,6 +68,12 @@ extern "C" int ptx_error( const char *s ); extern int ptx_lineno; +static unsigned g_warp_size; +void set_ptx_warp_size(unsigned warp_size) +{ + g_warp_size=warp_size; +} + static bool g_debug_ir_generation=false; const char *g_filename; unsigned g_max_regs_per_thread = 0; @@ -110,12 +116,10 @@ std::list g_scalar_type; fflush(stdout); \ } -unsigned g_entry_func_param_index=0; -function_info *g_func_info = NULL; -function_info *g_entrypoint_func_info = NULL; -symbol_table *g_entrypoint_symbol_table = NULL; -std::map g_ptx_token_decode; -operand_info g_return_var; +static unsigned g_entry_func_param_index=0; +static function_info *g_func_info = NULL; +static std::map g_ptx_token_decode; +static operand_info g_return_var; const char *decode_token( int type ) { @@ -194,9 +198,6 @@ void add_function_name( const char *name ) { DPRINTF("add_function_name %s %s", name, ((g_entry_point==1)?"(entrypoint)":((g_entry_point==2)?"(extern)":""))); bool prior_decl = g_global_symbol_table->add_function_decl( name, g_entry_point, &g_func_info, &g_current_symbol_table ); - if( g_entry_point ) { - g_entrypoint_func_info = g_func_info; - } if( g_add_identifier_cached__identifier ) { add_identifier( g_add_identifier_cached__identifier, g_add_identifier_cached__array_dim, @@ -270,7 +271,7 @@ extern "C" char linebuf[1024]; void set_return() { - parse_assert( (g_opcode == CALL_OP), "only call can have return value"); + parse_assert( (g_opcode == CALL_OP || g_opcode == CALLP_OP), "only call can have return value"); g_operands.front().set_return(); g_return_var = g_operands.front(); } @@ -291,6 +292,7 @@ const ptx_instruction *ptx_instruction_lookup( const char *filename, unsigned li void add_instruction() { DPRINTF("add_instruction: %s", ((g_opcode>0)?g_opcode_string[g_opcode]:"