Commit 2b3d1401 authored by Dmitry Kazakov's avatar Dmitry Kazakov Committed by Thorsten Zachmann

Use Vc::float_v::size() instead of Vc::float_v::Size

According to Vir the latter one is deprecated

(cherry picked from commit 9f8b517f)
parent f99de4bc
...@@ -227,7 +227,7 @@ QVector<Tile> generateTiles(int size, ...@@ -227,7 +227,7 @@ QVector<Tile> generateTiles(int size,
QVector<Tile> tiles(size); QVector<Tile> tiles(size);
#ifdef HAVE_VC #ifdef HAVE_VC
const int vecSize = Vc::float_v::Size; const int vecSize = Vc::float_v::size();
#else #else
const int vecSize = 1; const int vecSize = 1;
#endif #endif
...@@ -472,7 +472,7 @@ void checkRounding(qreal opacity, qreal flow, qreal averageOpacity = -1, quint32 ...@@ -472,7 +472,7 @@ void checkRounding(qreal opacity, qreal flow, qreal averageOpacity = -1, quint32
QVector<Tile> tiles = QVector<Tile> tiles =
generateTiles(2, 0, 0, ALPHA_RANDOM, ALPHA_RANDOM, pixelSize); generateTiles(2, 0, 0, ALPHA_RANDOM, ALPHA_RANDOM, pixelSize);
const int vecSize = Vc::float_v::Size; const int vecSize = Vc::float_v::size();
const int numBlocks = numPixels / vecSize; const int numBlocks = numPixels / vecSize;
...@@ -810,7 +810,7 @@ void KisCompositionBenchmark::benchmarkMemcpy() ...@@ -810,7 +810,7 @@ void KisCompositionBenchmark::benchmarkMemcpy()
} }
#ifdef HAVE_VC #ifdef HAVE_VC
const int vecSize = Vc::float_v::Size; const int vecSize = Vc::float_v::size();
const size_t uint8VecAlignment = qMax(vecSize * sizeof(quint8), sizeof(void*)); const size_t uint8VecAlignment = qMax(vecSize * sizeof(quint8), sizeof(void*));
const size_t uint32VecAlignment = qMax(vecSize * sizeof(quint32), sizeof(void*)); const size_t uint32VecAlignment = qMax(vecSize * sizeof(quint32), sizeof(void*));
const size_t floatVecAlignment = qMax(vecSize * sizeof(float), sizeof(void*)); const size_t floatVecAlignment = qMax(vecSize * sizeof(float), sizeof(void*));
...@@ -835,7 +835,7 @@ void KisCompositionBenchmark::benchmarkUintFloat() ...@@ -835,7 +835,7 @@ void KisCompositionBenchmark::benchmarkUintFloat()
float *fData = (float*)ptr; float *fData = (float*)ptr;
QBENCHMARK { QBENCHMARK {
for (int i = 0; i < dataSize; i += Vc::float_v::Size) { for (int i = 0; i < dataSize; i += Vc::float_v::size()) {
// convert uint -> float directly, this causes // convert uint -> float directly, this causes
// static_cast helper be called // static_cast helper be called
Vc::float_v b(uint_v(iData + i)); Vc::float_v b(uint_v(iData + i));
...@@ -868,7 +868,7 @@ void KisCompositionBenchmark::benchmarkUintIntFloat() ...@@ -868,7 +868,7 @@ void KisCompositionBenchmark::benchmarkUintIntFloat()
float *fData = (float*)ptr; float *fData = (float*)ptr;
QBENCHMARK { QBENCHMARK {
for (int i = 0; i < dataSize; i += Vc::float_v::Size) { for (int i = 0; i < dataSize; i += Vc::float_v::size()) {
// convert uint->int->float, that avoids special sign // convert uint->int->float, that avoids special sign
// treating, and gives 2.6 times speedup // treating, and gives 2.6 times speedup
Vc::float_v b(int_v(uint_v(iData + i))); Vc::float_v b(int_v(uint_v(iData + i)));
...@@ -900,7 +900,7 @@ void KisCompositionBenchmark::benchmarkFloatUint() ...@@ -900,7 +900,7 @@ void KisCompositionBenchmark::benchmarkFloatUint()
float *fData = (float*)ptr; float *fData = (float*)ptr;
QBENCHMARK { QBENCHMARK {
for (int i = 0; i < dataSize; i += Vc::float_v::Size) { for (int i = 0; i < dataSize; i += Vc::float_v::size()) {
// conversion float -> uint // conversion float -> uint
uint_v b(Vc::float_v(fData + i)); uint_v b(Vc::float_v(fData + i));
...@@ -933,7 +933,7 @@ void KisCompositionBenchmark::benchmarkFloatIntUint() ...@@ -933,7 +933,7 @@ void KisCompositionBenchmark::benchmarkFloatIntUint()
float *fData = (float*)ptr; float *fData = (float*)ptr;
QBENCHMARK { QBENCHMARK {
for (int i = 0; i < dataSize; i += Vc::float_v::Size) { for (int i = 0; i < dataSize; i += Vc::float_v::size()) {
// conversion float -> int -> uint // conversion float -> int -> uint
uint_v b(int_v(Vc::float_v(fData + i))); uint_v b(int_v(Vc::float_v(fData + i)));
......
...@@ -71,7 +71,7 @@ FastRowProcessor::process<Vc::CurrentImplementation::current()>(float* buffer, i ...@@ -71,7 +71,7 @@ FastRowProcessor::process<Vc::CurrentImplementation::current()>(float* buffer, i
Vc::float_v currentIndices = Vc::float_v::IndexesFromZero(); Vc::float_v currentIndices = Vc::float_v::IndexesFromZero();
Vc::float_v increment((float)Vc::float_v::Size); Vc::float_v increment((float)Vc::float_v::size());
Vc::float_v vCenterX(centerX); Vc::float_v vCenterX(centerX);
Vc::float_v vCosa(cosa); Vc::float_v vCosa(cosa);
...@@ -87,7 +87,7 @@ FastRowProcessor::process<Vc::CurrentImplementation::current()>(float* buffer, i ...@@ -87,7 +87,7 @@ FastRowProcessor::process<Vc::CurrentImplementation::current()>(float* buffer, i
Vc::float_v vOne(Vc::One); Vc::float_v vOne(Vc::One);
for (int i=0; i < width; i+= Vc::float_v::Size){ for (int i=0; i < width; i+= Vc::float_v::size()){
Vc::float_v x_ = currentIndices - vCenterX; Vc::float_v x_ = currentIndices - vCenterX;
...@@ -130,7 +130,7 @@ FastRowProcessor::process<Vc::CurrentImplementation::current()>(float* buffer, i ...@@ -130,7 +130,7 @@ FastRowProcessor::process<Vc::CurrentImplementation::current()>(float* buffer, i
currentIndices = currentIndices + increment; currentIndices = currentIndices + increment;
bufferPointer += Vc::float_v::Size; bufferPointer += Vc::float_v::size();
} }
} }
......
...@@ -110,8 +110,8 @@ void KisBrushMaskVectorApplicator<MaskGenerator, _impl>::processVector(const QRe ...@@ -110,8 +110,8 @@ void KisBrushMaskVectorApplicator<MaskGenerator, _impl>::processVector(const QRe
// We need to calculate with a multiple of the width of the simd register // We need to calculate with a multiple of the width of the simd register
int alignOffset = 0; int alignOffset = 0;
if (width % Vc::float_v::Size != 0) { if (width % Vc::float_v::size() != 0) {
alignOffset = Vc::float_v::Size - (width % Vc::float_v::Size); alignOffset = Vc::float_v::size() - (width % Vc::float_v::size());
} }
int simdWidth = width + alignOffset; int simdWidth = width + alignOffset;
......
...@@ -47,7 +47,7 @@ struct AlphaDarkenCompositor128 { ...@@ -47,7 +47,7 @@ struct AlphaDarkenCompositor128 {
/** /**
* This is a vector equivalent of compositeOnePixelScalar(). It is considered * This is a vector equivalent of compositeOnePixelScalar(). It is considered
* to process Vc::float_v::Size pixels in a single pass. * to process Vc::float_v::size() pixels in a single pass.
* *
* o the \p haveMask parameter points whether the real (non-null) mask * o the \p haveMask parameter points whether the real (non-null) mask
* pointer is passed to the function. * pointer is passed to the function.
......
...@@ -42,7 +42,7 @@ struct AlphaDarkenCompositor32 { ...@@ -42,7 +42,7 @@ struct AlphaDarkenCompositor32 {
/** /**
* This is a vector equivalent of compositeOnePixelScalar(). It is considered * This is a vector equivalent of compositeOnePixelScalar(). It is considered
* to process Vc::float_v::Size pixels in a single pass. * to process Vc::float_v::size() pixels in a single pass.
* *
* o the \p haveMask parameter points whether the real (non-null) mask * o the \p haveMask parameter points whether the real (non-null) mask
* pointer is passed to the function. * pointer is passed to the function.
...@@ -111,7 +111,7 @@ struct AlphaDarkenCompositor32 { ...@@ -111,7 +111,7 @@ struct AlphaDarkenCompositor32 {
} else if (srcAlphaIsUnit) { } else if (srcAlphaIsUnit) {
bool dstAlphaIsUnit = (dst_alpha == uint8Max).isFull(); bool dstAlphaIsUnit = (dst_alpha == uint8Max).isFull();
if (dstAlphaIsUnit) { if (dstAlphaIsUnit) {
memcpy(dst, src, 4 * Vc::float_v::Size); memcpy(dst, src, 4 * Vc::float_v::size());
return; return;
} else { } else {
dst_c1 = src_c1; dst_c1 = src_c1;
......
...@@ -109,7 +109,7 @@ struct OverCompositor32 { ...@@ -109,7 +109,7 @@ struct OverCompositor32 {
} else { } else {
if (!haveMask && !haveOpacity) { if (!haveMask && !haveOpacity) {
memcpy(dst, src, 4 * Vc::float_v::Size); memcpy(dst, src, 4 * Vc::float_v::size());
return; return;
} else { } else {
// opacity has changed the alpha of the source, // opacity has changed the alpha of the source,
......
...@@ -111,7 +111,7 @@ static inline quint8 lerp_mixed_u8_float(quint8 a, quint8 b, float alpha) { ...@@ -111,7 +111,7 @@ static inline quint8 lerp_mixed_u8_float(quint8 a, quint8 b, float alpha) {
} }
/** /**
* Get a vector containing first Vc::float_v::Size values of mask. * Get a vector containing first Vc::float_v::size() values of mask.
* Each source mask element is considered to be a 8-bit integer * Each source mask element is considered to be a 8-bit integer
*/ */
static inline Vc::float_v fetch_mask_8(const quint8 *data) { static inline Vc::float_v fetch_mask_8(const quint8 *data) {
...@@ -120,7 +120,7 @@ static inline Vc::float_v fetch_mask_8(const quint8 *data) { ...@@ -120,7 +120,7 @@ static inline Vc::float_v fetch_mask_8(const quint8 *data) {
} }
/** /**
* Get an alpha values from Vc::float_v::Size pixels 32-bit each * Get an alpha values from Vc::float_v::size() pixels 32-bit each
* (4 channels, 8 bit per channel). The alpha value is considered * (4 channels, 8 bit per channel). The alpha value is considered
* to be stored in the most significat byte of the pixel * to be stored in the most significat byte of the pixel
* *
...@@ -144,7 +144,7 @@ static inline Vc::float_v fetch_alpha_32(const quint8 *data) { ...@@ -144,7 +144,7 @@ static inline Vc::float_v fetch_alpha_32(const quint8 *data) {
} }
/** /**
* Get color values from Vc::float_v::Size pixels 32-bit each * Get color values from Vc::float_v::size() pixels 32-bit each
* (4 channels, 8 bit per channel). The color data is considered * (4 channels, 8 bit per channel). The color data is considered
* to be stored in the 3 least significant bytes of the pixel. * to be stored in the 3 least significant bytes of the pixel.
* *
...@@ -176,7 +176,7 @@ static inline void fetch_colors_32(const quint8 *data, ...@@ -176,7 +176,7 @@ static inline void fetch_colors_32(const quint8 *data,
} }
/** /**
* Pack color and alpha values to Vc::float_v::Size pixels 32-bit each * Pack color and alpha values to Vc::float_v::size() pixels 32-bit each
* (4 channels, 8 bit per channel). The color data is considered * (4 channels, 8 bit per channel). The color data is considered
* to be stored in the 3 least significant bytes of the pixel, alpha - * to be stored in the 3 least significant bytes of the pixel, alpha -
* in the most significant byte * in the most significant byte
...@@ -218,7 +218,7 @@ template<bool useMask, bool useFlow, class Compositor, int pixelSize> ...@@ -218,7 +218,7 @@ template<bool useMask, bool useFlow, class Compositor, int pixelSize>
{ {
using namespace Arithmetic; using namespace Arithmetic;
const int vectorSize = Vc::float_v::Size; const int vectorSize = Vc::float_v::size();
const qint32 vectorInc = pixelSize * vectorSize; const qint32 vectorInc = pixelSize * vectorSize;
const qint32 linearInc = pixelSize; const qint32 linearInc = pixelSize;
qint32 srcVectorInc = vectorInc; qint32 srcVectorInc = vectorInc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment