home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c221 / 5.ddi / MWHC.005 / G < prev    next >
Encoding:
Text File  |  1992-04-20  |  11.3 KB  |  273 lines

  1. @echo off 
  2. set BSRC=.
  3. set BMOUT=
  4.  
  5. if "%1" == "" goto help
  6. set SEQUENCE=jump
  7. if "%1" == "dhry21" goto dhry21
  8. if "%1" == "bsort" goto bsort
  9. if "%1" == "sieve" goto sieve 
  10. if "%1" == "linp" goto linp
  11. if "%1" == "whet" goto whet
  12. if "%1" == "all" goto doall
  13.    
  14. :help
  15. @echo *********************************************************
  16. @echo * This demonstrates the High C compiler. It may take    *
  17. @echo * as long as 20 minutes on a slow 386 machine with no   *
  18. @echo * floating point coprocessor to compile and run all     *
  19. @echo * demo programs. Linpack takes the most time.           *
  20. @echo * High C will automatically detect and use an 80387     *
  21. @echo * coprocessor if one is present on your machine.        *
  22. @echo * There are 5 benchmarks in the demos directory:        *
  23. @echo *   dhry21 -- dhrystone version 2.1                     *
  24. @echo *   bsort  -- simple bubble-sort program                *
  25. @echo *   sieve  -- sieve prime number benchmark program      *
  26. @echo *   whet   -- whetstone benchmark                       *
  27. @echo *   linp   -- linpack benchmark                         *
  28. @echo * To run all of them, simply type the following command *
  29. @echo *      demo all                                         *
  30. @echo * at the DOS prompt.                                    *
  31. @echo * To run an individual benchmark, type the individual   *
  32. @echo * name on the command line. The following example       *
  33. @echo * illustrates how to invoke the dhry21 benchmark:       *
  34. @echo *      demo dhry21                                      *
  35. @echo *********************************************************
  36. goto done
  37.  
  38. :doall
  39. set SEQUENCE=flow
  40.  
  41. :dhry21
  42.     @echo ***************************************************************
  43.         @echo * Making Dhrystone ver 2.1                                    *
  44.     @echo ***************************************************************
  45.     @if exist dhry21.out del dhry21.out
  46.     @if exist dhry21.arg del dhry21.arg
  47.     @echo -O4 -Hit=100 -Hic=4             >> dhry21.arg
  48.     @echo %BSRC%\dpack1.c %BSRC%\dpack2.c >> dhry21.arg
  49.     @echo -w -I%BSRC% -o dhry21           >> dhry21.arg
  50.     @hc386 @dhry21.arg
  51.     @echo.
  52.     @echo +-------------------------------------------------------------+
  53.         @echo + Running Dhrystone ver 2.1                                   +
  54.     @echo +-------------------------------------------------------------+
  55.     @run386 dhry21                        >> dhry21.out
  56.     type dhry21.out
  57.     @echo.
  58.     @echo.
  59.     @if exist dhry21.arg del dhry21.arg
  60.     @if exist dhry21.map del dhry21.map
  61.     @if exist dpack1.obj del dpack1.obj
  62.     @if exist dpack2.obj del dpack2.obj
  63.     @if exist dhry21.exp del dhry21.exp
  64.     set BMOUT=%BMOUT% dhry21.out
  65.     if "%SEQUENCE%" == "jump" goto done
  66.     pause
  67.  
  68. :bsort
  69.     @echo ***************************************************************
  70.     @echo * Making Bubble Sort Demo Program                             *
  71.     @echo ***************************************************************
  72.     @if exist bsort.out del bsort.out
  73.     @if exist bsort.arg del bsort.arg
  74.     @echo -O7                              >> bsort.arg
  75.     @echo -DITERATIONS=1000 -DBENCHMARK    >> bsort.arg
  76.     @echo %BSRC%\bsort.c                   >> bsort.arg
  77.     @echo -w -o bsort                      >> bsort.arg
  78.     @hc386 @bsort.arg
  79.     @echo.
  80.     @echo +-------------------------------------------------------------+
  81.         @echo + Running Bubble Sort Demo Program                            +
  82.     @echo +-------------------------------------------------------------+
  83.     @run386 bsort                          >> bsort.out
  84.     @type bsort.out
  85.     @echo.
  86.     @echo.
  87.     @if exist bsort.arg del bsort.arg
  88.     @if exist bsort.map del bsort.map
  89.     @if exist bsort.obj del bsort.obj
  90.     @if exist bsort.exp del bsort.exp
  91.     set BMOUT=%BMOUT% bsort.out
  92.     if "%SEQUENCE%" == "jump" goto done
  93.     pause
  94.  
  95. :sieve
  96.     @echo ***************************************************************
  97.         @echo * Making Sieve Prime Number Demo                              *
  98.     @echo ***************************************************************
  99.     @if exist sieve.out del sieve.out
  100.     @if exist sieve.arg del sieve.arg
  101.     @echo -O7                             >> sieve.arg
  102.     @echo -DITERATIONS=1000 -DBENCHMARK   >> sieve.arg
  103.     @echo %BSRC%\sieve.c                  >> sieve.arg
  104.     @echo -w -o sieve                     >> sieve.arg
  105.     @hc386 @sieve.arg
  106.     @echo.
  107.     @echo +-------------------------------------------------------------+
  108.         @echo + Running Sieve Prime Number Demo                             +
  109.     @echo +-------------------------------------------------------------+
  110.     @run386 sieve                         >> sieve.out
  111.     @type sieve.out
  112.     @echo.
  113.     @echo.
  114.     @if exist sieve.arg del sieve.arg
  115.     @if exist sieve.obj del sieve.obj
  116.     @if exist sieve.map del sieve.map
  117.     @if exist sieve.exp del sieve.exp
  118.     set BMOUT=%BMOUT% sieve.out
  119.     if "%SEQUENCE%" == "jump" goto done
  120.     pause
  121.  
  122. :whet
  123.     @echo ***************************************************************
  124.         @echo * Making Whetstone Single Precision Benchmark                 *
  125.     @echo ***************************************************************
  126.     @if exist whet.out del whet.out
  127.     @if exist whet_s.arg del whet_s.arg
  128.     @if exist whet_d.arg del whet_d.arg
  129.     @echo -O7 -Hit=100 -Hic=4             >> whet_s.arg
  130.     @echo -fsingle -fsingle2              >> whet_s.arg
  131.     @echo %BSRC%\whet_s.c                 >> whet_s.arg
  132.     @echo -w -o whet_s                    >> whet_s.arg
  133.     @hc386 @whet_s.arg
  134.     @echo.
  135.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  136.         @echo : Redirecting Output From Whetstone Single Precision          :
  137.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  138.     @run386 whet_s                        >> whet.out
  139.     @echo.
  140.     @if exist whet_s.arg del whet_s.arg
  141.     @if exist whet_s.map del whet_s.map
  142.     @if exist whet_s.obj del whet_s.obj
  143.     @if exist whet_s.exp del whet_s.exp
  144.  
  145.     @echo ***************************************************************
  146.         @echo * Making Whetstone Double Precision Benchmark                 *
  147.     @echo ***************************************************************
  148.     @echo -O7 -Hit=100 -Hic=4             >> whet_d.arg
  149.     @echo %BSRC%\whet_d.c                 >> whet_d.arg
  150.     @echo -w -o whet_d                    >> whet_d.arg
  151.     @hc386 @whet_d.arg
  152.     @echo.
  153.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  154.         @echo : Redirecting Output From Whetstone Double Precision          :
  155.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  156.     @run386 whet_d                        >> whet.out
  157.     @echo.
  158.     @if exist whet_d.arg del whet_d.arg
  159.     @if exist whet_d.map del whet_d.map
  160.     @if exist whet_d.obj del whet_d.obj
  161.     @if exist whet_d.exp del whet_d.exp
  162.     @echo +-------------------------------------------------------------+
  163.     @echo + Running whetstone benchmark                                 +
  164.     @echo +-------------------------------------------------------------+
  165.     type whet.out
  166.     @echo.
  167.     @echo.
  168.     set BMOUT=%BMOUT% whet.out
  169.     if "%SEQUENCE%" == "jump" goto done
  170.     pause
  171.  
  172. :linp
  173.     @echo ***************************************************************
  174.         @echo * Making Linpack Rolled Single Precision Benchmark            *
  175.     @echo ***************************************************************
  176.     @if exist linp.out del linp.out
  177.     @if exist sroll.arg del sroll.arg
  178.     @if exist droll.arg del droll.arg
  179.     @if exist sunroll.arg del sunroll.arg
  180.     @if exist dunroll.arg del dunroll.arg
  181.     @echo -O7 -Hit=100 -Hic=4             >> sroll.arg
  182.     @echo -DSP -DROLL                     >> sroll.arg
  183.     @echo %BSRC%\linpack.c                >> sroll.arg
  184.     @echo -w -o sroll                     >> sroll.arg
  185.     @hc386 @sroll.arg
  186.     @echo.
  187.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  188.         @echo : Redirecting Output From Linpack Rolled Single Precision     :
  189.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  190.     @run386 sroll                         >> linp.out
  191.     @echo.
  192.     @if exist sroll.arg del sroll.arg
  193.     @if exist sroll.map del sroll.map
  194.     @if exist linpack.obj del linpack.obj
  195.     @if exist sroll.exp del sroll.exp
  196.  
  197.     @echo ***************************************************************
  198.         @echo * Making Linpack Rolled Double Precision Benchmark            *
  199.     @echo ***************************************************************
  200.     @echo -O7 -Hit=100 -Hic=4             >> droll.arg
  201.     @echo -DDP -DROLL                     >> droll.arg
  202.     @echo %BSRC%\linpack.c                >> droll.arg
  203.     @echo -w -o droll                     >> droll.arg
  204.     @hc386 @droll.arg
  205.     @echo.
  206.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  207.         @echo : Redirecting Output From Linpack Rolled Double Precision     :
  208.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  209.     @run386 droll                         >> linp.out
  210.     @echo.
  211.     @if exist droll.arg del droll.arg
  212.     @if exist droll.map del droll.map
  213.     @if exist linpack.obj del linpack.obj
  214.     @if exist droll.exp del droll.exp
  215.  
  216.         @echo ***************************************************************
  217.         @echo * Making Linpack Unrolled Single Precision Benchmark          *
  218.         @echo ***************************************************************
  219.     @echo -O7 -Hit=100 -Hic=4             >> sunroll.arg
  220.     @echo -DSP -DUNROLL                   >> sunroll.arg
  221.     @echo %BSRC%\linpack.c                >> sunroll.arg
  222.     @echo -w -o sunroll                   >> sunroll.arg
  223.     @hc386 @sunroll.arg
  224.     @echo.
  225.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  226.         @echo : Redirecting Output From Linpack Unrolled Single Precision   :
  227.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  228.     @run386 sunroll                       >> linp.out
  229.     @echo.
  230.     @if exist sunroll.arg del sunroll.arg
  231.     @if exist sunroll.map del sunroll.map
  232.     @if exist linpack.obj del linpack.obj
  233.     @if exist sunroll.exp del sunroll.exp
  234.  
  235.     @echo ***************************************************************
  236.         @echo * Making Linpack Unrolled Double Precision Benchmark          *
  237.     @echo ***************************************************************
  238.     @echo -O7 -Hit=100 -Hic=4             >> dunroll.arg
  239.     @echo -DDP -DUNROLL                   >> dunroll.arg
  240.     @echo %BSRC%\linpack.c                >> dunroll.arg
  241.     @echo -w -o dunroll                   >> dunroll.arg
  242.     @hc386 @dunroll.arg
  243.     @echo.
  244.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  245.         @echo : Redirecting Output From Linpack Unrolled Double Precision   :
  246.     @echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  247.     @run386 dunroll                       >> linp.out
  248.     @echo.
  249.     @if exist dunroll.arg del dunroll.arg
  250.     @if exist dunroll.map del dunroll.map
  251.     @if exist linpack.obj del linpack.obj
  252.     @if exist dunroll.exp del dunroll.exp
  253.     @echo +-------------------------------------------------------------+
  254.     @echo + Running Linpack benchmark                                   +
  255.     @echo +-------------------------------------------------------------+
  256.     type linp.out
  257.     @echo.
  258.     @echo.
  259.     set BMOUT=%BMOUT% linp.out
  260.  
  261. :done
  262. set SEQUENCE=
  263. if "%BMOUT%" == "" goto end
  264.   @echo ------------------------- Demo Completed ----------------------------
  265.   @echo.
  266.   @echo. All demos output are also recorded in the following list       
  267.   @echo. of file(s):                                                
  268.   @echo.
  269.   @echo. %BMOUT%
  270.   @echo.
  271.   set BMOUT=
  272. :end
  273.