VSDK FAQ

VSDK

  1. What is VSDK?
  2. What does VSDK contain?
  3. How do I obtain VSDK?
  4. What kind of system do I need? How much disk space do I need to install the VSDK?
  5. Is the VSDK self contained or do I need to install other software?
  6. How do I set up the environment for VSDK?
  7. How do I get help for VSDK?
  8. What optimization flags should I use when compiling VIS code?
  9. How do I do code profiling?
  10. What is the "best" data type for loop control variables?
  11. How do I request the compiler not to inline a function?
  12. How do I request the compiler to pipeline a loop?
  13. What does #pragma nomemorydepend do?

1. What is VSDK?
VSDK stands for the "VIS Software Developer's Kit." VIS is an extension to the SPARC V9 instruction set and it accelerates multimedia processing (im aging, linear algebra, signal processing, audio, video, and networking). The VSDK will help develop, debug and tune software using VIS in C/C++.

Back to top


2. What does VSDK contain?
The VIS Software Developer's Kit contains:

  • The VIS User's Manual
  • 32-bit and 64-bit inline macro files for VIS instructions and the header file for the inline macros
  • Sample Code
  • Installation procedure and release notes

Back to top


3. How do I obtain VSDK?
You can download VSDK from following site:

 http://www.sun.com/processors/vis/vsdkfiles.html

Back to top


4. What kind of system do I need? How much disk space do I need to install the VSDK?
Disk space requirement:

 VSDK base under /opt/SUNWvsdk after installation          0.1 MB
 VSDK supplement under /opt/SUNWvsdk after installation    1.8 MB

Can be installed on any UltraSPARC platform.

Back to top


5. Is the VSDK self contained or do I need to install other software?
You will need the Sun WorkShop Compilers 4.0 or later to compile and generate 32-bit VIS applications, and Sun Workshop Compilers 5.0 compiler or later to co mpile and generate 64-bit VIS applications. You can get more information from Sun's web site at

  http://www.sun.com/workshop/ 

Back to top


6. How do I set up the environment for VSDK?
To compile the sample code in VSDK, you need to set environment variable VSDKHOME, which holds the path of the VSDK home directory. Moreover if the C compiler and the assembler is not in your PATH, set up the environment variables, CC and AS, to point to the C compiler and the assembler. For example:

 % setenv CC /opt/SUNWspro/bin/cc
 % setenv AS /usr/ccs/bin/as
  

Back to top


7. How do I get help for VSDK?
If you have questions about the VIS Software Developer's Kit, send an e-mail to:

VSDK@Sun.COM

Back to top


8. What optimization flags should I use when compiling VIS code?
The optimization flags you should use are "-fast", and "-xdepend". You should add "-xrestrict" if the pointer arguments are not aliased or overlapped.

Back to top


9. How do I do code profiling?
Here are the steps for code profiling:

  1. Compile and link your source with the flag -xpg.
  2. Run your executable. It will generate a file named "gmon.out", which contains profile data.
  3. Use "gprof" to generate a profile report.
  4.  % gprof exe_name
      
If you use Sun WorkShop 6 Update 1 or later, it is recommended that you use collect and analyzer tools for code profiling. They provide much more functionalities than -xpg/gprof mechanism.

Back to top


10. What is the "best" data type for loop control variable?
The "best" data type for integer variables, such as those used for loop index, loop count and other loop control variables, is signed 32-bit integer (e.g., signed int, int, vis_s32, mlib_s32, etc.). If other data type is used here, some unnecessary "shift" may be introduced by the compiler.

Back to top


11. How to ask compiler to pipeline a loop?
Add a pragma in front of a for-loop, for example:

#pragma pipeloop(0)
      for (;;) {
      }
  

Note that newer compilers automatically pipeline most of the loops that are pipelineable.

Back to top


12. What does #pragma pipeloop(n) do?
This pragma accepts a positive constant integer value, or 0, for the argument n. This pragma specifies that a loop is pipelineable and the minimum dependence distance of the loop-carried dependence is n. If the distance is 0, then the loop is effectively a Fortran-style doall loop and should be pipelined on the target processors. If the distance is greater than 0, then the compiler (pipeliner) will only try to pipeline n successive iterations. The pragma applies to the next for loop within the current block. The compiler takes advantage of this information at optimization level of 3 or above.

Back to top


13. What does #pragma nomemorydepend do?
This pragma specifies that for any iteration of a loop, there are no memory dependences. That is, within any iteration of a loop there are no references to the same memory. This pragma will permit the compiler (pipeliner) to schedule instructions, more effectively, within a single iteration of a loop. If any memory dependences exist within any iteration of a loop, the results of executing the program are undefined. The pragma applies to the next for loop within the current block. The compiler takes advantage of this information at optimization level of 3 or above.

Back to top