Commit b2d17d7c4ecd31cba36ef79909e2e819217a0971

  • avatar
  • zecke
  • Mon Nov 09 07:28:09 GMT 2009
Use the PLD instruction for CC_RCVT and GNU when it is available

Separate the CC_RCVT pragma to generate arm assembly from the preload
code. Use the preload code when PLD is available, add GNU inline assembly.

before:
Read paint buffer with 217 frames
/qtgraphics-cycler.trace, iterations: 3, frames: 217, min(ms): 12417, median(ms): 12418, stddev: 0.021134 %, max(fps): 17.476041

after:
Read paint buffer with 217 frames
/qtgraphics-cycler.trace, iterations: 3, frames: 217, min(ms): 11963, median(ms): 11963, stddev: 0.003940 %, max(fps): 18.139263
src/gui/painting/qdrawhelper.cpp
(20 / 6)
  
12141214 return b;
12151215}
12161216
1217#if defined(Q_CC_RVCT)
12181217// Force ARM code generation for comp_func_* -methods
1218#if defined(Q_CC_RVCT)
12191219# pragma push
12201220# pragma arm
1221# if defined(QT_HAVE_ARMV6)
1221#endif
1222
1223
1224// Use PLD on ARM core that have them in two assembly flavors
1225#ifdef QT_ARM_HAS_PLD
1226
1227// assembly flavors
1228# if defined (Q_CC_RVCT)
12221229static __forceinline void preload(const uint *start)
12231230{
12241231 asm( "pld [start]" );
12251232}
1233# elif defined (Q_CC_GNU)
1234static __attribute__((always_inline)) void preload(const uint *start)
1235{
1236 asm __volatile__("pld [%[addr]]\n"
1237 :
1238 : [addr] "r"(start));
1239}
1240# endif
1241
12261242static const uint L2CacheLineLength = 32;
12271243static const uint L2CacheLineLengthInInts = L2CacheLineLength/sizeof(uint);
12281244# define PRELOAD_INIT(x) preload(x);
12471247// Two consecutive preloads stall, so space them out a bit by using different modulus.
12481248# define PRELOAD_COND2(x,y) if (((uint)&x[i])%L2CacheLineLength == 0) preload(&x[i] + L2CacheLineLengthInInts); \
12491249 if (((uint)&y[i])%L2CacheLineLength == 16) preload(&y[i] + L2CacheLineLengthInInts);
1250# endif // QT_HAVE_ARMV6
1251#endif // Q_CC_RVCT
12521250
1253#if !defined(Q_CC_RVCT) || !defined(QT_HAVE_ARMV6)
1251#else
12541252# define PRELOAD_INIT(x)
12551253# define PRELOAD_INIT2(x,y)
12561254# define PRELOAD_COND(x)
12571255# define PRELOAD_COND2(x,y)
1258#endif
1256#endif // QT_ARM_HAS_PLD
12591257
12601258/* The constant alpha factor describes an alpha factor that gets applied
12611259 to the result of the composition operation combining it with the destination.

Comments

Add a new comment:

Login or create an account to post a comment

Add your comment