diff options
| -rw-r--r-- | decuda_to_ptxplus/decudaInst.cc | 11 | ||||
| -rw-r--r-- | src/cuda-sim/ptx.y | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/decuda_to_ptxplus/decudaInst.cc b/decuda_to_ptxplus/decudaInst.cc index 98e8a59..1bb5c8e 100644 --- a/decuda_to_ptxplus/decudaInst.cc +++ b/decuda_to_ptxplus/decudaInst.cc @@ -438,6 +438,17 @@ void decudaInst::printNewPtx() snprintf(newText,40,"{$r%u,$r%u,$r%u,$r%u}", regNumInt+0, regNumInt+1, regNumInt+2, regNumInt+3); currentPiece->stringText = newText; + } else if( modString[0] == '-' && modString[1] == '$' && modString[2] == 'r' ) { + strcpy(newText, modString); + strtok (newText, "r"); + regNumString = strtok (NULL, "r"); + regNumInt = atoi(regNumString); + if(vectorFlag ==1) + snprintf(newText,40,"-{$r%u,$r%u}", regNumInt+0, regNumInt+1); + if(vectorFlag ==2) + snprintf(newText,40,"-{$r%u,$r%u,$r%u,$r%u}", regNumInt+0, regNumInt+1, regNumInt+2, regNumInt+3); + + currentPiece->stringText = newText; } /*else if( modString[0] == '$' && modString[1] == 'o'&& modString[2] == 'f' ) { strcpy(newText, modString); strtok (newText, "s"); diff --git a/src/cuda-sim/ptx.y b/src/cuda-sim/ptx.y index a9cd744..f7d8a7b 100644 --- a/src/cuda-sim/ptx.y +++ b/src/cuda-sim/ptx.y @@ -505,6 +505,7 @@ operand: IDENTIFIER { add_scalar_operand( $1 ); } | literal_operand | builtin_operand | vector_operand + | MINUS vector_operand { change_operand_neg(); } | tex_operand | IDENTIFIER PLUS INT_OPERAND { add_address_operand($1,$3); } | IDENTIFIER LO_OPTION { add_scalar_operand( $1 ); change_operand_lohi(1);} |
