File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -449,8 +449,11 @@ namespace xsimd
449449
450450 static batch_type abs (const batch_type& rhs)
451451 {
452- return (__m512d)(_mm512_and_epi64 (_mm512_set1_epi64 (0x7FFFFFFFFFFFFFFF ),
453- (__m512i)((__m512d)(rhs))));
452+ __m512d rhs_asd = (__m512d)rhs;
453+ __m512i rhs_asi = *reinterpret_cast <__m512i*>(&rhs_asd);
454+ __m512i res_asi = _mm512_and_epi64 (_mm512_set1_epi64 (0x7FFFFFFFFFFFFFFF ),
455+ rhs_asi);
456+ return *reinterpret_cast <__m512d*>(&res_asi);
454457 }
455458
456459 static batch_type fabs (const batch_type& rhs)
Original file line number Diff line number Diff line change @@ -472,8 +472,11 @@ namespace xsimd
472472
473473 static batch_type abs (const batch_type& rhs)
474474 {
475- return (__m512)(_mm512_and_epi32 ((__m512i)((__m512)(rhs)),
476- _mm512_set1_epi32 (0x7fffffff )));
475+ __m512 rhs_asf = (__m512)rhs;
476+ __m512i rhs_asi = *reinterpret_cast <__m512i*>(&rhs_asf);
477+ __m512i res_asi = _mm512_and_epi32 (_mm512_set1_epi32 (0x7FFFFFFF ),
478+ rhs_asi);
479+ return *reinterpret_cast <__m512*>(&res_asi);
477480 }
478481
479482 static batch_type fabs (const batch_type& rhs)
You can’t perform that action at this time.
0 commit comments