[Pixman] [PATCH 05/10] pixman-utils.c, pixman-private.h: Add floating point conversion routines

Søren Sandmann sandmann at cs.au.dk
Wed Sep 26 18:11:19 PDT 2012

Matt Turner <mattst88 at gmail.com> writes:

>> +pixman_bool_t
>> +_pixman_lookup_composite_function (pixman_implementation_t     *toplevel,
>> +                                  pixman_op_t                  op,
>> +                                  pixman_format_code_t         src_format,
>> +                                  uint32_t                     src_flags,
>> +                                  pixman_format_code_t         mask_format,
>> +                                  uint32_t                     mask_flags,
>> +                                  pixman_format_code_t         dest_format,
>> +                                  uint32_t                     dest_flags,
>> +                                  pixman_implementation_t    **out_imp,
>> +                                  pixman_composite_func_t     *out_func);
>> +

This declaration is the result of a mismerge. I'll remove it before comitting.

>> +void
>> +pixman_expand_to_float (argb_t               *dst,
>> +                       const uint32_t       *src,
>> +                       pixman_format_code_t  format,
>> +                       int                   width)
>> +{

>> +void
>> +pixman_contract_from_float (uint32_t     *dst,
>> +                           const argb_t *src,
>> +                           int           width)
>> +{
> As I'm sure you know, these functions can be done with SSE 2 or 4.1 if
> we could convert 4 pixels at once. How can we override their
> implementations with optimized ones?

A way to do that might be to make it a new entry point in the
implementation struct, and then make sure that the implementation
pointer is passed down to the accessors.

But a simpler approach would probably be to write SIMD iterators for the
most common formats that would convert to and from floating point
without using these expand/contract functions.

An idea here might be to change the "untransformed" iterators such that
they could take an accessor function as a parameter. Then the SIMD
implementations could simply write accessor functions and pass them to
that iterator.


More information about the Pixman mailing list