home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / sgi / 18502 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  6.2 KB

  1. Path: sparky!uunet!olivea!sgigate!odin!bananapc.csd.sgi.com!ciemo
  2. From: ciemo@bananapc.csd.sgi.com (Dave Ciemiewicz)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: 3.10 compiler set, and r4000 code.
  5. Keywords: compiler, R4000
  6. Message-ID: <1993Jan5.221516.9452@odin.corp.sgi.com>
  7. Date: 5 Jan 93 22:15:16 GMT
  8. References: <1993Jan5.205248.17542@bnlux1.bnl.gov>
  9. Sender: news@odin.corp.sgi.com (Net News)
  10. Organization: Silicon Graphics, Customer Support Division
  11. Lines: 146
  12. Nntp-Posting-Host: bananapc.csd.sgi.com
  13.  
  14. In article <1993Jan5.205248.17542@bnlux1.bnl.gov>, adler@bnlku2.phy.bnl.gov (Steve Adler) writes:
  15. |> I just installed the 3.10 compiler set on my Indigo R4k. I also have
  16. |> the fortran compiler installed on my Indigo. Will the compilers
  17. |> automatically know to generate the r4k instruction set, or do I have to
  18. |> use some bizar qualifier on the f77 command line. I noticed in the man
  19. |> pages for f77 that there is the -mips1 and -mips2 qualifiers|>  where
  20. |> the -mips1 is the default. Does this mean that the -mips1 qualifier
  21. |> generates r3000 code and the -mips2 generates the r4000 code? Any one
  22. |> out there in Interland know?
  23. |>
  24. |> Steve Adler.
  25.  
  26. No, R4000 (MIPS-II archictecture) specific code is not generated automagically.
  27. In fact, for portability reasons, you don't want that to happen because systems
  28. based on the R2000/R3000 (MIPS-I architecture) don't implement all of the
  29. instructions of the MIPS-II architecture thus they are not binary compatible
  30. with MIPS-II architecture code.  MIPS-I code is portable acrossed all three
  31. processors (R2/3/4000).  The following information may help you understand
  32. the issues further:
  33.  
  34. ------------------------------------------------------------------------------
  35. NAME
  36.     MIPS R4000 and -mips2 compiler option
  37.  
  38. AUTHOR
  39.     Dave Ciemiewicz, SGI Customer Services Engineering
  40.  
  41. DATE
  42.     November 21, 1992
  43.  
  44.  
  45. ABSTRACT
  46.     This paper is a short discussion of the R4000 specific compiler
  47.     issues including the benefits of using the -mips2 option.
  48.  
  49.  
  50. DESCRIPTION
  51.     The SGI 3.10 compilers provide a -mips2 option for accessing
  52.     the MIPSII instruction set extensions of the R4000.  This provides
  53.     The -mips2 used when compiling with C, C++, Fortran, or Pascal,
  54.     will instruct the code generation phase to generate the R4000
  55.     specific instructions.  When linking, -mips2 instructs the linker
  56.     ld(1) to use mips2 specific versions of libraries from the directory
  57.     /usr/lib/mips2.
  58.  
  59.  
  60.      Benefits of using -mips2
  61.     ------------------------
  62.     Code which performs a significant amount of double precision
  63.     arithmetic may benefit from using the -mips2 option.  The primary
  64.     reason for this is that the R4000 instruction set provides both
  65.     double word load and store instructions which can load or save
  66.     a double precision number in a single double word memory reference
  67.     instead of requiring two one-word memory references as is necessary
  68.     on the R2000/R3000.
  69.  
  70.     In addition, the R4000 implements intrinsic instructions for
  71.     truncating, rounding, ceiling, and flooring when converting floating
  72.     point numbers to integers.  On the R2000/R3000, these instructions
  73.     where implemented as assembler macros which were expanded into a
  74.     set of approximately 11 instructions.  Code which does of significant
  75.     amount of floating point to integer conversions should benefit from
  76.     the -mips2 option.
  77.  
  78.     The 3.10 Fortran compiler using the -mips2 option also makes use of
  79.     the R4000 sqrt instruction which would be implemented as sqrt routine
  80.     in the math libraries for the R2000/R3000.
  81.  
  82.     The 3.10 compilers also supply a special set of libraries compiled
  83.     using the -mips2 option.  As part of the basic development environment,
  84.     you get:
  85.  
  86.         /usr/lib/mips2/libfastm.a    /* fast sqrt algorithm */
  87.         /usr/lib/mips2/libm.a        /* Math library */
  88.         /usr/lib/mips2/libm43.a        /* 4.3 BSD math algorithms */
  89.  
  90.     Note: at this time, these sqrt() function in these math libraries do
  91.     not use the R4000 intrinsic sqrt instruction though they may at some
  92.     future time. 
  93.  
  94.     For the 3.10 Fortran compiler, you get -mips2 versions of:
  95.  
  96.         /usr/lib/mips2/libF77.a
  97.         /usr/lib/mips2/libI77.a
  98.         /usr/lib/mips2/libU77.a
  99.         /usr/lib/mips2/libisam.a
  100.  
  101.     The shared library versions of the above Fortran libraries have not
  102.     been compiled using the -mips2 option on R4000 platforms.
  103.  
  104.  
  105.     Disadvantages of using -mips2
  106.     -----------------------------
  107.     Code compiled and/or linked using the -mips2 option will not run
  108.     on R2000/R3000 based machines.  Code compiled without the -mips2
  109.     option will run all machines - R2000/R3000/R4000 -- within the
  110.     contraints of operating system compatibility.  If broad machine
  111.     base compatibility is an issue, SGI recommends using the -mips2
  112.     flag only when significant benefit is acheived on an R4000 when
  113.     compared to running the same program compiled without -mips2 on
  114.     the same R4000 machine.
  115.  
  116.  
  117.     R4000 features not provide by -mips2
  118.     ------------------------------------
  119.     The following features of the R4000 are not currently accessible
  120.     using the -mips2 option and are part of the MIPSIII instruction
  121.     extensions.  These features are not currently supported as some
  122.     of them require operating system support which is not yet available.
  123.     Thes features will be supported in the next major release of the
  124.     IRIX operating system.
  125.  
  126.     The R4000 has the capability of performing long or double word (64-bit)
  127.     integer arithmetic.  This is not available with -mips2.
  128.  
  129.     The R4000 MIPSIII architecture supports 64-bit addresses and pointers.
  130.     This is not available with -mips2.
  131.  
  132.     The R4000 supports two floating point register (FPR) modes: 16 64-bit
  133.     floating point register mode and 32 64-bit floating point register
  134.     mode.  The 16 64-bit mode is compatible with the R2010/R3010 which
  135.     only support 16 64-bit floating point registers.  The 32 register
  136.     mode is not supported by IRIX at this time and so is not available
  137.     via the -mips2 option.
  138.  
  139.  
  140. REFERENCES
  141.     "VR4000 Microprocessor User's Manual"
  142.     NEC Electronics Inc.
  143.     Corporate Headquarters
  144.     401 Ellis Street
  145.     P.O. Box 7241
  146.     Mountain View, CA 94039-7241
  147.     For literature, call: 1-800-632-3531
  148.  
  149.     "MIPS RISC Architecture"
  150.     Gerry Kane and Joe Heinrich
  151.     Prentice Hall
  152.  
  153. -- 
  154.  
  155.     __   * __   _  __  ___            
  156.    /  \ / / /  / \/  \/   \     He was a man like any other man, however, not
  157.   /    /  \/  /  /\  /    /    quite like any other man.
  158.   \___/\__/\_/  /_/ / \__/    
  159.                *        
  160.