diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cuda-sim/instructions.cc | 15 | ||||
| -rw-r--r-- | src/cuda-sim/opcodes.def | 2 | ||||
| -rw-r--r-- | src/cuda-sim/ptx.l | 2 | ||||
| -rw-r--r-- | src/cuda-sim/ptx.y | 1 |
4 files changed, 20 insertions, 0 deletions
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc index ab2d9f3..fe2d0ef 100644 --- a/src/cuda-sim/instructions.cc +++ b/src/cuda-sim/instructions.cc @@ -1214,6 +1214,15 @@ void bra_impl( const ptx_instruction *pI, ptx_thread_info *thread ) thread->set_npc(target_pc); } +void brx_impl( const ptx_instruction *pI, ptx_thread_info *thread ) +{ + const operand_info &target = pI->dst(); + ptx_reg_t target_pc = thread->get_operand_value(target, target, U32_TYPE, thread, 1); + + thread->m_branch_taken = true; + thread->set_npc(target_pc); +} + void break_impl( const ptx_instruction *pI, ptx_thread_info *thread ) { const operand_info &target = thread->pop_breakaddr(); @@ -3485,6 +3494,12 @@ void sqrt_impl( const ptx_instruction *pI, ptx_thread_info *thread ) thread->set_operand_value(dst,d, i_type, thread, pI); } +void ssy_impl( const ptx_instruction *pI, ptx_thread_info *thread ) +{ + //printf("Execution Warning: unimplemented ssy instruction is treated as a nop\n"); + // TODO: add implementation +} + void st_impl( const ptx_instruction *pI, ptx_thread_info *thread ) { const operand_info &dst = pI->dst(); diff --git a/src/cuda-sim/opcodes.def b/src/cuda-sim/opcodes.def index 0087d1e..b4912c0 100644 --- a/src/cuda-sim/opcodes.def +++ b/src/cuda-sim/opcodes.def @@ -49,6 +49,7 @@ OP_DEF(BFE_OP,bfe_impl,"bfe",1,1) OP_DEF(BFI_OP,bfi_impl,"bfi",1,1) OP_DEF(BFIND_OP,bfind_impl,"bfind",1,1) OP_DEF(BRA_OP,bra_impl,"bra",0,3) +OP_DEF(BRX_OP,brx_impl,"brx",0,3) OP_DEF(BREV_OP,brev_impl,"brev",1,1) OP_DEF(BRKPT_OP,brkpt_impl,"brkpt",1,9) OP_DEF(CALL_OP,call_impl,"call",1,3) @@ -101,6 +102,7 @@ OP_DEF(SHR_OP,shr_impl,"shr",1,1) OP_DEF(SIN_OP,sin_impl,"sin",1,4) OP_DEF(SLCT_OP,slct_impl,"slct",1,1) OP_DEF(SQRT_OP,sqrt_impl,"sqrt",1,4) +OP_DEF(SSY_OP,ssy_impl,"ssy",0,3) OP_DEF(ST_OP,st_impl,"st",0,5) OP_DEF(SUB_OP,sub_impl,"sub",1,1) OP_DEF(SUBC_OP,subc_impl,"subc",1,1) diff --git a/src/cuda-sim/ptx.l b/src/cuda-sim/ptx.l index 04100c8..de041fc 100644 --- a/src/cuda-sim/ptx.l +++ b/src/cuda-sim/ptx.l @@ -65,6 +65,7 @@ bfe TC; ptx_lval.int_value = BFE_OP; return OPCODE; bfi TC; ptx_lval.int_value = BFI_OP; return OPCODE; bfind TC; ptx_lval.int_value = BFIND_OP; return OPCODE; bra TC; ptx_lval.int_value = BRA_OP; return OPCODE; +brx TC; ptx_lval.int_value = BRX_OP; return OPCODE; brev TC; ptx_lval.int_value = BREV_OP; return OPCODE; brkpt TC; ptx_lval.int_value = BRKPT_OP; return OPCODE; call TC; BEGIN(NOT_OPCODE); ptx_lval.int_value = CALL_OP; return OPCODE; // blocking opcode token in case the callee has the same name as an opcode @@ -118,6 +119,7 @@ shr TC; ptx_lval.int_value = SHR_OP; return OPCODE; sin TC; ptx_lval.int_value = SIN_OP; return OPCODE; slct TC; ptx_lval.int_value = SLCT_OP; return OPCODE; sqrt TC; ptx_lval.int_value = SQRT_OP; return OPCODE; +ssy TC; ptx_lval.int_value = SSY_OP; return OPCODE; st TC; ptx_lval.int_value = ST_OP; return OPCODE; st.volatile TC; ptx_lval.int_value = ST_OP; return OPCODE; sub TC; ptx_lval.int_value = SUB_OP; return OPCODE; diff --git a/src/cuda-sim/ptx.y b/src/cuda-sim/ptx.y index 6e39e50..360be51 100644 --- a/src/cuda-sim/ptx.y +++ b/src/cuda-sim/ptx.y @@ -376,6 +376,7 @@ opcode_spec: OPCODE { add_opcode($1); } option_list pred_spec: PRED IDENTIFIER { add_pred($2,0, -1); } | PRED EXCLAMATION IDENTIFIER { add_pred($3,1, -1); } + | PRED IDENTIFIER LT_OPTION { add_pred($2,0,1); } | PRED IDENTIFIER EQ_OPTION { add_pred($2,0,2); } | PRED IDENTIFIER LE_OPTION { add_pred($2,0,3); } | PRED IDENTIFIER NE_OPTION { add_pred($2,0,5); } |
