| 
      
      
      From: Conrad W. <we...@on...> - 2003-01-05 12:53:59
      
     | 
| >CodeWarrior 6 can't compile ZStream_MD5.cpp.  I don't think this is an
>error in 
>the source code.  I think that the code is correct but complex enough
that it 
>gives the compiler fits.
I updated to the latest cvs code and I now also get this problem under
both CW Pro 7 and Pro 8.3 as opposed to an older version I had that did
not cause compiler problems.
New version: ZStream_MD5.cpp,v 1.4 2002/08/22
Old version: ZStream_MD5.cpp,v 1.2 2002/03/15
After studying preprocesser and disassembly outputs, the answer is simple:
The MD5STEP1 macro changed and among other it now contains an inline
assembly function:
inline int32 ZByteSwap_Read32(register const void* inValueAddress)
	{
	  register int32 result;
	  asm
		  {
		      lwbrx result, r0, inValueAddress
		  }
	  
    return result;
	}
Note that for the lwbrx instruction, result and inValueAddress *must* be
registers. Because this is inlined in the MD5STEP1 macro, for every
substitution of ZByteSwap_Read32 *two* registers will be required. After
8 consecutive uses of the macro, the ppc chip runs out of registers....
This is because for *every* inlined ZByteSwap_Read32, both inValueAddress
and result are essensially unique labels.
A quick fix is to not make the byte swap function inline, but that is
obviously less efficient and not what I think is wanted. A Bit more
assembly magic is required.
Cheers,
Conrad Weyns.
>
>When I try to compile it while running on OS 9.2, CodeWarrior complains
>that it 
>doesn't have enough registers to compile.  If I try to compile it while
>running 
>OS X, CodeWarrior unexpectedly quits.
>
>I need a hash for something that I'm doing, but happily there is also 
>ZStream_SHA1.cpp, which should work fine for me.
>
>Mike
>-- 
>Michael D. Crawford
>GoingWare Inc. - Expert Software Development and Consulting
>http://www.goingware.com/
>cra...@go...
>
>      Tilting at Windmills for a Better Tomorrow.
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>ZooLib-dev mailing list
>Zoo...@li...
>https://lists.sourceforge.net/lists/listinfo/zoolib-dev
>
>
 |