diff options
| author | speverel <[email protected]> | 2016-06-16 15:51:17 -0700 |
|---|---|---|
| committer | speverel <[email protected]> | 2016-06-16 15:51:17 -0700 |
| commit | 281798191f9bc37a75592d34a5e38cc5d6c41b6d (patch) | |
| tree | fa75554da6e1f8f15c20a233d8ef1e56911ea374 /src/cuda-sim/ptx.l | |
| parent | 547ce656018a6439e658be3c283721a961b0217f (diff) | |
Added the ability to inject arbitrary PTX instructions. This will be used to add custom instructions in the future; the imaginary instructions 'spr' and 'ama' have been added as samples.
Diffstat (limited to 'src/cuda-sim/ptx.l')
| -rw-r--r-- | src/cuda-sim/ptx.l | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cuda-sim/ptx.l b/src/cuda-sim/ptx.l index a44177b..026270a 100644 --- a/src/cuda-sim/ptx.l +++ b/src/cuda-sim/ptx.l @@ -145,6 +145,8 @@ xor TC; ptx_lval.int_value = XOR_OP; return OPCODE; 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; +spr TC; ptx_lval.int_value = SPR_OP; return OPCODE; +ama TC; ptx_lval.int_value = AMA_OP; return OPCODE; <INITIAL,NOT_OPCODE,IN_INST,IN_FUNC_DECL>{ @@ -390,7 +392,9 @@ breakaddr TC; ptx_lval.int_value = BREAKADDR_OP; return OPCODE; } <IN_COMMENT>{ "*/" BEGIN(INITIAL); -[^*\n]+ // eat comment in chunks +"CPTX_BEGIN" printf("BEGINNING CUSTOM PTX.\n"); BEGIN(INITIAL); +[^C*\n]+ // eat comment in chunks +"C" "*" // eat the lone star \n TC; } |
