From 6e0aab40706497ef4e3046d5614b0061f538f300 Mon Sep 17 00:00:00 2001 From: Wilson Fung Date: Mon, 12 Nov 2012 21:56:33 -0800 Subject: 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] --- configs/QuadroFX5800/gpgpusim.config | 2 +- src/cuda-sim/instructions.cc | 16 +++++++++++++++- src/cuda-sim/ptx.y | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/configs/QuadroFX5800/gpgpusim.config b/configs/QuadroFX5800/gpgpusim.config index 903c12e..e7ddafc 100644 --- a/configs/QuadroFX5800/gpgpusim.config +++ b/configs/QuadroFX5800/gpgpusim.config @@ -1,7 +1,7 @@ # functional simulator specification -gpgpu_ptx_instruction_classification 0 -gpgpu_ptx_sim_mode 0 --gpgpu_ptx_force_max_capability 12 +-gpgpu_ptx_force_max_capability 13 # high level architecture configuration -gpgpu_n_clusters 10 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}, diff --git a/src/cuda-sim/ptx.y b/src/cuda-sim/ptx.y index c4d8b06..15662aa 100644 --- a/src/cuda-sim/ptx.y +++ b/src/cuda-sim/ptx.y @@ -218,6 +218,7 @@ block_spec: MAXNTID_DIRECTIVE INT_OPERAND COMMA INT_OPERAND COMMA INT_OPERAND {f func_header_info_int(",", $4); func_header_info_int(",", $6); } | MINNCTAPERSM_DIRECTIVE INT_OPERAND { func_header_info_int(".minnctapersm", $2); printf("GPGPU-Sim: Warning: .minnctapersm ignored. \n"); } + | MAXNCTAPERSM_DIRECTIVE INT_OPERAND { func_header_info_int(".maxnctapersm", $2); printf("GPGPU-Sim: Warning: .maxnctapersm ignored. \n"); } ; block_spec_list: block_spec -- cgit v1.3