Tristate - wanna?

Timon Gehr timon.gehr at gmx.ch
Wed Oct 30 14:49:00 PDT 2013


On 10/30/2013 04:43 PM, Lionello Lunesu wrote:
> On 10/27/13, 11:07, Timon Gehr wrote:
>> On 10/27/2013 02:11 AM, Andrei Alexandrescu wrote:
>>> On 10/26/13 5:13 PM, Timon Gehr wrote:
>>>> The following implementation does not use conditionals; probably
>>>> not minimal.
>>>
>>> ...
>
> Couldn't this be optimized further, by doubling the constants?
>
> (A>>(a+b)&3)<<1 ==> A2>>(a+b)&6 ?

It seems so. I am astonished that the compilers don't seem to figure 
this out on their own. It seems basic enough.


More information about the Digitalmars-d mailing list