home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / aix / 12948 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  2.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!netnews.upenn.edu!msuinfo!scss3.cl.msu.edu!mrr
  2. From: mrr@scss3.cl.msu.edu (Mark Riordan)
  3. Newsgroups: comp.unix.aix
  4. Subject: RS/6000 Integer Multiply Instruction
  5. Summary: Want assembly language help
  6. Message-ID: <1i58g8INNk0j@msuinfo.cl.msu.edu>
  7. Date: 2 Jan 93 23:29:12 GMT
  8. Organization: Michigan State University
  9. Lines: 43
  10. NNTP-Posting-Host: scss3.cl.msu.edu
  11. X-Newsreader: TIN [version 1.1 PL6]
  12.  
  13. I would like help on an RS/6000 assembly language question.
  14.  
  15. I have written an integer multiply-intensive program which has
  16. been ported to many platforms.  (The program, RIPEM, is a public key
  17. encryption program written in C; for more info, FTP to rpub.cl.msu.edu.)
  18.  
  19. RIPEM spends a lot of time doing extended-precision integer 
  20. multiplies.  This involves doing a lot of 32 bit * 32 bit = 64 bit
  21. multiplies.  Because there is no 64-bit integer type, doing
  22. such a multiply in C is painful and inefficient.  This is especially
  23. annoying given that most CPU's, including the RS/6000, have
  24. a single instruction which does a 32 bit * 32 bit multiply,
  25. yielding a 64-bit product.  But few C compilers can be gotten
  26. to emit this instruction.
  27.  
  28. On architectures with which I am familiar, I have been able to
  29. speed up RIPEM by 50% or more simply by:
  30.  
  31.   1. Feeding the C source through the compiler to get assembly output, 
  32.   2. Replacing the lengthy and obtuse code needed to do the multiply 
  33.      portably with the appropriate instruction for that platform,
  34.   3. Feeding the resultant assembly source to the assembler.
  35.  
  36. I haven't been able to do this on the RS/6000 because I can't
  37. figure out exactly how the MQ register works (the information
  38. in InfoExplorer seems to be incorrect), I can't figure out
  39. how to get IBM's xlc C compiler to emit true assembly code,
  40. and I don't know the assembly syntax for accessing the MQ register
  41. (which evidently holds the most significant 32 bits of a multiply).
  42.  
  43. I can get xlc to put out an assembly *listing*, but not assembly
  44. source code that can be fed to a compiler.  I obtained and installed
  45. GNU C to solve that problem.  But I still can't figure out how to
  46. access the MQ register.
  47.  
  48. Incidentally, I want to do *unsigned* multiplies.  Is this going
  49. to be a problem?  
  50.  
  51. Can anyone help?
  52.  
  53. Thanks,
  54.  
  55. Mark Riordan    mrr@scss3.cl.msu.edu
  56.