summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cuda-sim/instructions.cc12
-rw-r--r--src/cuda-sim/opcodes.def9
-rw-r--r--src/cuda-sim/ptx.l1
3 files changed, 18 insertions, 4 deletions
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index 4479cbe..226e965 100644
--- a/src/cuda-sim/instructions.cc
+++ b/src/cuda-sim/instructions.cc
@@ -1386,6 +1386,13 @@ void exit_impl( const ptx_instruction *pI, ptx_thread_info *thread )
thread->set_done();
}
+void mad_def( const ptx_instruction *pI, ptx_thread_info *thread );
+
+void fma_impl( const ptx_instruction *pI, ptx_thread_info *thread )
+{
+ mad_def(pI,thread);
+}
+
void ld_impl( const ptx_instruction *pI, ptx_thread_info *thread )
{
const operand_info &dst = pI->dst();
@@ -1502,6 +1509,11 @@ void mad24_impl( const ptx_instruction *pI, ptx_thread_info *thread )
}
void mad_impl( const ptx_instruction *pI, ptx_thread_info *thread )
+{
+ mad_def(pI,thread);
+}
+
+void mad_def( const ptx_instruction *pI, ptx_thread_info *thread )
{
const operand_info &dst = pI->dst();
const operand_info &src1 = pI->src1();
diff --git a/src/cuda-sim/opcodes.def b/src/cuda-sim/opcodes.def
index ba6657f..5a34cff 100644
--- a/src/cuda-sim/opcodes.def
+++ b/src/cuda-sim/opcodes.def
@@ -72,10 +72,12 @@ Tex 6
*/
OP_DEF(ABS_OP,abs_impl,"abs",1,1)
OP_DEF(ADD_OP,add_impl,"add",1,1)
+OP_DEF(ADDC_OP,addc_impl,"addc",1,1)
OP_DEF(AND_OP,and_impl,"and",1,1)
OP_DEF(ATOM_OP,atom_impl,"atom",0,3)
OP_DEF(BAR_OP,bar_sync_impl,"bar.sync",1,3)
OP_DEF(BRA_OP,bra_impl,"bra",0,3)
+OP_DEF(BRKPT_OP,brkpt_impl,"brkpt",1,9)
OP_DEF(CALL_OP,call_impl,"call",1,3) /*call may actually return an value if the syntax is call (ret-param),fname,(param-list)*/
OP_DEF(CNOT_OP,cnot_impl,"cnot",1,1)
OP_DEF(COS_OP,cos_impl,"cos",1,4)
@@ -83,11 +85,13 @@ OP_DEF(CVT_OP,cvt_impl,"cvt",1,1)
OP_DEF(DIV_OP,div_impl,"div",1,1)
OP_DEF(EX2_OP,ex2_impl,"ex2",1,4)
OP_DEF(EXIT_OP,exit_impl,"exit",1,3)
+OP_DEF(FMA_OP,fma_impl,"fma",1,2)
OP_DEF(LD_OP,ld_impl,"ld",1,5)
OP_DEF(LG2_OP,lg2_impl,"lg2",1,4)
OP_DEF(MAD24_OP,mad24_impl,"mad24",1,2)
OP_DEF(MAD_OP,mad_impl,"mad",1,2)
OP_DEF(MAX_OP,max_impl,"max",1,1)
+OP_DEF(MEMBAR_OP,membar_impl,"membar",1,3)
OP_DEF(MIN_OP,min_impl,"min",1,1)
OP_DEF(MOV_OP,mov_impl,"mov",1,1)
OP_DEF(MUL24_OP,mul24_impl,"mul24",1,1)
@@ -96,6 +100,7 @@ OP_DEF(NEG_OP,neg_impl,"neg",1,1)
OP_DEF(NOT_OP,not_impl,"not",1,1)
OP_DEF(OR_OP,or_impl,"or",1,1)
OP_DEF(RCP_OP,rcp_impl,"rcp",1,4)
+OP_DEF(RED_OP,red_impl,"red",1,7)
OP_DEF(REM_OP,rem_impl,"rem",1,1)
OP_DEF(RET_OP,ret_impl,"ret",0,3)
OP_DEF(RSQRT_OP,rsqrt_impl,"rsqrt",1,4)
@@ -114,7 +119,3 @@ OP_DEF(TEX_OP,tex_impl,"tex",1,6)
OP_DEF(TRAP_OP,trap_impl,"trap",1,3)
OP_DEF(VOTE_OP,vote_impl,"vote",0,3)
OP_DEF(XOR_OP,xor_impl,"xor",1,1)
-OP_DEF(MEMBAR_OP,membar_impl,"membar",1,3)
-OP_DEF(RED_OP,red_impl,"red",1,7)
-OP_DEF(ADDC_OP,addc_impl,"addc",1,1)
-OP_DEF(BRKPT_OP,brkpt_impl,"brkpt",1,9)
diff --git a/src/cuda-sim/ptx.l b/src/cuda-sim/ptx.l
index d764c7f..3ef1071 100644
--- a/src/cuda-sim/ptx.l
+++ b/src/cuda-sim/ptx.l
@@ -129,6 +129,7 @@ membar TC; ptx_lval.int_value = MEMBAR_OP; return OPCODE;
red TC; ptx_lval.int_value = RED_OP; return OPCODE;
brkpt TC; ptx_lval.int_value = BRKPT_OP; return OPCODE;
addc TC; ptx_lval.int_value = ADDC_OP; return OPCODE;
+fma TC; ptx_lval.int_value = FMA_OP; return OPCODE;
<INITIAL,NOT_OPCODE>{