summaryrefslogtreecommitdiff
path: root/src/cuda-sim/instructions.cc
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2012-11-12 21:56:33 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:49:21 -0700
commit6e0aab40706497ef4e3046d5614b0061f538f300 (patch)
treefc8dd9f49b471544ac8c5856fa18adfccd32f931 /src/cuda-sim/instructions.cc
parent117dfa890501388dec301f461f0cca2562d6a941 (diff)
Changing the QuadroFX5800 config to use compute capability 1.3 (no idea why it was not...). Adding sign-extension mode for cvt.s16.s32 that writes to a .u32 register. Adding stub parsing for .maxnctapersm directive. Removing benchmarks with known-issues from regression list for now.
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 14572]
Diffstat (limited to 'src/cuda-sim/instructions.cc')
-rw-r--r--src/cuda-sim/instructions.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index e7bb50a..99d7399 100644
--- a/src/cuda-sim/instructions.cc
+++ b/src/cuda-sim/instructions.cc
@@ -1452,6 +1452,20 @@ ptx_reg_t sext( ptx_reg_t x, unsigned from_width, unsigned to_width, int to_sign
return x;
}
+// sign extend depending on the destination register size - hack to get SobelFilter working in CUDA 4.2
+ptx_reg_t sexd( ptx_reg_t x, unsigned from_width, unsigned to_width, int to_sign, int rounding_mode, int saturation_mode )
+{
+ x=chop(x,0,from_width,0,rounding_mode,saturation_mode);
+ switch ( to_width ) {
+ case 8: if ( x.get_bit(7) ) x.mask_or(0xFFFFFFFF,0xFFFFFF00);break;
+ case 16:if ( x.get_bit(15) ) x.mask_or(0xFFFFFFFF,0xFFFF0000);break;
+ case 32: if ( x.get_bit(31) ) x.mask_or(0xFFFFFFFF,0x00000000);break;
+ case 64: break;
+ default: assert(0);
+ }
+ return x;
+}
+
ptx_reg_t zext( ptx_reg_t x, unsigned from_width, unsigned to_width, int to_sign, int rounding_mode, int saturation_mode )
{
return chop(x,0,from_width,0,rounding_mode,saturation_mode);
@@ -1748,7 +1762,7 @@ ptx_reg_t (*g_cvt_fn[11][11])( ptx_reg_t x, unsigned from_width, unsigned to_wid
int rounding_mode, int saturation_mode ) = {
{ NULL, sext, sext, sext, NULL, sext, sext, sext, s2f, s2f, s2f},
{ chop, NULL, sext, sext, chop, NULL, sext, sext, s2f, s2f, s2f},
- { chop, chop, NULL, sext, chop, chop, NULL, sext, s2f, s2f, s2f},
+ { chop, sexd, NULL, sext, chop, chop, NULL, sext, s2f, s2f, s2f},
{ chop, chop, chop, NULL, chop, chop, chop, NULL, s2f, s2f, s2f},
{ NULL, zext, zext, zext, NULL, zext, zext, zext, u2f, u2f, u2f},
{ chop, NULL, zext, zext, chop, NULL, zext, zext, u2f, u2f, u2f},