home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / arch / 12411 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.9 KB

  1. Path: sparky!uunet!opl.com!hri.com!spool.mu.edu!sdd.hp.com!swrinde!gatech!asuvax!chnews!chnews!doconnor
  2. From: doconnor@sedona.intel.com (Dennis O'Connor)
  3. Newsgroups: comp.arch
  4. Subject: Re: Machines with cond. assignment instruction?
  5. Message-ID: <DOCONNOR.93Jan26132151@potato.sedona.intel.com>
  6. Date: 26 Jan 93 18:21:51 GMT
  7. References: <1993Jan21.163607.31684@watson.ibm.com> <1k0840INNjk0@ilx018.intel.com>
  8. Organization: Intel i960(tm) Architecture
  9. Lines: 40
  10. NNTP-Posting-Host: potato.intel.com
  11. In-reply-to: gss@ilx018.intel.com's message of 25 Jan 93 08:24:32 GMT
  12.  
  13.  
  14. gss@ilx018.intel.com (Shavit Amir) writes:
  15. ] Pradeep Dubey (pradeep@watson.ibm.com) wrote:
  16. ] : Hello Everyone,
  17. ] : Are there announced machines (specially micros) with
  18. ] : some conditional assignment instruction.  I mean
  19. ] : instruction such as the following:
  20. ]
  21. ] : MovCond R1, R2, R3 /* if (c1) R1 <- R2 else R1 <- R3 */
  22. ]
  23. ] : where, c1 refers to some result of some previous compare.
  24. ]
  25. ] The above instruction is a 4 operand instruction, as the condition code is
  26. ] another implicit source operand. The best way to perform a conditional move
  27.                        ^^^^
  28. ] is to have compares set or clear all the bits in a register.
  29. ] Once that is done, conditional moves are simple.
  30. ]
  31. ] AND R1, R2 -> R4    /* R1 containes the condition code */
  32. ] ANDNOT R1,R3 -> R4
  33.  
  34. ? Why is
  35.     TEST<cc>, tsrc1, tsrc2, tdst
  36.     AND       tdst, msrc1, mdst
  37.     ANDNOT    tdst, msrc2, mdst
  38.  
  39. "best" compared to
  40.  
  41.     TEST        tsrc1, tsrc2
  42.     SELECT<cc>  msrc1, msrc2, mdst
  43.  
  44. Yes, the first avoids the CC-bits bottleneck, but multiple CCs could do that
  45. without consuming an entire register (a la RS6000). It uses three intructions
  46. instead of two, so it seems a loss to me.
  47.  
  48. Yes, the latter uses three inputs and one output, where one input
  49. is the CCs. However, add-with-carry does this too, and most architectures
  50. already have it, so it can't be a big deal.
  51. --
  52. Dennis O'Connor            doconnor@sedona.intel.com
  53.