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

Bitwise help!!!


Postby Digby » Feb 6, 2002 @ 5:36pm

refractor,

OK unless I'm missing something, it's going to take 3 instructions using the code you posted to make certain that a value is within an arbitrary range. Two cycles to handle the upper bound and one to handle clamping to zero.

I suppose if you know from the operations you're performing on the data, you would only need to clamp against one of the bounds. In that case, there's no win in testing up front.

One other thing to mention, in the case of clamping to an aribtrary upper limit (non-pow2), you're going to run into problems if the max value can't be described with 8-bits that are shifted by an arbitrary amount (shifter-operand). It could take another instruction to load the correct immediate data.
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Postby refractor » Feb 6, 2002 @ 10:26pm

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Digby » Feb 6, 2002 @ 11:46pm

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


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