home *** CD-ROM | disk | FTP | other *** search
- Path: doc.ic.ac.uk!not-for-mail
- From: mdf@doc.ic.ac.uk (Martin Frost)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: x ^= y ^= x ^= y;
- Date: 23 Feb 1996 16:47:08 -0000
- Organization: Dept. of Computing, Imperial College, University of London, UK.
- Distribution: world
- Message-ID: <4gkr2c$ica@oak44.doc.ic.ac.uk>
- References: <1286.6624T1439T237@cs.ruu.nl>
- Reply-To: mdf@doc.ic.ac.uk (Martin Frost)
- NNTP-Posting-Host: oak44.doc.ic.ac.uk
- X-Newsreader: mxrn 6.18-23
-
-
- In article <1286.6624T1439T237@cs.ruu.nl>, wsldanke@cs.ruu.nl (Wessel Dankers) writes:
- > a) are these routines efficient for integers? (probably not)
-
- I don't see why not. Most compilers I know of treat all values as unsiogned
- when using bitwise operations.
-
- > b) is this x ^= y ^= x ^= y; method usable with the blitter?
- > It would be possible to swap two memory locations with no
- > extra memory required in three Blit calls. Is the blitter
- > equally fast with copying as with XOR'ing?
-
- It works, but is not very fast. The blitter takes 4 cycles for a copy and
- 6 for a 2 source operation like XOR. Best is to use a temporary buffer for
- one line only and swap the data a line at a time. This is quite efficient
- in terms of memory, and the modulo registers can be precalculated beforehand,
- so there is very little overhead.
-
- Martin
-