Qt 4.8
Classes | Macros | Typedefs | Functions
qdrawhelper_mmx_p.h File Reference
#include <private/qdrawhelper_p.h>
#include <private/qdrawhelper_x86_p.h>
#include <private/qpaintengine_raster_p.h>

Go to the source code of this file.

Classes

struct  QMMXCommonIntrinsics
 

Macros

#define byte_mul(a, b)   _byte_mul(a, b, mmx_0x0080)
 
#define C_00   const m64 mmx_0x0000 = _mm_setzero_si64()
 
#define C_80   const m64 mmx_0x0080 = _mm_set1_pi16(0x80)
 
#define C_FF   const m64 mmx_0x00ff = _mm_set1_pi16(0xff)
 
#define comp_func_Clear_impl(dest, length, const_alpha)
 
#define interpolate_pixel_255(x, a, y, b)   _interpolate_pixel_255(x, a, y, b, mmx_0x0080)
 
#define load(x)   _load(x, mmx_0x0000)
 
#define load_alpha(x)   _load_alpha(x, mmx_0x0000)
 
#define negate(x)   _negate(x, mmx_0x00ff)
 
#define premul(x)   _premul(x, mmx_0x0080)
 
#define store(x)   _store(x, mmx_0x0000)
 

Typedefs

typedef __m64 m64
 

Functions

