Boost logo

Boost :

Subject: Re: [boost] How to structurate libraries ?
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2009-01-19 03:47:29


Mathias Gaunard a écrit :
> How are you supposed to code in a portable way?
>
> If I write
> vec<float> = {5., 5., 5., 5.};
>
> the code will only compile if the SIMD register is 4 floats big on that
> architecture (as you said yourself).
>
> If it was
> vec<float, 4> = {5., 5., 5., 5.};
> the library could actually fallback to something else to make the code
> work...

Fact is that there is no SIMD extension with less than 4 float per
register and all upcoming ones go with more than that. In this case, if
your float vector ends up having 8 element, it will jus follow the rule
of the {} consructor and fill the rest with 0.

I can see the problem however and maybe this notation should be removed
in favor of a make_vector function.


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