1 --- ClanLib-3.0.0/configure.ac~ 2013-11-05 19:52:09.000000000 +0100
2 +++ ClanLib-3.0.0/configure.ac 2013-11-05 20:42:25.891716845 +0100
4 AC_MSG_RESULT([enabled])
7 + AC_DEFINE(DISABLE_SSE2)
8 AC_DEFINE(CL_DISABLE_SSE2)
9 AC_MSG_RESULT([disabled])
14 AC_MSG_WARN( [ *** Compliler does not support SSE2 ])
15 + AC_DEFINE(DISABLE_SSE2)
16 AC_DEFINE(CL_DISABLE_SSE2)
17 AC_MSG_RESULT([disabled])
21 extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -msse2"
23 - extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -DCL_DISABLE_SSE2"
24 + extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -DCL_DISABLE_SSE2 -DDISABLE_SSE2"
26 extra_CFLAGS_clanCore="$extra_CFLAGS_clanCore -pthread -std=c++0x"
28 --- ClanLib-3.0.0/Sources/Display/Image/pixel_converter.cpp~ 2013-09-24 13:53:31.000000000 +0200
29 +++ ClanLib-3.0.0/Sources/Display/Image/pixel_converter.cpp 2013-11-05 20:57:39.298376899 +0100
31 #include "pixel_reader_half_float.h"
32 #include "pixel_reader_norm.h"
33 #include "pixel_reader_special.h"
35 #include "pixel_reader_sse.h"
37 #include "pixel_writer_cast.h"
38 #include "pixel_writer_half_float.h"
39 #include "pixel_writer_norm.h"
40 #include "pixel_writer_special.h"
42 #include "pixel_writer_sse.h"
44 #include "pixel_filter_gamma.h"
45 #include "pixel_filter_premultiply_alpha.h"
46 #include "pixel_filter_swizzle.h"
49 void PixelConverter::convert(void *output, int output_pitch, TextureFormat output_format, const void *input, int input_pitch, TextureFormat input_format, int width, int height)
52 bool sse2 = System::detect_cpu_extension(System::sse2);
53 bool sse4 = System::detect_cpu_extension(System::sse4_1);
59 std::unique_ptr<PixelReader> reader = impl->create_reader(input_format, sse2);
60 std::unique_ptr<PixelWriter> writer = impl->create_writer(output_format, sse2, sse4);
67 return std::unique_ptr<PixelReader>(new PixelReaderSSE2_bgra8());
70 return std::unique_ptr<PixelReader>(new PixelReader_bgra8());
72 return std::unique_ptr<PixelReader>(new PixelReader_bgr8());
75 return std::unique_ptr<PixelReader>(new PixelReader_rgb5_a1());
79 return std::unique_ptr<PixelReader>(new PixelReaderSSE2_rgba8());
82 return std::unique_ptr<PixelReader>(new PixelReader_4norm<unsigned char>());
84 return std::unique_ptr<PixelReader>(new PixelReader_4norm<char>());
91 return std::unique_ptr<PixelReader>(new PixelReaderSSE2_rgba16());
94 return std::unique_ptr<PixelReader>(new PixelReader_4norm<unsigned short>());
96 return std::unique_ptr<PixelReader>(new PixelReader_4norm<short>());
98 return std::unique_ptr<PixelReader>(new PixelReader_3norm<unsigned char>()); // TBD: should we add a 2.2 gamma filter?
100 +#ifndef DISABLE_SSE2
102 return std::unique_ptr<PixelReader>(new PixelReaderSSE2_rgba8());
105 return std::unique_ptr<PixelReader>(new PixelReader_4norm<char>()); // TBD: should we add a 2.2 gamma filter?
107 return std::unique_ptr<PixelReader>(new PixelReader_1hf());
112 +#ifndef DISABLE_SSE2
114 return std::unique_ptr<PixelWriter>(new PixelWriterSSE2_bgra8());
117 return std::unique_ptr<PixelWriter>(new PixelWriter_bgra8());
119 return std::unique_ptr<PixelWriter>(new PixelWriter_bgr8());
122 return std::unique_ptr<PixelWriter>(new PixelWriter_rgb5_a1());
124 +#ifndef DISABLE_SSE2
126 return std::unique_ptr<PixelWriter>(new PixelWriterSSE2_rgba8());
129 return std::unique_ptr<PixelWriter>(new PixelWriter_4norm<unsigned char>());
131 return std::unique_ptr<PixelWriter>(new PixelWriter_4norm<char>());
134 return std::unique_ptr<PixelWriter>(new PixelWriter_3norm<unsigned char>()); // TBD: should we add a 2.2 gamma filter?
135 case tf_srgb8_alpha8:
136 +#ifndef DISABLE_SSE2
138 return std::unique_ptr<PixelWriter>(new PixelWriterSSE2_rgba8());
141 return std::unique_ptr<PixelWriter>(new PixelWriter_4norm<char>()); // TBD: should we add a 2.2 gamma filter?
143 return std::unique_ptr<PixelWriter>(new PixelWriter_1hf());
144 @@ -525,41 +539,51 @@
148 +#ifndef DISABLE_SSE2
150 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSSE2_YCrCbToRGB()));
153 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterYCrCbToRGB()));
156 if (premultiply_alpha)
158 +#ifndef DISABLE_SSE2
160 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterPremultiplyAlphaSSE2()));
163 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterPremultiplyAlpha()));
168 +#ifndef DISABLE_SSE2
170 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterGammaSSE2(gamma)));
173 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterGamma(gamma)));
176 if (swizzle != Vec4i(0,1,2,3))
178 +#ifndef DISABLE_SSE2
180 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSwizzleSSE2(swizzle)));
183 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSwizzle(swizzle)));
188 +#ifndef DISABLE_SSE2
190 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterSSE2_RGBToYCrCb()));
193 filters.push_back(std::shared_ptr<PixelFilter>(new PixelFilterRGBToYCrCb()));
196 --- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_gamma.h~ 2013-09-24 13:53:31.000000000 +0200
197 +++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_gamma.h 2013-11-05 21:00:27.261709016 +0100
202 +#ifndef DISABLE_SSE2
203 class PixelFilterGammaSSE2 : public PixelFilter
213 --- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_premultiply_alpha.h~ 2013-09-24 13:53:31.000000000 +0200
214 +++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_premultiply_alpha.h 2013-11-05 21:01:03.885042084 +0100
219 +#ifndef DISABLE_SSE2
220 class PixelFilterPremultiplyAlphaSSE2 : public PixelFilter
230 --- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_swizzle.h~ 2013-09-24 13:53:31.000000000 +0200
231 +++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_swizzle.h 2013-11-05 21:01:17.849463650 +0100
233 Vec4f red, green, blue, alpha;
236 +#ifndef DISABLE_SSE2
237 class PixelFilterSwizzleSSE2 : public PixelFilter
242 __m128 red_mask, green_mask, blue_mask, alpha_mask;
247 --- ClanLib-3.0.0/Sources/Display/Image/pixel_filter_rgb_to_ycrcb.h~ 2013-09-24 13:53:31.000000000 +0200
248 +++ ClanLib-3.0.0/Sources/Display/Image/pixel_filter_rgb_to_ycrcb.h 2013-11-05 21:01:44.896313454 +0100
252 #include "pixel_converter_impl.h"
253 +#ifndef DISABLE_SSE2
254 #include <emmintrin.h>
263 +#ifndef DISABLE_SSE2
264 class PixelFilterSSE2_RGBToYCrCb : public PixelFilter
274 --- ClanLib-3.0.0/Sources/Display/Image/pixel_buffer_impl.cpp~ 2013-09-24 13:53:31.000000000 +0200
275 +++ ClanLib-3.0.0/Sources/Display/Image/pixel_buffer_impl.cpp 2013-11-05 21:22:05.346632850 +0100
277 #include "API/Display/TargetProviders/graphic_context_provider.h"
278 #include "API/Display/TargetProviders/pixel_buffer_provider.h"
279 #include "API/Display/Image/pixel_converter.h"
280 +#ifndef DISABLE_SSE2
281 #include <emmintrin.h>
286 --- ClanLib-3.0.0/Sources/Display/Image/pixel_writer_sse.h~ 2013-09-24 13:53:31.000000000 +0200
287 +++ ClanLib-3.0.0/Sources/Display/Image/pixel_writer_sse.h 2013-11-05 21:23:32.719965551 +0100
290 #include "pixel_converter_impl.h"
292 +#ifndef DISABLE_SSE2
293 #if defined(__SSE4_1__)
294 #include <smmintrin.h>
296 #include <emmintrin.h>