diff options
author | Matt Turner <mattst88@gmail.com> | 2012-05-20 20:51:08 -0400 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2012-07-01 16:34:14 -0400 |
commit | 1ad6ae6ee8a350f6fe4f30ba928aacf44d04f86e (patch) | |
tree | 98d9a59ac17f4fe0b31b426623b6125af3d19413 | |
parent | c43de364cbcd195f7d1d6881a6109cbb3d6b73b8 (diff) |
mmx: add scaled bilinear over_8888_8_8888
Loongson:
image firefox-fishtank 1665.163 1670.370 0.17% 3/3
image firefox-fishtank 1037.738 1040.218 0.19% 3/3
ARM/iwMMXt:
image firefox-fishtank 2042.723 2045.308 0.10% 3/3
image firefox-fishtank 1487.282 1492.640 0.17% 3/3
-rw-r--r-- | pixman/pixman-mmx.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index bf66a63..0c79f3a 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c | |||
@@ -3567,6 +3567,12 @@ do { \ | |||
3567 | pix = lo; \ | 3567 | pix = lo; \ |
3568 | } while (0) | 3568 | } while (0) |
3569 | 3569 | ||
3570 | #define BILINEAR_SKIP_ONE_PIXEL() \ | ||
3571 | do { \ | ||
3572 | vx += unit_x; \ | ||
3573 | mm_x = _mm_add_pi16 (mm_x, mm_ux); \ | ||
3574 | } while(0) | ||
3575 | |||
3570 | static force_inline void | 3576 | static force_inline void |
3571 | scaled_bilinear_scanline_mmx_8888_8888_SRC (uint32_t * dst, | 3577 | scaled_bilinear_scanline_mmx_8888_8888_SRC (uint32_t * dst, |
3572 | const uint32_t * mask, | 3578 | const uint32_t * mask, |
@@ -3659,6 +3665,79 @@ FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8888_normal_OVER, | |||
3659 | scaled_bilinear_scanline_mmx_8888_8888_OVER, | 3665 | scaled_bilinear_scanline_mmx_8888_8888_OVER, |
3660 | uint32_t, uint32_t, uint32_t, | 3666 | uint32_t, uint32_t, uint32_t, |
3661 | NORMAL, FLAG_NONE) | 3667 | NORMAL, FLAG_NONE) |
3668 | |||
3669 | static force_inline void | ||
3670 | scaled_bilinear_scanline_mmx_8888_8_8888_OVER (uint32_t * dst, | ||
3671 | const uint8_t * mask, | ||
3672 | const uint32_t * src_top, | ||
3673 | const uint32_t * src_bottom, | ||
3674 | int32_t w, | ||
3675 | int wt, | ||
3676 | int wb, | ||
3677 | pixman_fixed_t vx, | ||
3678 | pixman_fixed_t unit_x, | ||
3679 | pixman_fixed_t max_vx, | ||
3680 | pixman_bool_t zero_src) | ||
3681 | { | ||
3682 | BILINEAR_DECLARE_VARIABLES; | ||
3683 | __m64 pix1, pix2; | ||
3684 | uint32_t m; | ||
3685 | |||
3686 | while (w) | ||
3687 | { | ||
3688 | m = (uint32_t) *mask++; | ||
3689 | |||
3690 | if (m) | ||
3691 | { | ||
3692 | BILINEAR_INTERPOLATE_ONE_PIXEL (pix1); | ||
3693 | |||
3694 | if (m == 0xff && is_opaque (pix1)) | ||
3695 | { | ||
3696 | store (dst, pix1); | ||
3697 | } | ||
3698 | else | ||
3699 | { | ||
3700 | __m64 ms, md, ma, msa; | ||
3701 | |||
3702 | pix2 = load (dst); | ||
3703 | ma = expand_alpha_rev (to_m64 (m)); | ||
3704 | ms = _mm_unpacklo_pi8 (pix1, _mm_setzero_si64 ()); | ||
3705 | md = _mm_unpacklo_pi8 (pix2, _mm_setzero_si64 ()); | ||
3706 | |||
3707 | msa = expand_alpha (ms); | ||
3708 | |||
3709 | store8888 (dst, (in_over (ms, msa, ma, md))); | ||
3710 | } | ||
3711 | } | ||
3712 | else | ||
3713 | { | ||
3714 | BILINEAR_SKIP_ONE_PIXEL (); | ||
3715 | } | ||
3716 | |||
3717 | w--; | ||
3718 | dst++; | ||
3719 | } | ||
3720 | |||
3721 | _mm_empty (); | ||
3722 | } | ||
3723 | |||
3724 | FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8_8888_cover_OVER, | ||
3725 | scaled_bilinear_scanline_mmx_8888_8_8888_OVER, | ||
3726 | uint32_t, uint8_t, uint32_t, | ||
3727 | COVER, FLAG_HAVE_NON_SOLID_MASK) | ||
3728 | FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8_8888_pad_OVER, | ||
3729 | scaled_bilinear_scanline_mmx_8888_8_8888_OVER, | ||
3730 | uint32_t, uint8_t, uint32_t, | ||
3731 | PAD, FLAG_HAVE_NON_SOLID_MASK) | ||
3732 | FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8_8888_none_OVER, | ||
3733 | scaled_bilinear_scanline_mmx_8888_8_8888_OVER, | ||
3734 | uint32_t, uint8_t, uint32_t, | ||
3735 | NONE, FLAG_HAVE_NON_SOLID_MASK) | ||
3736 | FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8_8888_normal_OVER, | ||
3737 | scaled_bilinear_scanline_mmx_8888_8_8888_OVER, | ||
3738 | uint32_t, uint8_t, uint32_t, | ||
3739 | NORMAL, FLAG_HAVE_NON_SOLID_MASK) | ||
3740 | |||
3662 | static uint32_t * | 3741 | static uint32_t * |
3663 | mmx_fetch_x8r8g8b8 (pixman_iter_t *iter, const uint32_t *mask) | 3742 | mmx_fetch_x8r8g8b8 (pixman_iter_t *iter, const uint32_t *mask) |
3664 | { | 3743 | { |
@@ -3926,6 +4005,11 @@ static const pixman_fast_path_t mmx_fast_paths[] = | |||
3926 | SIMPLE_BILINEAR_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, mmx_8888_8888 ), | 4005 | SIMPLE_BILINEAR_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, mmx_8888_8888 ), |
3927 | SIMPLE_BILINEAR_FAST_PATH (OVER, a8b8g8r8, a8b8g8r8, mmx_8888_8888 ), | 4006 | SIMPLE_BILINEAR_FAST_PATH (OVER, a8b8g8r8, a8b8g8r8, mmx_8888_8888 ), |
3928 | 4007 | ||
4008 | SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8r8g8b8, x8r8g8b8, mmx_8888_8_8888 ), | ||
4009 | SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8b8g8r8, x8b8g8r8, mmx_8888_8_8888 ), | ||
4010 | SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, mmx_8888_8_8888 ), | ||
4011 | SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8b8g8r8, a8b8g8r8, mmx_8888_8_8888 ), | ||
4012 | |||
3929 | { PIXMAN_OP_NONE }, | 4013 | { PIXMAN_OP_NONE }, |
3930 | }; | 4014 | }; |
3931 | 4015 | ||