Subject: Re: [boost] [GSOC]SIMD Library
From: falcou (Joel.Falcou_at_[hidden])
Date: 2011-03-31 01:31:18


On Wed, 30 Mar 2011 16:46:30 -0700, Cory Nelson <phrosty_at_[hidden]> wrote:

> It would be useful if the types chose their instruction set by policy.
>
> template<typename Policy>
> void go(float *f)
> {
> typedef vec4<float, Policy> vec;
> ...
> }
>
> void (*go_ptr)(float*) = go<x87>;
>
> if(supports_sse) go_ptr = go<sse2>;
>
> It would let us handle our own multiple-instruction-sets-in-one-binary
> needs at whatever level we deem best.

cant be easily added at this level. However, the underlying functor system
maybe able to have you write:

simd::functor<some_func, sse2_> f2;
simd::functor<some_func, sse3_> f3;

boost::function<proper prototype> current_f = has_sse3 ? f3 : f2;

The main problem is that i am not sure it wont crap out at compile time
due to improper intrinsic being used.