This site is no longer active and is available for archival purposes only. Registration and login is disabled.

number to bitshift


Postby Dan East » Apr 12, 2003 @ 3:57am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Dan East » Apr 12, 2003 @ 4:33am

Ahhh. This code is designed for big-endian processors. I'm testing on x86, which is little-endian. For little endian you can reorder the table, or change the last line to:
return 31-clz_table[n >> 27];

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Digby » Apr 12, 2003 @ 7:30am

Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby Velo » Apr 12, 2003 @ 8:43am

User avatar
Velo
pm Member
 
Posts: 21
Joined: Feb 13, 2003 @ 5:36am
Location: alt.comp.lang.c++.nazi


Postby Sm!rk » Apr 12, 2003 @ 11:40pm

User avatar
Sm!rk
pm Member
 
Posts: 172
Joined: Dec 16, 2002 @ 4:40pm


Postby Dan East » Apr 13, 2003 @ 1:15am

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Digby » Apr 13, 2003 @ 3:06am

Geez, if it's in the config file can't you simply using floating point calcs to come up with your power-of-two divisor instead of all that clz hocus pocus? How often are they setting this value?
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby Velo » Apr 13, 2003 @ 3:08am

User avatar
Velo
pm Member
 
Posts: 21
Joined: Feb 13, 2003 @ 5:36am
Location: alt.comp.lang.c++.nazi


Postby brendan » Apr 13, 2003 @ 9:49am

/me just looks at the posts, jaw dropped..... and thinks to himself "ahh to have the time avaliable in my life again to ponder the affects my lose coding will have on the universe"

;-)
User avatar
brendan
pm Insider
 
Posts: 451
Joined: Oct 23, 2001 @ 2:51am
Location: Hobart, Australia


Previous

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum