From: Skybuck Flying on
Ok,

I just checked it...

Content shl 64 will be executed by this branch !:

> 00404D42 31D2 xor edx,edx
> 00404D44 31C0 xor eax,eax
> 00404D46 C3 ret

^ The developers of Delphi just got some major love points from me ! =D

I think this will solve all of my problems for now ! ;) :)

Bye,
Skybuck =D


From: Skybuck Flying on
Wow good thing I tested it...

Shifting "contents" has to be done slightly different than shifting "masks".

Content needs to be shifted as follows:

Content shl (mBitCount-1)

Proof: when bitcount is exactly 1 bit, no shift should happen this it should
be shift 0, thus minus -1.

However for the mask the opposite needs to be happen:

not ($FFFFFFFFetc shl mBitCount);

if the bitcount is 1 then the mask needs to shift up 1 place to make room
for a zero, which will then be converted to a 1.

That's kinda funny... little inconsistency here...

I wonder if the mask calculation can be slightly altered to make it more
consistent with the content...

Perhaps ($FFFFFFFF-1) might do the trick...

Then it could be written as:

not (($FFFFFFFF-1) shl (mBitCount-1))

This could be handy to "recycle" mBitCount-1 calculation by storing it in a
variable or so...

Hmmm...

Tricky stuff as usual ;) :)

Bye,
Skybck =D


From: Skybuck Flying on
Oh my god !

I think Delphi just showed me the light/the solution/the way !!! =D

Another method WOOOOOWWW this just doesn't stop ever/never! OH YEAH gooooddd
stuff ! ;) =D

Method 9:

Mask := not (-1 shl BitCount);

^^^ Awesomeness ^^^ ! =D

Now I go test it ! ;) =D

Bye,
Skybuck =D


From: Skybuck Flying on

"Skybuck Flying" <IntoTheFuture(a)hotmail.com> wrote in message
news:71434$4bfe2737$54190f09$18448(a)cache4.tilbu1.nb.home.nl...
> Oh my god !
>
> I think Delphi just showed me the light/the solution/the way !!! =D
>
> Another method WOOOOOWWW this just doesn't stop ever/never! OH YEAH
> gooooddd stuff ! ;) =D
>
> Method 9:
>
> Mask := not (-1 shl BitCount);
>
> ^^^ Awesomeness ^^^ ! =D
>
> Now I go test it ! ;) =D

Hmm very nice... seems to work just nicely for 16 bits... also signed
integers tested, seems to work as well...

For unsigned version not even typecasts needed it seems...

The int64 version will probably work as well...

Pretty nice.

Bye,
Skybuck.


From: Skybuck Flying on

"Seebs" <usenet-nospam(a)seebs.net> wrote in message
news:slrnhvrj4m.4f0.usenet-nospam(a)guild.seebs.net...
> On 2010-05-27, Skybuck Flying <IntoTheFuture(a)hotmail.com> wrote:
>> Question is what happens when "shl 32" is done.
>
> *sigh*
>
>> According to the intel manual the result would be undefined ?!?
>
> Yes.
>
>> Does that mean the result could be garbage ???
>
> Tell you what. Try posting this coherently with a reasonable amount of
> punctuation, and I'll totally point out that the word "undefined" is
> completely unambiguous, since apparently this is not obvious enough.

Yeah but maybe that documentation is old...

And maybe intel/amd have secretly fixed the problem by now ?! ;) :)

Bye,
Skybuck.