diff options
| author | Jimmy Kwa <[email protected]> | 2010-12-21 10:30:12 -0800 |
|---|---|---|
| committer | Jimmy Kwa <[email protected]> | 2010-12-21 10:30:12 -0800 |
| commit | d864c51b9fee6b2808e4752a556d6de4ba376b7c (patch) | |
| tree | b85f8dcb4467780a29006715bf7acc09e6860e6f | |
| parent | 4bf50de083f2cf4e11c56d9e423cd7ccaf2c50e7 (diff) | |
added support for negative .f64 operands in decuda_to_ptxplus
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 8289]
| -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);} |
