diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2015-09-06 11:45:20 +0300 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2015-09-18 10:07:13 +0300 |
commit | 8189fad9610981d5b4dcd8f8980ff169110fb33c (patch) | |
tree | ffb96f7d1f5630952410ea7b56498eadff9024ef | |
parent | 6b1b8b2b90da11bf6101a151786b2a8c9f087338 (diff) |
vmx: Remove unused expensive functions
Now that we replaced the expensive functions with better performing
alternatives, we should remove them so they will not be used again.
Running Cairo benchmark on trimmed traces gave the following results:
POWER8, 8 cores, 3.4GHz, RHEL 7.2 ppc64le.
Speedups
========
t-firefox-scrolling 1232.30 -> 1096.55 : 1.12x
t-gnome-terminal-vim 613.86 -> 553.10 : 1.11x
t-evolution 405.54 -> 371.02 : 1.09x
t-firefox-talos-gfx 919.31 -> 862.27 : 1.07x
t-gvim 653.02 -> 616.85 : 1.06x
t-firefox-canvas-alpha 941.29 -> 890.42 : 1.06x
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
-rw-r--r-- | pixman/pixman-vmx.c | 196 |
1 files changed, 0 insertions, 196 deletions
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c index 7ef8bed..3eaa866 100644 --- a/pixman/pixman-vmx.c +++ b/pixman/pixman-vmx.c @@ -35,7 +35,6 @@ #define AVV(x...) {x} -static vector unsigned int mask_00ff; static vector unsigned int mask_ff000000; static vector unsigned int mask_red; static vector unsigned int mask_green; @@ -280,20 +279,6 @@ save_128_aligned (uint32_t* data, } static force_inline vector unsigned int -create_mask_16_128 (uint16_t mask) -{ - uint16_t* src; - vector unsigned short vsrc; - DECLARE_SRC_MASK_VAR; - - src = &mask; - - COMPUTE_SHIFT_MASK (src); - LOAD_VECTOR (src); - return (vector unsigned int) vec_splat(vsrc, 0); -} - -static force_inline vector unsigned int create_mask_1x32_128 (const uint32_t *src) { vector unsigned int vsrc; @@ -311,24 +296,6 @@ create_mask_32_128 (uint32_t mask) } static force_inline vector unsigned int -unpack_32_1x128 (uint32_t data) -{ - vector unsigned int vdata = {0, 0, 0, data}; - vector unsigned short lo; - - lo = (vector unsigned short) -#ifdef WORDS_BIGENDIAN - vec_mergel ((vector unsigned char) AVV(0), - (vector unsigned char) vdata); -#else - vec_mergel ((vector unsigned char) vdata, - (vector unsigned char) AVV(0)); -#endif - - return (vector unsigned int) lo; -} - -static force_inline vector unsigned int unpacklo_128_16x8 (vector unsigned int data1, vector unsigned int data2) { vector unsigned char lo; @@ -437,38 +404,6 @@ unpack_565_to_8888 (vector unsigned int lo) return vec_or (rb, g); } -static force_inline uint32_t -pack_1x128_32 (vector unsigned int data) -{ - vector unsigned char vpack; - - vpack = vec_packsu((vector unsigned short) data, - (vector unsigned short) AVV(0)); - - return vec_extract((vector unsigned int) vpack, 1); -} - -static force_inline vector unsigned int -pack_2x128_128 (vector unsigned int lo, vector unsigned int hi) -{ - vector unsigned char vpack; - - vpack = vec_packsu((vector unsigned short) hi, - (vector unsigned short) lo); - - return (vector unsigned int) vpack; -} - -static force_inline void -negate_2x128 (vector unsigned int data_lo, - vector unsigned int data_hi, - vector unsigned int* neg_lo, - vector unsigned int* neg_hi) -{ - *neg_lo = vec_xor (data_lo, mask_00ff); - *neg_hi = vec_xor (data_hi, mask_00ff); -} - static force_inline int is_opaque (vector unsigned int x) { @@ -499,136 +434,6 @@ is_transparent (vector unsigned int x) return (cmp_result & 0x8888) == 0x8888; } -static force_inline vector unsigned int -expand_pixel_8_1x128 (uint8_t data) -{ - vector unsigned int vdata; - - vdata = unpack_32_1x128 ((uint32_t) data); - -#ifdef WORDS_BIGENDIAN - return vec_perm (vdata, vdata, - (vector unsigned char)AVV ( - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F)); -#else - return vec_perm (vdata, vdata, - (vector unsigned char)AVV ( - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09)); -#endif -} - -static force_inline vector unsigned int -expand_alpha_1x128 (vector unsigned int data) -{ -#ifdef WORDS_BIGENDIAN - return vec_perm (data, data, - (vector unsigned char)AVV ( - 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, - 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09)); -#else - return vec_perm (data, data, - (vector unsigned char)AVV ( - 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, - 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F)); -#endif -} - -static force_inline void -expand_alpha_2x128 (vector unsigned int data_lo, - vector unsigned int data_hi, - vector unsigned int* alpha_lo, - vector unsigned int* alpha_hi) -{ - - *alpha_lo = expand_alpha_1x128(data_lo); - *alpha_hi = expand_alpha_1x128(data_hi); -} - -static force_inline void -expand_alpha_rev_2x128 (vector unsigned int data_lo, - vector unsigned int data_hi, - vector unsigned int* alpha_lo, - vector unsigned int* alpha_hi) -{ -#ifdef WORDS_BIGENDIAN - *alpha_lo = vec_perm (data_lo, data_lo, - (vector unsigned char)AVV ( - 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, - 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F)); - - *alpha_hi = vec_perm (data_hi, data_hi, - (vector unsigned char)AVV ( - 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, - 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F, 0x0E, 0x0F)); -#else - *alpha_lo = vec_perm (data_lo, data_lo, - (vector unsigned char)AVV ( - 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, - 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09)); - - *alpha_hi = vec_perm (data_hi, data_hi, - (vector unsigned char)AVV ( - 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, - 0x08, 0x09, 0x08, 0x09, 0x08, 0x09, 0x08, 0x09)); -#endif -} - -static force_inline void -pix_multiply_2x128 (vector unsigned int* data_lo, - vector unsigned int* data_hi, - vector unsigned int* alpha_lo, - vector unsigned int* alpha_hi, - vector unsigned int* ret_lo, - vector unsigned int* ret_hi) -{ - *ret_lo = pix_multiply(*data_lo, *alpha_lo); - *ret_hi = pix_multiply(*data_hi, *alpha_hi); -} - -static force_inline void -over_2x128 (vector unsigned int* src_lo, - vector unsigned int* src_hi, - vector unsigned int* alpha_lo, - vector unsigned int* alpha_hi, - vector unsigned int* dst_lo, - vector unsigned int* dst_hi) -{ - vector unsigned int t1, t2; - - negate_2x128 (*alpha_lo, *alpha_hi, &t1, &t2); - - pix_multiply_2x128 (dst_lo, dst_hi, &t1, &t2, dst_lo, dst_hi); - - *dst_lo = (vector unsigned int) - vec_adds ((vector unsigned char) *src_lo, - (vector unsigned char) *dst_lo); - - *dst_hi = (vector unsigned int) - vec_adds ((vector unsigned char) *src_hi, - (vector unsigned char) *dst_hi); -} - -static force_inline void -in_over_2x128 (vector unsigned int* src_lo, - vector unsigned int* src_hi, - vector unsigned int* alpha_lo, - vector unsigned int* alpha_hi, - vector unsigned int* mask_lo, - vector unsigned int* mask_hi, - vector unsigned int* dst_lo, - vector unsigned int* dst_hi) -{ - vector unsigned int s_lo, s_hi; - vector unsigned int a_lo, a_hi; - - pix_multiply_2x128 (src_lo, src_hi, mask_lo, mask_hi, &s_lo, &s_hi); - pix_multiply_2x128 (alpha_lo, alpha_hi, mask_lo, mask_hi, &a_lo, &a_hi); - - over_2x128 (&s_lo, &s_hi, &a_lo, &a_hi, dst_lo, dst_hi); -} - static force_inline uint32_t core_combine_over_u_pixel_vmx (uint32_t src, uint32_t dst) { @@ -3259,7 +3064,6 @@ _pixman_implementation_create_vmx (pixman_implementation_t *fallback) pixman_implementation_t *imp = _pixman_implementation_create (fallback, vmx_fast_paths); /* VMX constants */ - mask_00ff = create_mask_16_128 (0x00ff); mask_ff000000 = create_mask_32_128 (0xff000000); mask_red = create_mask_32_128 (0x00f80000); mask_green = create_mask_32_128 (0x0000fc00); |