pixman: Branch 'master' - 2 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Aug 30 17:47:48 UTC 2023
pixman/pixman-vmx.c | 33 ++++++++-------------------------
1 file changed, 8 insertions(+), 25 deletions(-)
New commits:
commit 47a1c3d330cc7ea6ba2fa96eb288f4b2291d011c
Author: Havard Eidnes <he at NetBSD.org>
Date: Wed Aug 30 12:09:23 2023 -0400
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.
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
@@ -278,21 +278,10 @@ save_128_aligned (uint32_t* data,
STORE_VECTOR(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--)
{
commit 634b8196d2ebc1b78adfc3cecca8efa80bb30f7f
Author: Havard Eidnes <he at NetBSD.org>
Date: Wed Aug 30 12:09:29 2023 -0400
vmx: Simplify scaled_nearest_scanline_vmx_8888_8888_OVER
Since combine4() does not take vector variables as arguments, there's no
need to use a vector variable and casts back and forth to normal scalars
for the arguments.
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index 1086b28..ab1250c 100644
--- a/pixman/pixman-vmx.c
+++ b/pixman/pixman-vmx.c
@@ -2913,32 +2913,26 @@ scaled_nearest_scanline_vmx_8888_8888_OVER (uint32_t* pd,
while (w >= 4)
{
- vector unsigned int tmp;
- uint32_t tmp1, tmp2, tmp3, tmp4;
+ uint32_t tmp[4];
- tmp1 = *(ps + pixman_fixed_to_int (vx));
+ tmp[0] = *(ps + pixman_fixed_to_int (vx));
vx += unit_x;
while (vx >= 0)
vx -= src_width_fixed;
- tmp2 = *(ps + pixman_fixed_to_int (vx));
+ tmp[1] = *(ps + pixman_fixed_to_int (vx));
vx += unit_x;
while (vx >= 0)
vx -= src_width_fixed;
- tmp3 = *(ps + pixman_fixed_to_int (vx));
+ tmp[2] = *(ps + pixman_fixed_to_int (vx));
vx += unit_x;
while (vx >= 0)
vx -= src_width_fixed;
- tmp4 = *(ps + pixman_fixed_to_int (vx));
+ tmp[3] = *(ps + pixman_fixed_to_int (vx));
vx += unit_x;
while (vx >= 0)
vx -= src_width_fixed;
- tmp[0] = tmp1;
- tmp[1] = tmp2;
- tmp[2] = tmp3;
- tmp[3] = tmp4;
-
- vsrc = combine4 ((const uint32_t *) &tmp, pm);
+ vsrc = combine4 (tmp, pm);
if (is_opaque (vsrc))
{
More information about the xorg-commit
mailing list