Improved handling of splatted constant vectors in C++ backend.

Now, when we're printing out a constant vector value, we check to see
if it's a splat and call out to one of the __splat_* functions in
the generated code if to.
This commit is contained in:
Matt Pharr
2012-04-19 13:11:15 -07:00
parent e4b3d03da5
commit 12c754c92b
3 changed files with 73 additions and 28 deletions

View File

@@ -374,6 +374,11 @@ static FORCEINLINE void __store(__vec16_i1 *p, __vec16_i1 v, int align) {
*ptr = v.v;
}
static FORCEINLINE __vec16_i1 __smear_i1(int v) {
return __vec16_i1(v, v, v, v, v, v, v, v,
v, v, v, v, v, v, v, v);
}
///////////////////////////////////////////////////////////////////////////
// int8

View File

@@ -266,6 +266,10 @@ static FORCEINLINE void __store(__vec4_i1 *p, __vec4_i1 value, int align) {
_mm_storeu_ps((float *)(&p->v), value.v);
}
static FORCEINLINE __vec4_i1 __smear_i1(int v) {
return __vec4_i1(v, v, v, v);
}
///////////////////////////////////////////////////////////////////////////
// int8