Improvements to mask update code for generic targets.

Rather than XOR'ing with a temporary 'all-on' vector, we call
__not.  Also, we call out to __and_not1 and __and_not2, for an
AND where the first or second operand, respectively, has had
NOT applied to it.
This commit is contained in:
Matt Pharr
2012-05-16 13:52:42 -07:00
parent 625fbef613
commit f4df2fb176
2 changed files with 171 additions and 2 deletions

View File

@@ -339,6 +339,24 @@ static FORCEINLINE __vec16_i1 __or(__vec16_i1 a, __vec16_i1 b) {
return r;
}
static FORCEINLINE __vec16_i1 __not(__vec16_i1 v) {
__vec16_i1 r;
r.v = ~v.v;
return r;
}
static FORCEINLINE __vec16_i1 __and_not1(__vec16_i1 a, __vec16_i1 b) {
__vec16_i1 r;
r.v = ~a.v & b.v;
return r;
}
static FORCEINLINE __vec16_i1 __and_not2(__vec16_i1 a, __vec16_i1 b) {
__vec16_i1 r;
r.v = a.v & ~b.v;
return r;
}
static FORCEINLINE __vec16_i1 __select(__vec16_i1 mask, __vec16_i1 a,
__vec16_i1 b) {
__vec16_i1 r;
@@ -379,6 +397,7 @@ static FORCEINLINE __vec16_i1 __smear_i1(__vec16_i1, int v) {
v, v, v, v, v, v, v, v);
}
///////////////////////////////////////////////////////////////////////////
// int8