int <-> floating point interface and Vc::SimdArray
Sandro Wenzel
[please enable javascript to see the address]
Mon Dec 14 16:22:31 CET 2015
Hi,
I have a question on Vc::SimdArray and whether it could be used to
construct integer types that can convert to double_v.
In other words, consider:
typedef Vc::SimdArray<int, Vc::double_v::Size> I_t;
void bar(int *array) {
I_t x(array);
for(unsigned int i =0;i<I_t::Size;++i){
std::cout << x[i] << "\n";
}
Vc::double_v d(x); // converting from integer to double
std::cout << d << "\n";
// expect output [1,2,3,4] on AVX
// expect output [1,2] on SSE
}
int main(){
int b[8]={1,2,3,4,5,6,7,8};
bar(b);
}
This code is doing what I want on AVX but on SSE, it returns the variable d
as [1,1]; My simple question is whether Vc::SimdArray can be used to make
the handshake between int and double types easier?
Thanks and best
Sandro
--
Dr. Sandro Wenzel
PH / SFT
CERN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://compeng.uni-frankfurt.de/pipermail/vc-devel/attachments/20151214/6a857112/attachment.html>
More information about the Vc-devel
mailing list