Vector Class Discussion

thread segmentation fault by _mm256_round_pd - Bui Quang Minh - 2015-11-26
last reply segmentation fault by _mm256_round_pd - Agner - 2015-11-26
segmentation fault by _mm256_round_pd
Author:  Date: 2015-11-26 15:50
Dear Agner,

I was using vectorclass a lot, thanks for the great library! Recently I observed a segmentation fault in Windows AVX, which I could track down to this code:

static inline Vec4d round(Vec4d const & a) {
return _mm256_round_pd(a, 0);


Then I looked up what this _mm256_round_pd does, and came across this web site:

Apparently the 2nd parameter can only be 0x0A and 0x09 according to this description. Could it be due to this problem?

Interestingly my code only crashed in Windows but not Mac OS X or Linux.

Thanks for looking into this


segmentation fault by _mm256_round_pd
Author: Agner Date: 2015-11-26 23:18
Apparently, you have precision exception enabled for some reason. You can fix the problem by setting rounding mode to 8:
return _mm256_round_pd(a, 8);
I will do this in version 1.20 of vectorclass

The document you are referring to is wrong. You can find the complete description of rounding modes in "Intel® 64 and IA-32 Architectures Software Developer’s Manual" under ROUNDPD or in