template<class MM >
static void QT_FASTCALL comp_func_Clear (uint *dest, const uint *, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_DestinationAtop (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_DestinationIn (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_DestinationOut (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_DestinationOver (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_Clear (uint *dest, int length, uint, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_DestinationAtop (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_DestinationIn (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_DestinationOut (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_DestinationOver (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_Source (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_SourceAtop (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_SourceIn (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_SourceOut (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_SourceOver (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_solid_XOR (uint *dest, int length, uint src, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_Source (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_SourceAtop (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_SourceIn (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_SourceOut (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_SourceOver (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL comp_func_XOR (uint *dest, const uint *src, int length, uint const_alpha)
 
template<class MM >
static void qt_blend_color_argb_x86 (int count, const QSpan *spans, void *userData, CompositionFunctionSolid *solidFunc)
 
template<class MM >
static void QT_FASTCALL rasterop_solid_NotSource (uint *dest, int length, uint color, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL rasterop_solid_NotSourceAndDestination (uint *dest, int length, uint color, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination (uint *dest, int length, uint color, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination (uint *dest, int length, uint color, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL rasterop_solid_NotSourceXorDestination (uint *dest, int length, uint color, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL rasterop_solid_SourceAndDestination (uint *dest, int length, uint color, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL rasterop_solid_SourceAndNotDestination (uint *dest, int length, uint color, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL rasterop_solid_SourceOrDestination (uint *dest, int length, uint color, uint const_alpha)
 
template<class MM >
static void QT_FASTCALL rasterop_solid_SourceXorDestination (uint *dest, int length, uint color, uint const_alpha)
 

Macro Definition Documentation

◆ byte_mul

#define byte_mul (   a,
 
)    _byte_mul(a, b, mmx_0x0080)

◆ C_00

#define C_00   const m64 mmx_0x0000 = _mm_setzero_si64()

◆ C_80

#define C_80   const m64 mmx_0x0080 = _mm_set1_pi16(0x80)

◆ C_FF

#define C_FF   const m64 mmx_0x00ff = _mm_set1_pi16(0xff)

◆ comp_func_Clear_impl

#define comp_func_Clear_impl (   dest,
  length,
  const_alpha 
)
Value:
{\
if (const_alpha == 255) {\
qt_memfill(static_cast<quint32*>(dest), quint32(0), length);\
} else {\
C_FF; C_80; C_00;\
m64 ia = MM::negate(MM::load_alpha(const_alpha));\
for (int i = 0; i < length; ++i) {\
dest[i] = MM::store(MM::byte_mul(MM::load(dest[i]), ia));\
}\
}\
}
#define C_80
#define C_00
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define store(x)
unsigned int quint32
Definition: qglobal.h:938
static const KeyPair *const end

Definition at line 149 of file qdrawhelper_mmx_p.h.

Referenced by comp_func_Clear(), and comp_func_solid_Clear().

◆ interpolate_pixel_255

#define interpolate_pixel_255 (   x,
  a,
  y,
 
)    _interpolate_pixel_255(x, a, y, b, mmx_0x0080)

◆ load

#define load (   x)    _load(x, mmx_0x0000)

◆ load_alpha

#define load_alpha (   x)    _load_alpha(x, mmx_0x0000)

◆ negate

#define negate (   x)    _negate(x, mmx_0x00ff)

◆ premul

#define premul (   x)    _premul(x, mmx_0x0080)

Definition at line 140 of file qdrawhelper_mmx_p.h.

◆ store

#define store (   x)    _store(x, mmx_0x0000)

Typedef Documentation

◆ m64

typedef __m64 m64

Definition at line 72 of file qdrawhelper_mmx_p.h.

Function Documentation

◆ comp_func_Clear()

template<class MM >
static void QT_FASTCALL comp_func_Clear ( uint dest,
const uint ,
int  length,
uint  const_alpha 
)
static

Definition at line 170 of file qdrawhelper_mmx_p.h.

171 {
172  comp_func_Clear_impl(dest, length, const_alpha);
173 }
#define comp_func_Clear_impl(dest, length, const_alpha)

◆ comp_func_DestinationAtop()

template<class MM >
static void QT_FASTCALL comp_func_DestinationAtop ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 567 of file qdrawhelper_mmx_p.h.

568 {
569  C_FF; C_80; C_00;
570  if (const_alpha == 255) {
571  for (int i = 0; i < length; ++i) {
572  m64 s = MM::load(src[i]);
573  m64 d = MM::load(dest[i]);
574  dest[i] = MM::store(MM::interpolate_pixel_255(d, MM::alpha(s), s,
575  MM::negate(MM::alpha(d))));
576  }
577  } else {
578  m64 ca = MM::load_alpha(const_alpha);
579  for (int i = 0; i < length; ++i) {
580  m64 s = MM::load(src[i]);
581  s = MM::byte_mul(s, ca);
582  m64 d = MM::load(dest[i]);
583  m64 a = MM::alpha(s);
584  a = MM::add(a, MM::negate(ca));
585  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::negate(MM::alpha(d)),
586  d, a));
587  }
588  }
589  MM::end();
590 }
double d
Definition: qnumeric_p.h:62
#define add(aName)
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_DestinationIn()

template<class MM >
static void QT_FASTCALL comp_func_DestinationIn ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 383 of file qdrawhelper_mmx_p.h.

384 {
385  C_FF; C_80; C_00;
386  if (const_alpha == 255) {
387  for (int i = 0; i < length; ++i) {
388  m64 a = MM::alpha(MM::load(src[i]));
389  dest[i] = MM::store(MM::byte_mul(MM::load(dest[i]), a));
390  }
391  } else {
392  m64 ca = MM::load_alpha(const_alpha);
393  m64 cia = MM::negate(ca);
394  for (int i = 0; i < length; ++i) {
395  m64 d = MM::load(dest[i]);
396  m64 a = MM::alpha(MM::load(src[i]));
397  a = MM::byte_mul(a, ca);
398  a = MM::add(a, cia);
399  dest[i] = MM::store(MM::byte_mul(d, a));
400  }
401  }
402  MM::end();
403 }
double d
Definition: qnumeric_p.h:62
#define add(aName)
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_DestinationOut()

template<class MM >
static void QT_FASTCALL comp_func_DestinationOut ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 473 of file qdrawhelper_mmx_p.h.

474 {
475  C_FF; C_80; C_00;
476  if (const_alpha == 255) {
477  for (int i = 0; i < length; ++i) {
478  m64 a = MM::negate(MM::alpha(MM::load(src[i])));
479  dest[i] = MM::store(MM::byte_mul(MM::load(dest[i]), a));
480  }
481  } else {
482  m64 ca = MM::load_alpha(const_alpha);
483  m64 cia = MM::negate(ca);
484  for (int i = 0; i < length; ++i) {
485  m64 d = MM::load(dest[i]);
486  m64 a = MM::negate(MM::alpha(MM::load(src[i])));
487  a = MM::byte_mul(a, ca);
488  a = MM::add(a, cia);
489  dest[i] = MM::store(MM::byte_mul(d, a));
490  }
491  }
492  MM::end();
493 }
double d
Definition: qnumeric_p.h:62
#define add(aName)
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_DestinationOver()

template<class MM >
static void QT_FASTCALL comp_func_DestinationOver ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 289 of file qdrawhelper_mmx_p.h.

290 {
291  C_FF; C_80; C_00;
292  if (const_alpha == 255) {
293  for (int i = 0; i < length; ++i) {
294  m64 d = MM::load(dest[i]);
295  m64 ia = MM::negate(MM::alpha(d));
296  dest[i] = MM::store(MM::add(d, MM::byte_mul(MM::load(src[i]), ia)));
297  }
298  } else {
299  m64 ca = MM::load_alpha(const_alpha);
300  for (int i = 0; i < length; ++i) {
301  m64 d = MM::load(dest[i]);
302  m64 dia = MM::negate(MM::alpha(d));
303  dia = MM::byte_mul(dia, ca);
304  dest[i] = MM::store(MM::add(d, MM::byte_mul(MM::load(src[i]), dia)));
305  }
306  }
307  MM::end();
308 }
double d
Definition: qnumeric_p.h:62
#define add(aName)
__m64 m64
#define C_80
#define C_00
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_solid_Clear()

template<class MM >
static void QT_FASTCALL comp_func_solid_Clear ( uint dest,
int  length,
uint  ,
uint  const_alpha 
)
static

Definition at line 164 of file qdrawhelper_mmx_p.h.

165 {
166  comp_func_Clear_impl(dest, length, const_alpha);
167 }
#define comp_func_Clear_impl(dest, length, const_alpha)

◆ comp_func_solid_DestinationAtop()

template<class MM >
static void QT_FASTCALL comp_func_solid_DestinationAtop ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 548 of file qdrawhelper_mmx_p.h.

549 {
550  C_FF; C_80; C_00;
551  m64 s = MM::load(src);
552  m64 a = MM::alpha(s);
553  if (const_alpha != 255) {
554  m64 ca = MM::load_alpha(const_alpha);
555  s = MM::byte_mul(s, ca);
556  a = MM::alpha(s);
557  a = MM::add(a, MM::negate(ca));
558  }
559  for (int i = 0; i < length; ++i) {
560  m64 d = MM::load(dest[i]);
561  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::negate(MM::alpha(d)), d, a));
562  }
563  MM::end();
564 }
double d
Definition: qnumeric_p.h:62
#define add(aName)
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_solid_DestinationIn()

template<class MM >
static void QT_FASTCALL comp_func_solid_DestinationIn ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 366 of file qdrawhelper_mmx_p.h.

367 {
368  C_80; C_00;
369  m64 a = MM::alpha(MM::load(src));
370  if (const_alpha != 255) {
371  C_FF;
372  m64 ca = MM::load_alpha(const_alpha);
373  m64 cia = MM::negate(ca);
374  a = MM::byte_mul(a, ca);
375  a = MM::add(a, cia);
376  }
377  for (int i = 0; i < length; ++i)
378  dest[i] = MM::store(MM::byte_mul(MM::load(dest[i]), a));
379  MM::end();
380 }
#define add(aName)
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_solid_DestinationOut()

template<class MM >
static void QT_FASTCALL comp_func_solid_DestinationOut ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 458 of file qdrawhelper_mmx_p.h.

459 {
460  C_FF; C_80; C_00;
461  m64 a = MM::negate(MM::alpha(MM::load(src)));
462  if (const_alpha != 255) {
463  m64 ca = MM::load_alpha(const_alpha);
464  a = MM::byte_mul(a, ca);
465  a = MM::add(a, MM::negate(ca));
466  }
467  for (int i = 0; i < length; ++i)
468  dest[i] = MM::store(MM::byte_mul(MM::load(dest[i]), a));
469  MM::end();
470 }
#define add(aName)
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_solid_DestinationOver()

template<class MM >
static void QT_FASTCALL comp_func_solid_DestinationOver ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 273 of file qdrawhelper_mmx_p.h.

274 {
275  C_FF; C_80; C_00;
276  m64 s = MM::load(src);
277  if (const_alpha != 255)
278  s = MM::byte_mul(s, MM::load_alpha(const_alpha));
279 
280  for (int i = 0; i < length; ++i) {
281  m64 d = MM::load(dest[i]);
282  m64 dia = MM::negate(MM::alpha(d));
283  dest[i] = MM::store(MM::add(d, MM::byte_mul(s, dia)));
284  }
285  MM::end();
286 }
double d
Definition: qnumeric_p.h:62
#define add(aName)
__m64 m64
#define C_80
#define C_00
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_solid_Source()

template<class MM >
static void QT_FASTCALL comp_func_solid_Source ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 180 of file qdrawhelper_mmx_p.h.

181 {
182  if (const_alpha == 255) {
183  qt_memfill(static_cast<quint32*>(dest), quint32(src), length);
184  } else {
185  C_FF; C_80; C_00;
186  const m64 a = MM::load_alpha(const_alpha);
187  const m64 ia = MM::negate(a);
188  const m64 s = MM::byte_mul(MM::load(src), a);
189  for (int i = 0; i < length; ++i) {
190  dest[i] = MM::store(MM::add(s, MM::byte_mul(MM::load(dest[i]), ia)));
191  }
192  MM::end();
193  }
194 }
#define add(aName)
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
unsigned int quint32
Definition: qglobal.h:938
static const KeyPair *const end
void qt_memfill(T *dest, T value, int count)

◆ comp_func_solid_SourceAtop()

template<class MM >
static void QT_FASTCALL comp_func_solid_SourceAtop ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 502 of file qdrawhelper_mmx_p.h.

503 {
504  C_FF; C_80; C_00;
505  m64 s = MM::load(src);
506  if (const_alpha != 255) {
507  m64 ca = MM::load_alpha(const_alpha);
508  s = MM::byte_mul(s, ca);
509  }
510  m64 a = MM::negate(MM::alpha(s));
511  for (int i = 0; i < length; ++i) {
512  m64 d = MM::load(dest[i]);
513  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::alpha(d), d, a));
514  }
515  MM::end();
516 }
double d
Definition: qnumeric_p.h:62
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_solid_SourceIn()

template<class MM >
static void QT_FASTCALL comp_func_solid_SourceIn ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 315 of file qdrawhelper_mmx_p.h.

316 {
317  C_80; C_00;
318  if (const_alpha == 255) {
319  m64 s = MM::load(src);
320  for (int i = 0; i < length; ++i) {
321  m64 da = MM::alpha(MM::load(dest[i]));
322  dest[i] = MM::store(MM::byte_mul(s, da));
323  }
324  } else {
325  C_FF;
326  m64 s = MM::load(src);
327  m64 ca = MM::load_alpha(const_alpha);
328  s = MM::byte_mul(s, ca);
329  m64 cia = MM::negate(ca);
330  for (int i = 0; i < length; ++i) {
331  m64 d = MM::load(dest[i]);
332  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::alpha(d), d, cia));
333  }
334  }
335  MM::end();
336 }
double d
Definition: qnumeric_p.h:62
__m64 m64
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_solid_SourceOut()

template<class MM >
static void QT_FASTCALL comp_func_solid_SourceOut ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 410 of file qdrawhelper_mmx_p.h.

411 {
412  C_FF; C_80; C_00;
413  m64 s = MM::load(src);
414  if (const_alpha == 255) {
415  for (int i = 0; i < length; ++i) {
416  m64 dia = MM::negate(MM::alpha(MM::load(dest[i])));
417  dest[i] = MM::store(MM::byte_mul(s, dia));
418  }
419  } else {
420  m64 ca = MM::load_alpha(const_alpha);
421  m64 cia = MM::negate(ca);
422  s = MM::byte_mul(s, ca);
423  for (int i = 0; i < length; ++i) {
424  m64 d = MM::load(dest[i]);
425  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::negate(MM::alpha(d)), d, cia));
426  }
427  }
428  MM::end();
429 }
double d
Definition: qnumeric_p.h:62
__m64 m64
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_solid_SourceOver()

template<class MM >
static void QT_FASTCALL comp_func_solid_SourceOver ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 219 of file qdrawhelper_mmx_p.h.

220 {
221  if ((const_alpha & qAlpha(src)) == 255) {
222  qt_memfill(static_cast<quint32*>(dest), quint32(src), length);
223  } else {
224  C_FF; C_80; C_00;
225  m64 s = MM::load(src);
226  if (const_alpha != 255) {
227  m64 ca = MM::load_alpha(const_alpha);
228  s = MM::byte_mul(s, ca);
229  }
230  m64 a = MM::negate(MM::alpha(s));
231  for (int i = 0; i < length; ++i)
232  dest[i] = MM::store(MM::add(s, MM::byte_mul(MM::load(dest[i]), a)));
233  MM::end();
234  }
235 }
#define add(aName)
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
int qAlpha(QRgb rgba)
Returns the alpha component of the ARGB quadruplet rgba.
Definition: qrgb.h:66
#define C_00
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
unsigned int quint32
Definition: qglobal.h:938
static const KeyPair *const end
void qt_memfill(T *dest, T value, int count)

◆ comp_func_solid_XOR()

template<class MM >
static void QT_FASTCALL comp_func_solid_XOR ( uint dest,
int  length,
uint  src,
uint  const_alpha 
)
static

Definition at line 599 of file qdrawhelper_mmx_p.h.

600 {
601  C_FF; C_80; C_00;
602  m64 s = MM::load(src);
603  if (const_alpha != 255) {
604  m64 ca = MM::load_alpha(const_alpha);
605  s = MM::byte_mul(s, ca);
606  }
607  m64 a = MM::negate(MM::alpha(s));
608  for (int i = 0; i < length; ++i) {
609  m64 d = MM::load(dest[i]);
610  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::negate(MM::alpha(d)),
611  d, a));
612  }
613  MM::end();
614 }
double d
Definition: qnumeric_p.h:62
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_Source()

template<class MM >
static void QT_FASTCALL comp_func_Source ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 197 of file qdrawhelper_mmx_p.h.

198 {
199  if (const_alpha == 255) {
200  ::memcpy(dest, src, length * sizeof(uint));
201  } else {
202  C_FF; C_80; C_00;
203  const m64 a = MM::load_alpha(const_alpha);
204  const m64 ia = MM::negate(a);
205  for (int i = 0; i < length; ++i)
206  dest[i] = MM::store(MM::interpolate_pixel_255(MM::load(src[i]), a,
207  MM::load(dest[i]), ia));
208  }
209  MM::end();
210 }
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
unsigned int uint
Definition: qglobal.h:996
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_SourceAtop()

template<class MM >
static void QT_FASTCALL comp_func_SourceAtop ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 519 of file qdrawhelper_mmx_p.h.

520 {
521  C_FF; C_80; C_00;
522  if (const_alpha == 255) {
523  for (int i = 0; i < length; ++i) {
524  m64 s = MM::load(src[i]);
525  m64 d = MM::load(dest[i]);
526  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::alpha(d), d,
527  MM::negate(MM::alpha(s))));
528  }
529  } else {
530  m64 ca = MM::load_alpha(const_alpha);
531  for (int i = 0; i < length; ++i) {
532  m64 s = MM::load(src[i]);
533  s = MM::byte_mul(s, ca);
534  m64 d = MM::load(dest[i]);
535  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::alpha(d), d,
536  MM::negate(MM::alpha(s))));
537  }
538  }
539  MM::end();
540 }
double d
Definition: qnumeric_p.h:62
__m64 m64
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_SourceIn()

template<class MM >
static void QT_FASTCALL comp_func_SourceIn ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 339 of file qdrawhelper_mmx_p.h.

340 {
341  C_FF; C_80; C_00;
342  if (const_alpha == 255) {
343  for (int i = 0; i < length; ++i) {
344  m64 a = MM::alpha(MM::load(dest[i]));
345  dest[i] = MM::store(MM::byte_mul(MM::load(src[i]), a));
346  }
347  } else {
348  m64 ca = MM::load_alpha(const_alpha);
349  m64 cia = MM::negate(ca);
350  for (int i = 0; i < length; ++i) {
351  m64 d = MM::load(dest[i]);
352  m64 da = MM::byte_mul(MM::alpha(d), ca);
354  MM::load(src[i]), da, d, cia));
355  }
356  }
357  MM::end();
358 }
double d
Definition: qnumeric_p.h:62
__m64 m64
long ASN1_INTEGER_get ASN1_INTEGER * a
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_SourceOut()

template<class MM >
static void QT_FASTCALL comp_func_SourceOut ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 432 of file qdrawhelper_mmx_p.h.

433 {
434  C_FF; C_80; C_00;
435  if (const_alpha == 255) {
436  for (int i = 0; i < length; ++i) {
437  m64 ia = MM::negate(MM::alpha(MM::load(dest[i])));
438  dest[i] = MM::store(MM::byte_mul(MM::load(src[i]), ia));
439  }
440  } else {
441  m64 ca = MM::load_alpha(const_alpha);
442  m64 cia = MM::negate(ca);
443  for (int i = 0; i < length; ++i) {
444  m64 d = MM::load(dest[i]);
445  m64 dia = MM::byte_mul(MM::negate(MM::alpha(d)), ca);
446  dest[i] = MM::store(MM::interpolate_pixel_255(MM::load(src[i]), dia, d, cia));
447  }
448  }
449  MM::end();
450 }
double d
Definition: qnumeric_p.h:62
__m64 m64
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_SourceOver()

template<class MM >
static void QT_FASTCALL comp_func_SourceOver ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 238 of file qdrawhelper_mmx_p.h.

239 {
240  C_FF; C_80; C_00;
241  if (const_alpha == 255) {
242  for (int i = 0; i < length; ++i) {
243  const uint alphaMaskedSource = 0xff000000 & src[i];
244  if (alphaMaskedSource == 0)
245  continue;
246  if (alphaMaskedSource == 0xff000000) {
247  dest[i] = src[i];
248  } else {
249  m64 s = MM::load(src[i]);
250  m64 ia = MM::negate(MM::alpha(s));
251  dest[i] = MM::store(MM::add(s, MM::byte_mul(MM::load(dest[i]), ia)));
252  }
253  }
254  } else {
255  m64 ca = MM::load_alpha(const_alpha);
256  for (int i = 0; i < length; ++i) {
257  if ((0xff000000 & src[i]) == 0)
258  continue;
259  m64 s = MM::byte_mul(MM::load(src[i]), ca);
260  m64 ia = MM::negate(MM::alpha(s));
261  dest[i] = MM::store(MM::add(s, MM::byte_mul(MM::load(dest[i]), ia)));
262  }
263  }
264  MM::end();
265 }
#define add(aName)
__m64 m64
#define C_80
#define C_00
unsigned int uint
Definition: qglobal.h:996
#define load_alpha(x)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ comp_func_XOR()

template<class MM >
static void QT_FASTCALL comp_func_XOR ( uint dest,
const uint src,
int  length,
uint  const_alpha 
)
static

Definition at line 617 of file qdrawhelper_mmx_p.h.

618 {
619  C_FF; C_80; C_00;
620  if (const_alpha == 255) {
621  for (int i = 0; i < length; ++i) {
622  m64 s = MM::load(src[i]);
623  m64 d = MM::load(dest[i]);
624  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::negate(MM::alpha(d)),
625  d, MM::negate(MM::alpha(s))));
626  }
627  } else {
628  m64 ca = MM::load_alpha(const_alpha);
629  for (int i = 0; i < length; ++i) {
630  m64 s = MM::load(src[i]);
631  s = MM::byte_mul(s, ca);
632  m64 d = MM::load(dest[i]);
633  dest[i] = MM::store(MM::interpolate_pixel_255(s, MM::negate(MM::alpha(d)),
634  d, MM::negate(MM::alpha(s))));
635  }
636  }
637  MM::end();
638 }
double d
Definition: qnumeric_p.h:62
__m64 m64
#define C_80
#define C_00
#define load_alpha(x)
#define interpolate_pixel_255(x, a, y, b)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
#define C_FF
#define store(x)
static const KeyPair *const end

◆ qt_blend_color_argb_x86()

template<class MM >
static void qt_blend_color_argb_x86 ( int  count,
const QSpan spans,
void *  userData,
CompositionFunctionSolid solidFunc 
)
inlinestatic

Definition at line 844 of file qdrawhelper_mmx_p.h.

847 {
848  QSpanData *data = reinterpret_cast<QSpanData *>(userData);
851  && qAlpha(data->solid.color) == 255)) {
852  // inline for performance
853  C_FF; C_80; C_00;
854  while (count--) {
855  uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x;
856  if (spans->coverage == 255) {
857  qt_memfill(static_cast<quint32*>(target), quint32(data->solid.color), spans->len);
858  } else {
859  // dest = s * ca + d * (1 - sa*ca) --> dest = s * ca + d * (1-ca)
860  m64 ca = MM::load_alpha(spans->coverage);
861  m64 s = MM::byte_mul(MM::load(data->solid.color), ca);
862  m64 ica = MM::negate(ca);
863  for (int i = 0; i < spans->len; ++i)
864  target[i] = MM::store(MM::add(s, MM::byte_mul(MM::load(target[i]), ica)));
865  }
866  ++spans;
867  }
868  MM::end();
869  return;
870  }
871  CompositionFunctionSolid func = solidFunc[data->rasterBuffer->compositionMode];
872  while (count--) {
873  uint *target = ((uint *)data->rasterBuffer->scanLine(spans->y)) + spans->x;
874  func(target, spans->len, data->solid.color, spans->coverage);
875  ++spans;
876  }
877 }
unsigned char coverage
#define add(aName)
unsigned short len
__m64 m64
QSolidData solid
#define C_80
QPainter::CompositionMode compositionMode
int qAlpha(QRgb rgba)
Returns the alpha component of the ARGB quadruplet rgba.
Definition: qrgb.h:66
#define C_00
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
#define load_alpha(x)
uchar * scanLine(int y)
#define negate(x)
#define byte_mul(a, b)
#define load(x)
QRasterBuffer * rasterBuffer
#define C_FF
#define store(x)
unsigned int quint32
Definition: qglobal.h:938
if(void) toggleToolbarShown
void(QT_FASTCALL * CompositionFunctionSolid)(uint *dest, int length, uint color, uint const_alpha)
static const KeyPair *const end
void qt_memfill(T *dest, T value, int count)

◆ rasterop_solid_NotSource()

template<class MM >
static void QT_FASTCALL rasterop_solid_NotSource ( uint dest,
int  length,
uint  color,
uint  const_alpha 
)
static

Definition at line 826 of file qdrawhelper_mmx_p.h.

828 {
829  Q_UNUSED(const_alpha);
830  qt_memfill((quint32*)dest, ~color | 0xff000000, length);
831 }
unsigned int quint32
Definition: qglobal.h:938
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
void qt_memfill(T *dest, T value, int count)

◆ rasterop_solid_NotSourceAndDestination()

template<class MM >
static void QT_FASTCALL rasterop_solid_NotSourceAndDestination ( uint dest,
int  length,
uint  color,
uint  const_alpha 
)
static

Definition at line 834 of file qdrawhelper_mmx_p.h.

838 {
839  rasterop_solid_SourceAndDestination<MM>(dest, length,
840  ~color, const_alpha);
841 }

◆ rasterop_solid_NotSourceAndNotDestination()

template<class MM >
static void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination ( uint dest,
int  length,
uint  color,
uint  const_alpha 
)
static

Definition at line 793 of file qdrawhelper_mmx_p.h.

797 {
798  rasterop_solid_SourceAndNotDestination<MM>(dest, length,
799  ~color, const_alpha);
800 }

◆ rasterop_solid_NotSourceOrNotDestination()

template<class MM >
static void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination ( uint dest,
int  length,
uint  color,
uint  const_alpha 
)
static

Definition at line 803 of file qdrawhelper_mmx_p.h.

807 {
808  Q_UNUSED(const_alpha);
809  color = ~color | 0xff000000;
810  while (length--) {
811  *dest = color | ~(*dest);
812  ++dest;
813  }
814 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ rasterop_solid_NotSourceXorDestination()

template<class MM >
static void QT_FASTCALL rasterop_solid_NotSourceXorDestination ( uint dest,
int  length,
uint  color,
uint  const_alpha 
)
static

Definition at line 817 of file qdrawhelper_mmx_p.h.

821 {
822  rasterop_solid_SourceXorDestination<MM>(dest, length, ~color, const_alpha);
823 }

◆ rasterop_solid_SourceAndDestination()

template<class MM >
static void QT_FASTCALL rasterop_solid_SourceAndDestination ( uint dest,
int  length,
uint  color,
uint  const_alpha 
)
static

Definition at line 676 of file qdrawhelper_mmx_p.h.

680 {
681  Q_UNUSED(const_alpha);
682 
683  color |= 0xff000000;
684 
685  if ((quintptr)(dest) & 0x7) { // align
686  *dest++ &= color;
687  --length;
688  }
689 
690  const int length64 = length / 2;
691  if (length64) {
692  __m64 *dst64 = reinterpret_cast<__m64*>(dest);
693  const __m64 color64 = _mm_set_pi32(color, color);
694 
695  int n = (length64 + 3) / 4;
696  switch (length64 & 0x3) {
697  case 0: do { *dst64 = _mm_and_si64(*dst64, color64); ++dst64;
698  case 3: *dst64 = _mm_and_si64(*dst64, color64); ++dst64;
699  case 2: *dst64 = _mm_and_si64(*dst64, color64); ++dst64;
700  case 1: *dst64 = _mm_and_si64(*dst64, color64); ++dst64;
701  } while (--n > 0);
702  }
703  }
704 
705  if (length & 0x1) {
706  dest[length - 1] &= color;
707  }
708 
709  MM::end();
710 }
QIntegerForSizeof< void * >::Unsigned quintptr
Definition: qglobal.h:986
static const KeyPair *const end
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ rasterop_solid_SourceAndNotDestination()

template<class MM >
static void QT_FASTCALL rasterop_solid_SourceAndNotDestination ( uint dest,
int  length,
uint  color,
uint  const_alpha 
)
static

Definition at line 750 of file qdrawhelper_mmx_p.h.

754 {
755 
756  Q_UNUSED(const_alpha);
757 
758  if ((quintptr)(dest) & 0x7) {
759  *dest = (color & ~(*dest)) | 0xff000000;
760  ++dest;
761  --length;
762  }
763 
764  const int length64 = length / 2;
765  if (length64) {
766  __m64 *dst64 = reinterpret_cast<__m64*>(dest);
767  const __m64 color64 = _mm_set_pi32(color, color);
768  const m64 mmx_0xff000000 = _mm_set1_pi32(0xff000000);
769  __m64 tmp1, tmp2, tmp3, tmp4;
770 
771  int n = (length64 + 3) / 4;
772  switch (length64 & 0x3) {
773  case 0: do { tmp1 = _mm_andnot_si64(*dst64, color64);
774  *dst64++ = _mm_or_si64(tmp1, mmx_0xff000000);
775  case 3: tmp2 = _mm_andnot_si64(*dst64, color64);
776  *dst64++ = _mm_or_si64(tmp2, mmx_0xff000000);
777  case 2: tmp3 = _mm_andnot_si64(*dst64, color64);
778  *dst64++ = _mm_or_si64(tmp3, mmx_0xff000000);
779  case 1: tmp4 = _mm_andnot_si64(*dst64, color64);
780  *dst64++ = _mm_or_si64(tmp4, mmx_0xff000000);
781  } while (--n > 0);
782  }
783  }
784 
785  if (length & 0x1) {
786  dest[length - 1] = (color & ~(dest[length - 1])) | 0xff000000;
787  }
788 
789  MM::end();
790 }
QIntegerForSizeof< void * >::Unsigned quintptr
Definition: qglobal.h:986
__m64 m64
static const KeyPair *const end
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ rasterop_solid_SourceOrDestination()

template<class MM >
static void QT_FASTCALL rasterop_solid_SourceOrDestination ( uint dest,
int  length,
uint  color,
uint  const_alpha 
)
static

Definition at line 641 of file qdrawhelper_mmx_p.h.

645 {
646  Q_UNUSED(const_alpha);
647 
648  if ((quintptr)(dest) & 0x7) {
649  *dest++ |= color;
650  --length;
651  }
652 
653  const int length64 = length / 2;
654  if (length64) {
655  __m64 *dst64 = reinterpret_cast<__m64*>(dest);
656  const __m64 color64 = _mm_set_pi32(color, color);
657 
658  int n = (length64 + 3) / 4;
659  switch (length64 & 0x3) {
660  case 0: do { *dst64 = _mm_or_si64(*dst64, color64); ++dst64;
661  case 3: *dst64 = _mm_or_si64(*dst64, color64); ++dst64;
662  case 2: *dst64 = _mm_or_si64(*dst64, color64); ++dst64;
663  case 1: *dst64 = _mm_or_si64(*dst64, color64); ++dst64;
664  } while (--n > 0);
665  }
666  }
667 
668  if (length & 0x1) {
669  dest[length - 1] |= color;
670  }
671 
672  MM::end();
673 }
QIntegerForSizeof< void * >::Unsigned quintptr
Definition: qglobal.h:986
static const KeyPair *const end
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ rasterop_solid_SourceXorDestination()

template<class MM >
static void QT_FASTCALL rasterop_solid_SourceXorDestination ( uint dest,
int  length,
uint  color,
uint  const_alpha 
)
static

Definition at line 713 of file qdrawhelper_mmx_p.h.

717 {
718  Q_UNUSED(const_alpha);
719 
720  color &= 0x00ffffff;
721 
722  if ((quintptr)(dest) & 0x7) {
723  *dest++ ^= color;
724  --length;
725  }
726 
727  const int length64 = length / 2;
728  if (length64) {
729  __m64 *dst64 = reinterpret_cast<__m64*>(dest);
730  const __m64 color64 = _mm_set_pi32(color, color);
731 
732  int n = (length64 + 3) / 4;
733  switch (length64 & 0x3) {
734  case 0: do { *dst64 = _mm_xor_si64(*dst64, color64); ++dst64;
735  case 3: *dst64 = _mm_xor_si64(*dst64, color64); ++dst64;
736  case 2: *dst64 = _mm_xor_si64(*dst64, color64); ++dst64;
737  case 1: *dst64 = _mm_xor_si64(*dst64, color64); ++dst64;
738  } while (--n > 0);
739  }
740  }
741 
742  if (length & 0x1) {
743  dest[length - 1] ^= color;
744  }
745 
746  MM::end();
747 }
QIntegerForSizeof< void * >::Unsigned quintptr
Definition: qglobal.h:986
static const KeyPair *const end
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729