Lyubomir, Thanks for reporting this back! I'm glad to see that it's fixed for you.
Dmitry. On Mon, Apr 22, 2019 at 1:11 PM Lyubomir Kozlovski < lyubomirkozlov...@gmail.com> wrote: > Forgot to report it on github but I just upgraded to 1.11 and there's > already a huge improvement, good job! > > It's now generating SSE stores instead of scalar ones. > For anyone interested you can try it out on https://godbolt.org/ using > flags [ --target=avx2 -O2 --opt=fast-math ] and this simple testcase: > > export void test_interleaved(const uniform float xin[] > , const uniform float yin[], const uniform float zin[] > , uniform int data[]) > { > const uniform unsigned int count = 256; > foreach (i = 0 ... count) > { > int data0 = (2 * xin[i] + 3 * yin[i] + 2 * zin[i]) / 7.0f; > int data1 = (xin[i] + yin[i] + zin[i]) / 3.0f; > *(data + 2 * i + 0) = data0; > *(data + 2 * i + 1) = data1; > } > } > > Just switch between 1.10 and 1.11 and see the magic :) > > > On Tue, Apr 9, 2019 at 7:57 PM Dmitry Babokin <babo...@gmail.com> wrote: > >> There are two options - (1) file a bug and wait until we fix it. It's >> generally compiler responsibility to do this optimization. It's actually >> was implemented at some point, but it doesn't work in most of the cases and >> we are planning to fix it. So one more test case and and a reminder in the >> bug tracker is always good. >> >> And options (2) try to use shuffle() intrinsics to specify the desired >> behaviour. >> >> Dmitry. >> >> On Tue, Apr 9, 2019 at 7:31 AM Lyubomir Kozlovski < >> lyubomirkozlov...@gmail.com> wrote: >> >>> I'm computing 2 floats per lane and want to store them interleaved, like >>> so: >>> >>> foreach (i = 0 ... _n) >>> { >>> // do some work to compute data0, data1... >>> >>> *(_b->m_data + 2 * i + 0) = data0; >>> *(_b->m_data + 2 * i + 1) = data1; >>> } >>> >>> Resulting in a scatter. >>> >>> Using C++ vector intrinsics (_mm256_unpacklo_ps, _mm256_unpackhi_ps, 2x >>> _mm256_permute2f128_ps) I can interleave data0 and data1 and generate >>> vector stores. >>> >>> Is there a way to do this in ISPC? >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Intel SPMD Program Compiler Users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to ispc-users+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Intel SPMD Program Compiler Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to ispc-users+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Intel SPMD Program Compiler Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ispc-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Intel SPMD Program Compiler Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to ispc-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.