[Webkit-unassigned] [Bug 103614] Optimizing RGBA16, RGB16, ARGB16, BGRA16 unpacking functions with NEON intrinsics

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 6 00:32:57 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=103614


Zoltan Herczeg <zherczeg at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #176708|review?, commit-queue?      |review-, commit-queue-
               Flag|                            |




--- Comment #2 from Zoltan Herczeg <zherczeg at webkit.org>  2012-12-06 00:35:24 PST ---
(From update of attachment 176708)
View in context: https://bugs.webkit.org/attachment.cgi?id=176708&action=review

> Source/WebCore/platform/graphics/GraphicsContext3D.cpp:377
> +#if HAVE(ARM_NEON_INTRINSICS)
> +    unsigned componentsPerRow = pixelsPerRow * 4;
> +    unsigned tailComponents = componentsPerRow % 8;
> +    unsigned componentsSize = componentsPerRow - tailComponents;
> +
> +    ARM::unpackOneRowOfRGBA16LittleToRGBA8NEON(source, destination, componentsSize);
> +
> +    source += componentsSize;
> +    destination += componentsSize;
> +    pixelsPerRow = tailComponents / 4;
> +#endif

I realized that I don't really like in this approach. The modification of the common code path is way too big. And too ARM specific.

I would prefer:

#if HAVE(ARM_NEON_INTRINSICS) optionally other SIMDS connected with || operator
    SIMD::unpackOneRowOfRGBA16LittleToRGBA8(source, destination, pixelsPerRow)
$endif

And the SIMD class (namespace) would define the folowing interface:
inline void SIMD::unpackOneRowOfRGBA16LittleToRGBA8(const uint16_t*& source, uint8_t*& destination, unsigned int& pixelsPerRow)

Advantages:
1) Modifications of the common code path is much shorter.
2) Can modify the arguments, since they passed as reference (usually SIMD process a group of pixels, but not necessary all if the length is not divisible by a certain value).
3) Can be extended to support other SIMD-s, not just NEON
4) Still it can be seen that a certain function is supported by the current CPU (So it is not necessary to support all of these functions on all CPUs which have SIMD support)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list