Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Celebrities > Elite > Re: Jongware ->...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 14 Topic 1039 of 1103
Post > Topic >>

Re: Jongware -> Building Galaxy Generator in C#

by Marcin Grzegorczyk <mgrzegor@[EMAIL PROTECTED] > Dec 7, 2007 at 10:35 PM

[Jongware] wrote:
> That might be related to the bit-****fting (lrotl, rrotl(?)) in the main 
> generate routine. Older compilers use 16 bit rotations (even in 32 bit 
> mode)

You mean _rotl() and _rotr(), since _lrotl() and _lrotr() work on 
unsigned longs (as their name implies) and are therefore always 32-bit 
rotations (well, as long as you don't have a compiler that uses 64-bit 
longs ;-) ).

> #define SHUFFLEWORD(x,val)   (((x) & 0xffff)<<(val)) | (((x) & 
> 0xffff)>>(16-val))

Actually it should be

#define SHUFFLEWORD(x,val) ((((x)<<(val)) | (((x) & 
0xffff)>>(16-(val)))) & 0xffff)

because the expression ((x) & 0xffff)<<(val)) might still have some bits 
in the upper word set.

But you could just say _rotl instead of SHUFFLEWORD, and then you don't 
have to modify the rest of the source...
well, actually, if there are any spaces between _rotl and the opening 
parenthesis, you have to remove them.
_rotr could be defined in a similar way:

#define _rotr(x,val) (((((x) & 0xffff)>>(val)) | ((x)<<(16-(val)))) & 
0xffff)

-- 
Marcin Grzegorczyk
 




 14 Posts in Topic:
Jongware -> Building Galaxy Generator in C#
MICHAEL.MCALEA@[EMAIL PRO  2007-12-06 17:18:55 
Re: Jongware -> Building Galaxy Generator in C#
"[Jongware]" &l  2007-12-07 17:06:29 
Re: Jongware -> Building Galaxy Generator in C#
Marcin Grzegorczyk <mg  2007-12-07 22:35:30 
Re: Jongware -> Building Galaxy Generator in C#
MICHAEL.MCALEA@[EMAIL PRO  2007-12-09 15:37:54 
Re: Jongware -> Building Galaxy Generator in C#
"[Jongware]" &l  2007-12-10 12:28:30 
Re: Jongware -> Building Galaxy Generator in C#
MICHAEL.MCALEA@[EMAIL PRO  2007-12-10 05:14:56 
Re: Jongware -> Building Galaxy Generator in C#
"[Jongware]" &l  2007-12-10 20:01:56 
Re: Jongware -> Building Galaxy Generator in C#
MICHAEL.MCALEA@[EMAIL PRO  2007-12-11 01:50:32 
Re: Jongware -> Building Galaxy Generator in C#
"[Jongware]" &l  2007-12-11 21:54:48 
Re: Jongware -> Building Galaxy Generator in C#
MICHAEL.MCALEA@[EMAIL PRO  2007-12-12 04:13:19 
Re: Jongware -> Building Galaxy Generator in C#
Marcin Grzegorczyk <mg  2007-12-12 20:09:06 
Re: Jongware -> Building Galaxy Generator in C#
"[Jongware]" &l  2007-12-12 22:33:24 
Re: Jongware -> Building Galaxy Generator in C#
Marcin Grzegorczyk <mg  2007-12-13 00:10:16 
Re: Jongware -> Building Galaxy Generator in C#
stevehodge@[EMAIL PROTECT  2007-12-21 15:54:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 5:40:28 CST 2008.