Boost logo

Boost :

Subject: Re: [boost] non-branching min()
From: DE (satan66613_at_[hidden])
Date: 2009-09-14 12:55:35


on 11.09.2009 at 4:39
 Topher Cooper wrote :
> You might find some sections of Sean Aaron Anderson's "Bit-Twiddling
> Hacks" of interest, though perhaps not of practical use. Check out:
> Compute the minimum (min) or maximum (max) of two integers without
> branching
> <http://graphics.stanford.edu/%7Eseander/bithacks.html#IntegerMinOrMax>
tried this
work equally good (or bad) with icc and msvc but worse than best cases
so i guess it's not worth of it because we want to get all or nothing
in the end i think that one should use ?: implementation and hope the
compilers' and processors' vendors will handle it efficiently

-- 
Pavel

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk