From fa63d925c3d73d4c1dd7b27799d501c90917aa84 Mon Sep 17 00:00:00 2001 From: sspenst Date: Tue, 5 Jul 2016 11:58:39 -0700 Subject: Slight addition to the parser for CPTX aesthetics. You now begin and end your custom inserted PTX with CPTX_BEGIN and CPTX_END, respectively. --- src/cuda-sim/ptx.l | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/cuda-sim/ptx.l') diff --git a/src/cuda-sim/ptx.l b/src/cuda-sim/ptx.l index 1ac047c..49fd790 100644 --- a/src/cuda-sim/ptx.l +++ b/src/cuda-sim/ptx.l @@ -148,6 +148,8 @@ nop TC; ptx_lval.int_value = NOP_OP; return OPCODE; break TC; ptx_lval.int_value = BREAK_OP; return OPCODE; breakaddr TC; ptx_lval.int_value = BREAKADDR_OP; return OPCODE; +"CPTX_END" printf("ENDING CUSTOM PTX.\n"); BEGIN(IN_COMMENT); + { \.align TC; return ALIGN_DIRECTIVE; @@ -393,9 +395,9 @@ breakaddr TC; ptx_lval.int_value = BREAKADDR_OP; return OPCODE; { "*/" BEGIN(INITIAL); "CPTX_BEGIN" printf("BEGINNING CUSTOM PTX.\n"); BEGIN(INITIAL); -[^C*\n]+ // eat comment in chunks -"C" -"*" // eat the lone star +[^C*\n]+ // eat comment in chunks +"C" // eat the lone C +"*" // eat the lone star \n TC; } -- cgit v1.3