home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2267 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: ifi.uio.no!usenet
  2. From: ludvigp@ifi.uio.no (Ludvig Pedersen)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 29 Jan 1996 16:49:51 GMT
  6. Organization: Dept. of Informatics, University of Oslo, Norway
  7. Message-ID: <1234.6598T1186T2211@ifi.uio.no>
  8. References: <4d42gg$i2p@ra.ibr.cs.tu-bs.de> <4dov8s$rc5@ar.ar.com.au>
  9.     <38232132@kone.fipnet.fi> <1205.6597T1252T932@ifi.uio.no> <4e882m$k7u@sunsystem5.informatik.tu-muenchen.de>
  10. NNTP-Posting-Host: gymir.ifi.uio.no
  11. X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
  12.  
  13. >|> Using
  14. >|>         sub.w   dx,dx
  15. >|>
  16. >|> instead of
  17. >|>
  18. >|>         moveq   #0,d0
  19. >|>         add.l   d1,d0
  20.  
  21. >what about cmp.x dx,dx
  22. >won't trash dx ;) the aim was to get X flag 0 right ?
  23.  
  24. Yes, the aim was to get X flag 0 right!
  25.  
  26. But your suggestion doesnt work, the X-flag is *NOT* affected by cmp!!!
  27. (Nice try! ;))
  28.  
  29. >Clearing X maybe gives less noise, but not correct :)
  30. Why not?
  31.  
  32. >|> is faster by-the-way. And since we are only using the lower word of the
  33. >|> register we don't need to use an extra dataregister.
  34. >sub.b dx,dx would even have trashed only the lower _byte_ ;)
  35. >but all instructions tend to need lower byte ;)
  36.  
  37. No they dont, a typical tmap loop looks like this:
  38.  
  39. TmapFill:       MACRO
  40.         move.w  a4,d5                   ;2 cycles
  41.         move.b  d4,d5                   ;2 cycles
  42.         move.l  d5,a5                   ;2 cycles
  43.  
  44.         move.b  (a5),(a1)+              ;7 cycles
  45.  
  46.         addx.l  d2,d4                   ;2 cycles
  47.         adda.l  d3,a4                   ;2 cycles
  48.  
  49.                 ENDM
  50.  
  51. So I can trash the lower word of d5 without any risk of bugs.
  52.  
  53. sub.w d5,d5 will do fine before the loop!
  54.  
  55.  
  56.  
  57. <sb>Ludde - Amiga Demo Coder
  58. <sb>Virtual Reality & Official Be developer
  59. <sb>ludvigp@ifi.uio.no
  60.  
  61.