home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_02 / v7n2087a.txt < prev    next >
Text File  |  1988-12-09  |  6KB  |  165 lines

  1. TABLE 1 - Selected High C 386 configuration options
  2.  
  3. option    description                   cfg  cmd  prag env
  4.                                              ln
  5.  
  6. ansi      enforce ansi standards        X    X
  7. asm       make assembly listing              X    X
  8. cram      compile in minimum memory     X    X
  9. debug     make OMF debug records             X
  10. define    macro definitions                  X
  11. Global_alias_convention                 X         X          
  12. in_ext    default input file extension  X
  13. ipath     include file search path      X    X    X    X
  14. lin       listing lines per page             X
  15. list      listing file                       X
  16. no87      emulate even if 80x87 present                X
  17. object    output file                        X
  18. off       turn compiler toggles off          X    X
  19. on        turn compiler toggles on           X    X
  20. out_ext   default output file type      X
  21. profile   name of profile file               X
  22. tmpi1     instruction paging file            X
  23. tmpi2     intermediate paging file           X
  24. tmptp     tree paging file                   X
  25. tpages    tree page memory buffers      X    X
  26. xref      make file for XREF utility         X
  27.  
  28.  
  29.  
  30.  
  31. TABLE 2 - Selected High C Compiler toggles
  32.  
  33. toggle              description
  34.  
  35. Auto_reg_allocate   auto allocate register variables
  36. Emit_line_table     put table of source line #'s in OBJ
  37. Emit_names          put function names in OBJ
  38. Floating_point      emit 80x87 code instead of using library
  39. Optimize_for_space  make output as small as possible
  40. Optimize_FP         save frame pointer only when necessary
  41. Optimize_xjmp       merge common code at entrance & exit of loops
  42. Optimize_xjmp_space merge common code before jumps to same address
  43. Parm_warnings       check all function argument matching
  44. PCC_msgs            only give portability warnings
  45. Print_protos        print function headers for all functions
  46. Quiet               supress announcing each compiler phase
  47.  
  48.  
  49. TABLE 3 - Benchmarking High C 386. All times are in minutes, 
  50. seconds, and tenths of seconds. Timing was done on a 16 mhz 80386
  51. with 4 megabytes of memory and 30 megabyte Seagate hard disk. 
  52. Sieve times exclude load time. Compile times include load time.
  53.  
  54.  
  55. 10 Iterations of the Sieve of Eratosthenes
  56.  
  57.                                    High C 386     Microsoft C
  58.                                    (protected)       (real)
  59.                                       v1.4            v5.0
  60.  
  61. 8K byte array                        0:00.8         0:00.6
  62.  
  63. 256K byte array                      0:29.9         1:36.5
  64.  
  65.  
  66.  
  67. Compiling times for the QED text editor
  68.  
  69.                                    High C 386      DeSmet C
  70.                                    (protected)      (real)
  71.                                       v1.4           v3.03
  72.  
  73. 14 modules on hard disk              5:46.3         1:10.4
  74.  
  75.      Temporary files on VDISK        5:02.9         0:47.2
  76.  
  77. 1 5000 line module on hard disk      2:39.7            *
  78.  
  79.      Temporary files on VDISK        1:18.2            *
  80.  
  81.      Compiled in protected mode      1:07.9            *
  82.  
  83.  
  84. * compiler unable to perform these operations
  85.  
  86.  
  87.  
  88. FIGURE 1 - High C cross-jump optimizations
  89.  
  90. Tail Merging:
  91.  
  92.                BEFORE                        AFTER
  93.  
  94.                                                      jmp
  95.               start                          start
  96.                        jmp                               
  97.               block                             
  98.                                                .         
  99.                 .                              .         
  100.                 .                              .         
  101.                 .                                       
  102.                                                         
  103.             duplicate                                   
  104.               block                          block       
  105.                                                          
  106.                 
  107.              continue                       continue
  108.                 
  109.                 
  110. Duplicate code-block/jump pair merging:
  111.                 
  112.                 
  113.                                                      jmp
  114.               start                          start
  115.                        jmp                               
  116.               block                             
  117.                                                .         
  118.                 .                              .         
  119.                 .                              .         
  120.                 .                                       
  121.                                               
  122.             duplicate  jmp                           jmp 
  123.               block                          block       
  124.                                                         
  125.                                                         
  126.                 .                              .        
  127.                 .                              .        
  128.                 .                              .        
  129.  
  130.              continue                       continue
  131.                                                     
  132.                                                  
  133. LISTING 1 - A memory sizing routine illustrating High C's
  134. imbedded underscores for numeric constants, as well as 
  135. nested functions. Published with the permission of Meta Ware.
  136.                                                     
  137.                                                     
  138. extern void * malloc(unsigned int);                 
  139. extern void free(void *);                           
  140.                                                     
  141. unsigned Size_mem() {                               
  142.    unsigned int Alloc_amount = 0xff_ffff, /* 16 mb. */
  143.           Sum = 0;
  144.    void try() {
  145.       void *p;
  146.       do {
  147.          p = malloc(Alloc_amount);
  148.          Alloc_amount = Alloc_amount / 2;
  149.       } while (p == 0 && Alloc_amount > 256);  
  150.       if (p != 0) {
  151.            Sum += Alloc_amount*2;
  152.          if (Alloc_amount > 256) try();
  153.          }
  154.       if (p != 0) free(p);
  155.       }
  156.    try();
  157.    return Sum;
  158.    }    
  159.  
  160. High C 386          $895
  161. Meta Ware, Inc.
  162. 903 Pacific Avenue
  163. Santa Cruz, CA  95060
  164. (408) 429-6382
  165.