summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavard Eidnes <he@NetBSD.org>2023-08-30 12:09:23 -0400
committerMatt Turner <mattst88@gmail.com>2023-08-30 12:14:40 -0400
commit47a1c3d330cc7ea6ba2fa96eb288f4b2291d011c (patch)
tree0b69e4db9f697e95016be8ab3f2cbd8396b0d051
parent634b8196d2ebc1b78adfc3cecca8efa80bb30f7f (diff)
vmx: Reimplement create_mask_32_128 and use it in vmx_fill
Based on suggestion from @siamashka. This lets the compiler pick the vector instruction to use which is usually the best idea. Use create_mask_32_128() instead of create_mask_1x32_128() in vmx_fill(), avoiding loading memory beyond the filler argument on the stack. Remove the now-unused create_mask_1x32_128(). This gets rid of some (correct) warnings from the compiler about indexing beyond the variable in question.
-rw-r--r--pixman/pixman-vmx.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index ab1250c..d4b5dc8 100644
--- a/pixman/pixman-vmx.c
+++ b/pixman/pixman-vmx.c
@@ -279,20 +279,9 @@ save_128_aligned (uint32_t* data,
}
static force_inline vector unsigned int
-create_mask_1x32_128 (const uint32_t *src)
-{
- vector unsigned int vsrc;
- DECLARE_SRC_MASK_VAR;
-
- COMPUTE_SHIFT_MASK (src);
- LOAD_VECTOR (src);
- return vec_splat(vsrc, 0);
-}
-
-static force_inline vector unsigned int
create_mask_32_128 (uint32_t mask)
{
- return create_mask_1x32_128(&mask);
+ return (vector unsigned int) {mask, mask, mask, mask};
}
static force_inline vector unsigned int
@@ -2471,7 +2460,7 @@ vmx_fill (pixman_implementation_t *imp,
return FALSE;
}
- vfiller = create_mask_1x32_128(&filler);
+ vfiller = create_mask_32_128(filler);
while (height--)
{