aboutsummaryrefslogtreecommitdiff
path: root/src/cuda-sim/ptx.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/cuda-sim/ptx.y')
-rw-r--r--src/cuda-sim/ptx.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cuda-sim/ptx.y b/src/cuda-sim/ptx.y
index 4de39d1..d81e935 100644
--- a/src/cuda-sim/ptx.y
+++ b/src/cuda-sim/ptx.y
@@ -72,6 +72,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%token VERSION_DIRECTIVE
%token ADDRESS_SIZE_DIRECTIVE
%token VISIBLE_DIRECTIVE
+%token WEAK_DIRECTIVE
%token <string_value> IDENTIFIER
%token <int_value> INT_OPERAND
%token <float_value> FLOAT_OPERAND
@@ -243,10 +244,12 @@ function_ident_param: IDENTIFIER { add_function_name($1); } LEFT_PAREN {func_hea
function_decl_header: ENTRY_DIRECTIVE { $$ = 1; g_func_decl=1; func_header(".entry"); }
| VISIBLE_DIRECTIVE ENTRY_DIRECTIVE { $$ = 1; g_func_decl=1; func_header(".entry"); }
+ | WEAK_DIRECTIVE ENTRY_DIRECTIVE { $$ = 1; g_func_decl=1; func_header(".entry"); }
| FUNC_DIRECTIVE { $$ = 0; g_func_decl=1; func_header(".func"); }
| VISIBLE_DIRECTIVE FUNC_DIRECTIVE { $$ = 0; g_func_decl=1; func_header(".func"); }
| WEAK_DIRECTIVE FUNC_DIRECTIVE { $$ = 0; g_func_decl=1; func_header(".func"); }
| EXTERN_DIRECTIVE FUNC_DIRECTIVE { $$ = 2; g_func_decl=1; func_header(".func"); }
+ | WEAK_DIRECTIVE FUNC_DIRECTIVE { $$ = 0; g_func_decl=1; func_header(".func"); }
;
param_list: /*empty*/
@@ -272,8 +275,8 @@ statement_list: directive_statement { add_directive(); }
| instruction_statement { add_instruction(); }
| statement_list directive_statement { add_directive(); }
| statement_list instruction_statement { add_instruction(); }
- | statement_list statement_block
- | statement_block
+ | statement_list {start_inst_group();} statement_block {end_inst_group();}
+ | {start_inst_group();} statement_block {end_inst_group();}
;
directive_statement: variable_declaration SEMI_COLON
@@ -325,6 +328,7 @@ var_spec: space_spec
| type_spec
| align_spec
| EXTERN_DIRECTIVE { add_extern_spec(); }
+ | WEAK_DIRECTIVE
;
align_spec: ALIGN_DIRECTIVE INT_OPERAND { add_alignment_spec($2); }