Fix blend filter for autovectorizing
authorallan.jensen@nokia.com <allan.jensen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jul 2012 13:37:43 +0000 (13:37 +0000)
committerallan.jensen@nokia.com <allan.jensen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jul 2012 13:37:43 +0000 (13:37 +0000)
commit4dbf2df9ed57b2bf15b6b4a30aa9a6fe549707ce
tree9bc051d7043141e42967fcf02a42beae050b42d7
parentda002f1428075c27ffae33d501c1d6cf08e43b55
Fix blend filter for autovectorizing
https://bugs.webkit.org/show_bug.cgi?id=91398

Reviewed by Nikolas Zimmermann.

To support auto-vectorizing, the loop had to be unswitched, and regular arrays used that
did not do boundary-checks in the inner loop. Finally the integer division by 255
was optimized not use integer division intrinsics.

On a X86-64 architechture using GCC -O3 on the file, this gives a speed-up of 2.9x.

* platform/graphics/filters/FEBlend.cpp:
(WebCore::fastDivideBy255):
(BlendNormal):
(WebCore::BlendNormal::apply):
(BlendMultiply):
(WebCore::BlendMultiply::apply):
(BlendScreen):
(WebCore::BlendScreen::apply):
(BlendDarken):
(WebCore::BlendDarken::apply):
(BlendLighten):
(WebCore::BlendLighten::apply):
(BlendUnknown):
(WebCore::BlendUnknown::apply):
(WebCore::platformApply):
(WebCore::FEBlend::platformApplyGeneric):
(WebCore::FEBlend::platformApplySoftware):
* platform/graphics/filters/FEBlend.h:
(FEBlend):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/filters/FEBlend.cpp
Source/WebCore/platform/graphics/filters/FEBlend.h