I am trying to understand the _mm256_testc_pd
, _mm256_testz_pd
, and _mm256_testnzc_pd
intrinsics, and I have a hard time understanding them.
To analyze _mm256_testc_pd
, I have identified the following cases (a
is the first, b
the second __mm256d
argument`):
- If all packed doubles in
b
are > 0, thenZF=1
,CF=1
, except: - If one packed double in each
a
andb
are mutally < 0, thenZF=0
. - If one packed double in each
!a
andb
are mutually < 0, thenCF=0
.
In other words, a value of ZF=1
tells me that either a) b
is entirely positive, or b) that for those doubles in b
that are not positive, there is a matching double in a
that is negative. A value of CF=1
tells me that either c) b
is entirely positive, or d) that for those doubles in b
that are not positive, there is a matching double in in !a
that is negative.
Have I understood this correctly? I am a bit confused by this. What's the point of this check? What would I use these intrinsics for?