home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / arch / 10569 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  2.6 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!agate!doc.ic.ac.uk!uknet!mucs!cs.man.ac.uk!endecotp
  2. From: endecotp@cs.man.ac.uk (PB Endecott (PhD SFurber))
  3. Newsgroups: comp.arch
  4. Subject: Re: why no register + register addressing mode in R3000
  5. Message-ID: <endecotp.721329802@cs.man.ac.uk>
  6. Date: 9 Nov 92 17:23:22 GMT
  7. References: <18938@ucdavis.ucdavis.edu>
  8. Sender: news@cs.man.ac.uk
  9. Lines: 50
  10.  
  11. kong@ece.ucdavis.edu (Timothy Kong) writes:
  12.  
  13. >The Mips R2/3/4000 has the register + offset addressing mode, i.e.
  14. >"load Rx,offset(Ra)," where offset is a 16-bit constant.  Why doesn't it
  15. >have the more flexible "load Rx,Ra,Rb," where effective address = Ra + Rb?
  16. >Since either way effective address calculation needs an addition, the
  17. >reg.+reg. mode shouldn't require any more hardware.  Am I missing something?
  18. >The Sparc has the reg.+reg. mode.
  19.  
  20. >I have seen code where a "load Rx,Ra,Rb" would reduce instruction
  21. >count, and so the argument that such an instruction is rarely used
  22. >wouldn't make sense.
  23.  
  24. >Timothy Kong
  25. >kong@eecs.ucdavis.edu
  26.  
  27.  
  28. Although it's true that both register+offset and register+register modes
  29. require an addition, you haven't allowed for the fact that an extra
  30. register read has to take place.  Normally most microprocessors have two
  31. read ports and one write port on the register file, which is exactly what
  32. is required for three address arithmetic/logical operations.  When you
  33. execute a store instruction, one read port is used for the data value, and
  34. the other for the address register.
  35.  
  36. If you want to implement register+register addressing, you have two main
  37. choices :
  38.  
  39. - Add a third read port.  This increases the size of your register file by
  40. about 25%-ish, plus another set of decoders.  The question you must ask is,
  41. would that extra silicon be better used for increasing the cache size, or
  42. just keeping the die cost down ?
  43.  
  44. - Insert an extra cycle and read the registers in two goes.  Ignoring the
  45. effect of cache misses etc. this takes the same number of cycles as doing
  46. an explicit add in a separate instruction - provided you have enough
  47. registers.
  48.  
  49. Of course for a load, you do have two read ports available.  Would anyone
  50. consider an architecture with non-symetrical addressing modes, where loads
  51. can do register+constant or register+register, but stores can do
  52. register+constant only?
  53.  
  54. Another feature that some processors have and others don't is
  55. auto-indexing.  During loads, this requires an extra write port (or an
  56. extra cycle) to put the modified value back in the register; but during
  57. stores the write port is not used for data.  So how about an architecture
  58. with autoindexing for stores but not for loads ?
  59.  
  60. -- Phil.
  61.