summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2013-09-02 03:09:34 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2013-09-02 03:09:34 -0400
commitef97adb5bd8c7c74ce6cb302d170c7b4093864ca (patch)
tree73bd982e9d3e29670a8ae007658686460abede15
parent90b833510ee672185ae0c92a3c41f5577376f9ec (diff)
iterjit
-rw-r--r--iterjit.c64
1 files changed, 56 insertions, 8 deletions
diff --git a/iterjit.c b/iterjit.c
index e3b8845..e7e1e37 100644
--- a/iterjit.c
+++ b/iterjit.c
@@ -49,7 +49,55 @@
They are specific to a format, and an intermediate format.
There may also be setup()/setup_line() methods required.
+
+ Flow:
+ - outer loop:
+ - generates outer loop
+ - src/mask/dest have pre-scanline setups called
+ - body is generated by destination iter
+ - src/mask/dest have post-scanline finalizers called
+
+ - destination iter:
+ - for each alignment loop, it generates an inner loop
+ - body of inner loop is generated by combiner
+ - combiner returns pixels or an indication that
+ no change is required
+ - destination iter writes back if necessary
+ - advances pointer
+
+ - combiner drives generation of pixels
+ - if there is a mask, then
+ - tell mask iter to load n pixels
+ - generate code to check if all pixels are 0
+ - if it is, then
+ - depending on operator
+ - return 0
+ - return "no change needed"
+ else:
+ - tell source iter to load n pixels
+ - add code to multiply them together
+ - depending on operator
+ - add code to check if a result is 0xff
+ - if it is, then
+ - return source
+ else:
+ - tell destination to read a pixel
+ - generate code to combine with source
+ - return result
+ tell mask iter to advance
+ else:
+ - tell source iter to load n pixels
+ - depending on operator
+ - add code to check if source is 0xff
+ - if it is, then
+ - return source
+ else:
+ - tell destination to read pixel
+ - generate code to combine with source
+ - return result
+ tell source iter to advance
*/
+
#include <stdio.h>
#include "simplex86.h"
#include "simple-reg.h"
@@ -73,11 +121,8 @@ struct jit_src_iter_t
{
void (* begin) (jit_src_iter_t *src, jit_t *jit);
void (* begin_line) (jit_src_iter_t *src, jit_t *jit);
- op_t (* get_1_pixel) (jit_src_iter_t *src, jit_t *jit);
- op_t (* get_2_pixels) (jit_src_iter_t *src, jit_t *jit);
- op_t (* get_4_pixels) (jit_src_iter_t *src, jit_t *jit);
- op_t (* get_8_pixels) (jit_src_iter_t *src, jit_t *jit);
- op_t (* get_16_pixels) (jit_src_iter_t *src, jit_t *jit);
+ op_t (* load_pixels) (jit_src_iter_t *src, jit_t *jit, int n_pixels);
+ void (* advance_pixels) (jit_src_iter_t *src, jit_t *jit, int n_pixels);
void (* end_line) (jit_src_iter_t *src, jit_t *jit);
void (* end) (jit_src_iter_t *src, jit_t *jit);
};
@@ -85,12 +130,16 @@ struct jit_src_iter_t
struct jit_combiner_t
{
op_t (* combine) (jit_combiner_t *combiner, jit_t *jit,
- op_t s, op_t m, op_t d);
+ jit_src_iter_t *src,
+ jit_mask_iter_t *mask,
+ jit_dest_iter_t *dest);
};
struct jit_dest_iter_t
{
void (* begin) (jit_dest_iter_t *dest, jit_t *jit);
+ op_t (* load_pixels) (jit_dest_iter_t *dest, jit_t *jit, int n_pixels);
+ void (* advance_pixels) (jit_dest_iter_t *dest, jit_t *jit, int n_pixels);
void (* process_line) (jit_dest_iter_t *dest_iter,
jit_t *jit,
jit_src_iter_t *src_iter,
@@ -104,8 +153,6 @@ dest_a8r8g8b8_begin (jit_dest_iter_t * dest,
jit_t * jit)
{
BEGIN_ASM (jit->fragment)
-
- I_and, al, IMM(8),
END_ASM ();
}
@@ -127,6 +174,7 @@ dest_a8r8g8b8_process_line (jit_dest_iter_t *dest,
static void
dest_a8r8g8b8_end (jit_dest_iter_t *dest, jit_t *jit)
{
+
}
jit_dest_iter_t *