diff options
author | David Schleef <ds@schleef.org> | 2010-08-19 15:15:34 -0700 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2011-05-17 10:25:34 -0700 |
commit | 759a890de8c29caa3bbb57ea60d114981d1371e5 (patch) | |
tree | 1cb6cac7c42203d2faa98f75a621612e67c03bf0 | |
parent | da2053bd56dd6d183a09bdda13804ceebccac5aa (diff) |
Update for splatw0q->splatw3q change
-rw-r--r-- | pixman/pixman-orc.c | 53 | ||||
-rw-r--r-- | pixman/pixman-orccode.orc | 91 | ||||
-rw-r--r-- | test/Makefile.am | 7 |
3 files changed, 120 insertions, 31 deletions
diff --git a/pixman/pixman-orc.c b/pixman/pixman-orc.c index 6a1da67..df00568 100644 --- a/pixman/pixman-orc.c +++ b/pixman/pixman-orc.c @@ -268,8 +268,10 @@ orc_composite_add_8888_8888 (pixman_implementation_t *imp, int32_t width, int32_t height) { - uint32_t *src, *src_line; - uint32_t *dst, *dst_line; + //uint32_t *src, *src_line; + //uint32_t *dst, *dst_line; + uint32_t *src_line; + uint32_t *dst_line; int src_stride, dst_stride; PIXMAN_IMAGE_GET_LINE ( @@ -277,6 +279,9 @@ orc_composite_add_8888_8888 (pixman_implementation_t *imp, PIXMAN_IMAGE_GET_LINE ( src_image, src_x, src_y, uint32_t, src_stride, src_line, 1); + orc_composite_add_8888_8888_2d (dst_line, dst_stride * sizeof(uint32_t), + src_line, src_stride * sizeof(uint32_t), width, height); +#if 0 while (height--) { src = src_line; src_line += src_stride; @@ -285,6 +290,7 @@ orc_composite_add_8888_8888 (pixman_implementation_t *imp, orc_composite_add_8888_8888_line (dst, src, width); } +#endif } @@ -398,6 +404,39 @@ orc_composite_over_8888_8_8888 (pixman_implementation_t *imp, } } +static void +orc_composite_over_n_8888_8888_ca (pixman_implementation_t *imp, + pixman_op_t op, + pixman_image_t * src_image, + pixman_image_t * mask_image, + pixman_image_t * dst_image, + int32_t src_x, + int32_t src_y, + int32_t mask_x, + int32_t mask_y, + int32_t dest_x, + int32_t dest_y, + int32_t width, + int32_t height) +{ + uint32_t *dst_line; + uint32_t *mask_line; + int dst_stride, mask_stride; + uint32_t src; + + src = _pixman_image_get_solid (src_image, dst_image->bits.format); + + if (src == 0) return; + + PIXMAN_IMAGE_GET_LINE ( + dst_image, dest_x, dest_y, uint32_t, dst_stride, dst_line, 1); + PIXMAN_IMAGE_GET_LINE ( + mask_image, mask_x, mask_y, uint32_t, mask_stride, mask_line, 1); + + orc_composite_over_n_8888_8888_ca_2d (dst_line, + dst_stride * sizeof(uint32_t), mask_line, + mask_stride * sizeof(uint32_t), src, width, height); +} static const pixman_fast_path_t orc_fast_paths[] = @@ -437,10 +476,12 @@ static const pixman_fast_path_t orc_fast_paths[] = PIXMAN_STD_FAST_PATH( OVER, a8r8g8b8, solid, x8r8g8b8, orc_composite_over_8888_n_8888 ), PIXMAN_STD_FAST_PATH( OVER, a8b8g8r8, solid, a8b8g8r8, orc_composite_over_8888_n_8888 ), PIXMAN_STD_FAST_PATH( OVER, a8b8g8r8, solid, x8b8g8r8, orc_composite_over_8888_n_8888 ), - PIXMAN_STD_FAST_PATH( OVER, solid, a8r8g8b8_ca, a8r8g8b8, orc_composite_over_n_8888_8888_ca ), - PIXMAN_STD_FAST_PATH( OVER, solid, a8r8g8b8_ca, x8r8g8b8, orc_composite_over_n_8888_8888_ca ), - PIXMAN_STD_FAST_PATH( OVER, solid, a8b8g8r8_ca, a8b8g8r8, orc_composite_over_n_8888_8888_ca ), - PIXMAN_STD_FAST_PATH( OVER, solid, a8b8g8r8_ca, x8b8g8r8, orc_composite_over_n_8888_8888_ca ), +#endif + PIXMAN_STD_FAST_PATH_CA( OVER, solid, a8r8g8b8, a8r8g8b8, orc_composite_over_n_8888_8888_ca ), + PIXMAN_STD_FAST_PATH_CA( OVER, solid, a8r8g8b8, x8r8g8b8, orc_composite_over_n_8888_8888_ca ), + PIXMAN_STD_FAST_PATH_CA( OVER, solid, a8b8g8r8, a8b8g8r8, orc_composite_over_n_8888_8888_ca ), + PIXMAN_STD_FAST_PATH_CA( OVER, solid, a8b8g8r8, x8b8g8r8, orc_composite_over_n_8888_8888_ca ), +#if 0 PIXMAN_STD_FAST_PATH( OVER, solid, a8r8g8b8_ca, r5g6b5, orc_composite_over_n_8888_0565_ca ), PIXMAN_STD_FAST_PATH( OVER, solid, a8b8g8r8_ca, b5g6r5, orc_composite_over_n_8888_0565_ca ), PIXMAN_STD_FAST_PATH( OVER, pixbuf, pixbuf, a8r8g8b8, orc_composite_over_pixbuf_8888 ), diff --git a/pixman/pixman-orccode.orc b/pixman/pixman-orccode.orc index d39c9a8..beec52c 100644 --- a/pixman/pixman-orccode.orc +++ b/pixman/pixman-orccode.orc @@ -46,7 +46,16 @@ copyw d1, s1 copyl d1, s1 -.function orc_composite_add_8888_8888_line +.function orc_copy_u8_2d +.dest 1 d1 +.source 1 s1 +.flags 2d + +copyb d1, s1 + + +.function orc_composite_add_8888_8888_2d +.flags 2d .dest 4 d1 .source 4 s1 @@ -85,7 +94,7 @@ addusb d1, d1, t2 x4 convubw t1, s1 x4 convubw t2, s2 -splatw0q t2, t2 +splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb t3, t1 @@ -113,7 +122,7 @@ x4 addusb d1, d1, s1 #compover d1, d1, t1 x4 convubw t1, s1 x4 convubw t2, s2 -splatw0q t2, t2 +splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb t3, t1 @@ -121,7 +130,7 @@ x4 convwb t3, t1 loadl d, d1 x4 convubw d_wide, d x4 xorw t1, t1, 0x00ff -splatw0q t2, t1 +splatw3q t2, t1 x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb d, t1 @@ -142,7 +151,7 @@ x4 convubw t1, s loadl d, d1 x4 convubw d_wide, d x4 xorw t1, t1, 0x00ff -splatw0q t2, t1 +splatw3q t2, t1 x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb d, t1 @@ -161,12 +170,12 @@ x4 addusb d1, d, s x4 convubw t1, s1 x4 convubw t2, s2 -splatw0q t2, t2 +splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 # ORC_MULDIV_255((s),(m)), m is from dest x4 convubw d_wide, d1 -splatw0q t2, d_wide +splatw3q t2, d_wide x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb d1, t1 @@ -185,7 +194,7 @@ x4 convwb d1, t1 x4 convubw t1, s1 # ORC_MULDIV_255((s),(m)), m is from dest x4 convubw d_wide, d1 -splatw0q t2, d_wide +splatw3q t2, d_wide x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb d1, t1 @@ -203,12 +212,12 @@ x4 convwb d1, t1 x4 convubw t1, s1 x4 convubw t2, s2 -splatw0q t2, t2 +splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 # ORC_MULDIV_255((s),(m)), m is from dest x4 convubw d_wide, d1 -splatw0q t2, d_wide +splatw3q t2, d_wide x4 xorw t2, t2, 0x00ff x4 mullw t1, t1, t2 x4 div255w t1, t1 @@ -228,7 +237,7 @@ x4 convwb d1, t1 x4 convubw t1, s1 # ORC_MULDIV_255((s),(m)), m is from dest x4 convubw d_wide, d1 -splatw0q t2, d_wide +splatw3q t2, d_wide x4 xorw t2, t2, 0x00ff x4 mullw t1, t1, t2 x4 div255w t1, t1 @@ -252,18 +261,18 @@ x4 convwb d1, t1 x4 convubw t1, s1 x4 convubw t2, s2 -splatw0q t2, t2 +splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convubw d_wide, d1 -splatw0q t2, d_wide +splatw3q t2, d_wide x4 mullw t3, t1, t2 x4 div255w t3, t3 x4 convwb t4, t3 x4 convubw d_wide, d1 -splatw0q t2, t1 +splatw3q t2, t1 x4 xorw t2, t2, 0x00ff x4 mullw t1, d_wide, t2 x4 div255w t1, t1 @@ -287,13 +296,13 @@ x4 addusb d1, t4, t5 x4 convubw t1, s1 x4 convubw d_wide, d1 -splatw0q t2, d_wide +splatw3q t2, d_wide x4 mullw t3, t1, t2 x4 div255w t3, t3 x4 convwb t4, t3 x4 convubw d_wide, d1 -splatw0q t2, t1 +splatw3q t2, t1 x4 xorw t2, t2, 0x00ff x4 mullw t1, d_wide, t2 x4 div255w t1, t1 @@ -318,19 +327,19 @@ x4 addusb d1, t4, t5 x4 convubw t1, s1 x4 convubw t2, s2 -splatw0q t2, t2 +splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convubw d_wide, d1 -splatw0q t2, d_wide +splatw3q t2, d_wide x4 xorw t2, t2, 0x00ff x4 mullw t3, t1, t2 x4 div255w t3, t3 x4 convwb t4, t3 x4 convubw d_wide, d1 -splatw0q t2, t1 +splatw3q t2, t1 x4 xorw t2, t2, 0x00ff x4 mullw t1, d_wide, t2 x4 div255w t1, t1 @@ -353,14 +362,14 @@ x4 addusb d1, t4, t5 x4 convubw t1, s1 x4 convubw d_wide, d1 -splatw0q t2, d_wide +splatw3q t2, d_wide x4 xorw t2, t2, 0x00ff x4 mullw t3, t1, t2 x4 div255w t3, t3 x4 convwb t4, t3 x4 convubw d_wide, d1 -splatw0q t2, t1 +splatw3q t2, t1 x4 xorw t2, t2, 0x00ff x4 mullw t1, d_wide, t2 x4 div255w t1, t1 @@ -380,7 +389,7 @@ x4 addusb d1, t4, t5 x4 convubw t1, s1 x4 convubw t2, s2 -#splatw0q t2, t2 +#splatw3q t2, t2 x4 mullw t1, t1, t2 x4 div255w t1, t1 x4 convwb t3, t1 @@ -409,7 +418,7 @@ x4 addusb d1, d1, s1 x4 convubw s_wide, s1 x4 convubw m_wide, s2 -splatw0q xa, s_wide +splatw3q xa, s_wide x4 mullw s_wide, s_wide, m_wide x4 div255w s_wide, s_wide x4 convwb s, s_wide @@ -438,7 +447,7 @@ x4 addusb d1, d, s .temp 4 s x4 convubw s_wide, s1 -splatw0q xa, s_wide +splatw3q xa, s_wide x4 convwb s, s_wide x4 copyw m_wide, xa loadl d, d1 @@ -471,9 +480,41 @@ x4 convwb t3, t1 loadl d, d1 x4 convubw d_wide, d x4 xorw t1, t1, 0x00ff -splatw0q t2, t1 +splatw3q t2, t1 x4 mullw t1, d_wide, t2 x4 div255w t1, t1 x4 convwb d, t1 x4 addusb d1, d, t3 + + +.function orc_composite_over_n_8888_8888_ca_2d +.flags 2d +.dest 4 d1 +.source 4 s1 +.param 4 p1 +.temp 8 t1 +.temp 8 t2 +.temp 4 d +.temp 8 d_wide +.temp 8 m_wide +.temp 8 s_wide +.temp 8 xa +.temp 4 s + +x4 convubw s_wide, p1 +x4 convubw m_wide, s1 +splatw3q xa, s_wide +x4 mullw s_wide, s_wide, m_wide +x4 div255w s_wide, s_wide +x4 convwb s, s_wide +x4 mullw m_wide, m_wide, xa +x4 div255w m_wide, m_wide +loadl d, d1 +x4 convubw d_wide, d +x4 xorw m_wide, m_wide, 0x00ff +x4 mullw t1, d_wide, m_wide +x4 div255w t1, t1 +x4 convwb d, t1 +x4 addusb d1, d, s + diff --git a/test/Makefile.am b/test/Makefile.am index 80f78d7..031b70e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -22,6 +22,7 @@ TESTPROGRAMS = \ scaling-test \ affine-test \ composite \ + pixmanorc \ ds pdf_op_test_SOURCES = pdf-op-test.c utils.c utils.h @@ -41,6 +42,12 @@ gradient_crash_test_SOURCES = gradient-crash-test.c utils.c utils.h stress_test_SOURCES = stress-test.c utils.c utils.h scaling_helpers_test_SOURCES = scaling-helpers-test.c utils.c utils.h +pixmanorc_LDADD = $(TEST_LDADD) -lorc-test-0.4 +pixmanorc_SOURCES = pixmanorc.c + +pixmanorc.c: $(top_srcdir)/pixman/pixman-orccode.orc + $(ORCC) --test -o $@ $< + # Benchmarks BENCHMARKS = \ |