Subject: Re: [linux-audio-dev] swh plugins and fixing undenormalize
From: Simon Jenkins (sjenkins_AT_blueyonder.co.uk)
Date: Sun Jun 27 2004 - 18:18:25 EEST
Tim Goetze wrote:
>[Simon Jenkins]
>
>
>>Tim Goetze wrote:
>>
>>
>>>8-bit exponent and no assumption about its value made, 8 binary
>>>'shift', 7 'or' and 1 'and' statement if i'm not badly mistaken. and
>>>if i'm not, a branch will probably hurt less.
>>>
>>>
>>>
>>Three shifts, three copys, three 'or's and an 'and':
>>
>> copy = value;
>> value |= copy >> 4;
>> copy = value;
>> value |= copy >> 2;
>> copy = value;
>> value |= copy >> 1;
>> value &= 0x01;
>>
>>
>
>elegant indeed (though the exponent is not in the lowest 8 bits so it
>needs another shift, no?)
>
Yes it does. And another copy of value because the one you start out with
gets destroyed. And the result, when its 1, is the integer 1 not the
float 1.0
so you either need to (...etc etc).
This archive was generated by hypermail 2b28 : Sun Jun 27 2004 - 17:03:34 EEST