home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 21728 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  2.5 KB

  1. Path: sparky!uunet!spool.mu.edu!sgiblab!adagio.panasonic.com!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: VAXC divide problems (V3.2)
  5. Date: 22 Jan 1993 13:29:05 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Lines: 54
  8. Distribution: world
  9. Message-ID: <1josr1INN32k@gap.caltech.edu>
  10. References: <1993Jan22.060311.5226@cs.rit.edu>
  11. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  12. NNTP-Posting-Host: sol1.gps.caltech.edu
  13.  
  14. In article <1993Jan22.060311.5226@cs.rit.edu>, whd0675@cs.rit.edu (Walter H Dick, III) writes:
  15. >A statement in VAXC such as:
  16. >
  17. >   i = (x + 511) / 512;
  18. >
  19. >generates ten or so instructions.  Is there anyway to get it to generate:
  20. >
  21. >   ADDL3  #511,x,R0
  22. >   DIVL3  R0,#512,i
  23.  
  24. Yet another unanswerable question!  What version of VAX C are you using?  How
  25. do your results differ from:
  26.  
  27.  
  28. TEST                                                            22-JAN-1993 05:23:49    VAX C      V3.2-044                 Page 1
  29. V1.0                                                            22-JAN-1993 05:22:42    $1$DIA0:[CARL]TEST.C;49 (1)
  30.  
  31.  
  32.  
  33.     1            main()
  34.     2            {    int x=3, i;
  35.                                           0000    main:
  36.                                     0000  0000        .entry    main,^m<>
  37.                               5E 0C C2    0002        subl2    #12,sp
  38.                        00000000* EF 16    0005        jsb    C$MAIN
  39.                            F8 AD 03 D0    000B        movl    #3,-8(fp)
  40.  
  41.     3    1       
  42.     4    1           i = (x + 511) / 512;
  43.                5C 000001FF 8F F8 AD C1    000F        addl3    -8(fp),#511,ap
  44.                      5C 00000200 8F C6    0018        divl2    #512,ap
  45.                            F4 AD 5C D0    001F        movl    ap,-12(fp)
  46.  
  47.     5    1       }
  48.                               50 01 D0    0023        movl    #1,r0
  49.                                     04    0026        ret    
  50.                                     04    0027        ret    
  51.  
  52.  
  53.  
  54. Command Line
  55. ------------
  56.  
  57. CC/LIST/MACH TEST/NOOPT
  58.  
  59.  
  60. --------------------------------------------------------------------------------
  61. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  62.  
  63. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  64. understanding of astronomy is purely at the amateur level (or below).  So
  65. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  66. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  67. hold me responsible for it, but my organization had nothing to do with it.
  68.