home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gcc / bug / 2338 < prev    next >
Encoding:
Text File  |  1992-09-14  |  1.2 KB  |  49 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!annapurna.ai.mit.EDU!leisner
  3. From: leisner@annapurna.ai.mit.EDU ( Marty Leisner)
  4. Subject: unroll loops
  5. Message-ID: <9209141747.AA00595@annapurna.wbst147.xerox.com>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: leisner.henr801c@xerox.com
  8. Organization: Xerox
  9. Distribution: gnu
  10. Date: Mon, 14 Sep 1992 17:47:04 GMT
  11. Approved: bug-gcc@prep.ai.mit.edu
  12. Lines: 35
  13.  
  14. I'm using gcc 2.2.2 on a SS2 running SunOS 4.1.2.
  15.  
  16. I tried the optimization -funroll-loops and cc1 says:
  17. cc1: Invalid option `-funroll-loops"'
  18.  
  19. This isn't a machine dependent option?
  20.  
  21. On a sparc, -fno-frame-pointer also doesn't work (I'm not sure a sparc as a
  22. frame pointer?)
  23.  
  24. Anyway, this is the code I want to optimize...doing something like Duff's
  25. device doesn't increase speed much:
  26.  
  27. #define SPI  400
  28. #define WIDTH ((int) (SPI*8.5))
  29. #define HEIGHT ((int) (SPI*11))
  30.  
  31. unsigned char image[HEIGHT][WIDTH];
  32.  
  33. unsigned char lut[256];
  34.  
  35. /* apply look up table to an image */
  36. void apply_lut()
  37. {
  38.     unsigned char *pimage;
  39.  
  40.     for(pimage = image; pimage <= &image[HEIGHT][WIDTH]; pimage++)
  41.         *pimage = lut[*pimage];
  42. }
  43.  
  44.  
  45. Marty    leisner.henr801c@xerox.com 
  46.           Member of the League for Programming Freedom 
  47.      Give me source or waste my time..
  48.  
  49.