Commit c51c85dd3aa4a920f363e315ef4512f1d97401b3

  • avatar
  • zecke
  • Mon Nov 09 07:28:10 GMT 2009
Port the qt_memfill_armv6 to GNU syntax

Remove the armv6 suffix from the method name as it can be used
on any armv4+ architecture. Add the GNU version of the same routine
to the tree and buildsystem for a minor 6-10ms win...

The symbian file might needs to be split up or get a #ifdef for
ARMv6 and earlier code..

Read paint buffer with 217 frames
/qtgraphics-cycler.trace, iterations: 3, frames: 217, min(ms): 11950, median(ms): 11951, stddev: 0.006832 %, max(fps): 18.158996

The routine is only using armv4+ instruction
src/gui/painting/painting.pri
(2 / 0)
  
380380 QMAKE_CXXFLAGS.ARMCC *= -O3
381381}
382382
383SOURCES += painting/qdrawhelper_arm_gnu.cpp
384
383385contains(QT_CONFIG, zlib) {
384386 INCLUDEPATH += ../3rdparty/zlib
385387} else:!contains(QT_CONFIG, no-zlib) {
src/gui/painting/qdrawhelper.cpp
(9 / 3)
  
81188118
81198119#endif // QT_NO_DEBUG
81208120
8121#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
8121#if defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6)
8122
8123# if defined (Q_CC_RVCT) || defined(Q_CC_GNU)
8124 qt_memfill32 = qt_memfill32_arm;
8125# endif
8126
8127# if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
81228128 functionForModeAsm = qt_functionForMode_ARMv6;
81238129 functionForModeSolidAsm = qt_functionForModeSolid_ARMv6;
81248130
8125 qt_memfill32 = qt_memfill32_armv6;
81268131
81278132 qDrawHelper[QImage::Format_ARGB32_Premultiplied].blendColor = qt_blend_color_argb_armv6;
81288133
81358135 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_armv6;
81368136 qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_armv6;
81378137 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_armv6;
8138#endif // Q_CC_RVCT && QT_HAVE_ARMV6
8138# endif // Q_CC_RVCT && QT_HAVE_ARMV6
8139#endif // QT_ARCH_ARM
81398140
81408141 if (functionForModeSolidAsm) {
81418142 const int destinationMode = QPainter::CompositionMode_Destination;
src/gui/painting/qdrawhelper_arm_gnu.cpp
(90 / 0)
  
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation (qt-info@nokia.com)
6**
7** This file is part of the QtGui module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** No Commercial Usage
11** This file contains pre-release code and may not be distributed.
12** You may use this file in accordance with the terms and conditions
13** contained in the Technology Preview License Agreement accompanying
14** this package.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** If you have questions regarding the use of this file, please contact
29** Nokia at qt-info@nokia.com.
30**
31**
32**
33**
34**
35**
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#include "qdrawhelper_arm_p.h"
43
44#include <stdio.h>
45
46#if defined(Q_CC_GNU) && (defined(QT_ARCH_ARM) || defined(QT_ARCH_ARMV6))
47
48void qt_memfill32_arm(quint32 *dest, quint32 value, int count)
49{
50 asm __volatile__(
51 "mov r3, %[value]\n\t"
52 "mov r4, %[value]\n\t"
53 "mov r5, %[value]\n\t"
54 "mov r6, %[value]\n\t"
55 "mov r7, %[value]\n\t"
56 "mov r8, %[value]\n\t"
57 "mov r9, %[value]\n"
58
59"mfill_loop:\n\t"
60 "subs %[count], %[count], #32\n\t"
61 "stmgeia %[dest]!, {%[value], r3, r4, r5, r6, r7, r8, r9}\n\t"
62 "stmgeia %[dest]!, {%[value], r3, r4, r5, r6, r7, r8, r9}\n\t"
63 "stmgeia %[dest]!, {%[value], r3, r4, r5, r6, r7, r8, r9}\n\t"
64 "stmgeia %[dest]!, {%[value], r3, r4, r5, r6, r7, r8, r9}\n\t"
65 "bgt mfill_loop\n"
66"mfill_remaining:\n\t"
67 "@ Fill up to 31 remaining pixels\n\t"
68 "@ Fill 16 pixels\n\t"
69 "tst %[count], #16\n\t"
70 "stmneia %[dest]!, {%[value], r3, r4, r5, r6, r7, r8, r9}\n\t"
71 "stmneia %[dest]!, {%[value], r3, r4, r5, r6, r7, r8, r9}\n\t"
72 "@ Fill 8 pixels\n\t"
73 "tst %[count], #8\n\t"
74 "stmneia %[dest]!, {%[value], r3, r4, r5, r6, r7, r8, r9}\n\t"
75 "@ Fill 4 pixels\n\t"
76 "tst %[count], #4\n\t"
77 "stmneia %[dest]!, {%[value], r3, r4, r5}\n\t"
78 "@ Fill 2 pixels\n\t"
79 "tst %[count], #2\n\t"
80 "stmneia %[dest]!, {%[value], r3}\n\t"
81 "@ Fill last one\n\t"
82 "tst %[count], #1\n\t"
83 "strne %[value], [%[dest]]\n\t"
84 : "=r" (dest), "=r" (count)
85 : [dest] "r" (dest), [value] "r" (value), [count] "r" (count)
86 : "memory", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r9", "cc"
87 );
88}
89
90#endif
src/gui/painting/qdrawhelper_arm_p.h
(4 / 1)
  
9797#define QT_ARM_HAS_PLD
9898#endif
9999
100#if defined(Q_CC_RVCT) || defined(Q_CC_GNU)
101extern "C" void qt_memfill32_arm(quint32 *dest, quint32 value, int count);
102#endif
103
100104#if defined(Q_CC_RVCT) && defined(QT_HAVE_ARMV6)
101105
102106extern "C" void qt_blend_rgb32_on_rgb32_armv6(uchar *destPixels, int dbpl,
113113 int w, int h,
114114 int const_alpha);
115115
116extern "C" void qt_memfill32_armv6(quint32 *dest, quint32 value, int count);
117116
118117extern "C" void comp_func_Source_armv6(uint *dest, const uint *src, int length, uint const_alpha);
119118extern "C" void comp_func_SourceOver_armv6(uint *dest, const uint *src, int length, uint const_alpha);
src/gui/painting/qdrawhelper_armv6_rvct.s
(2 / 2)
  
5656 INCLUDE qdrawhelper_armv6_rvct.inc
5757
5858;-----------------------------------------------------------------------------
59; qt_memfill32_armv6
59; qt_memfill32_arm
6060;
6161; @brief Not yet in use!
6262;
6565; @param count Count (r2)
6666;
6767;---------------------------------------------------------------------------
68qt_memfill32_armv6 Function
68qt_memfill32_arm Function
6969 stmfd sp!, {r4-r12, r14}
7070
7171 mov r3, r1

Comments

Add a new comment:

Login or create an account to post a comment

Add your comment