office-gobmx/external/skia/fix-sse.patch.1
Luboš Luňák 647499ef81 prefer building Skia with Clang if possible (tdf#131697)
I.e. try to find and use Clang even if the default compiler is
something else. Skia is optimized to be built with Clang(-cl)
and in CPU-based raster mode some operations are several times
slower if built with something else (e.g. fmax/fmin do not get
optimized to inline assembly).
It is enough to select Clang to be installed in the MSVS installer.
At this point it unclear how to handle release binaries, if it
should work this way and enforced, or maybe Clang could be used
for building everything, or maybe some other way.

Change-Id: I6b95a0f2d5cbf176942d9e01136990b14be6dba8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92415
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-04-20 11:16:01 +02:00

23 lines
1.1 KiB
Groff

--- a/src/opts/SkRasterPipeline_opts.h
+++ b/src/opts/SkRasterPipeline_opts.h
@@ -1047,7 +1047,7 @@ static const size_t N = sizeof(F) / sizeof(float);
// TODO: crashes during compilation :(
#define ABI __attribute__((sysv_abi))
#define JUMPER_NARROW_STAGES 0
-#elif defined(_MSC_VER)
+#elif defined(_MSC_VER) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
// Even if not vectorized, this lets us pass {r,g,b,a} as registers,
// instead of {b,a} on the stack. Narrow stages work best for __vectorcall.
#define ABI __vectorcall
--- a/include/private/SkVx.h
+++ b/include/private/SkVx.h
@@ -515,9 +515,6 @@ static inline Vec<N,uint8_t> approx_scale(const Vec<N,uint8_t>& x, const Vec<N,u
static inline Vec<4,float> rcp(const Vec<4,float>& x) {
return bit_pun<Vec<4,float>>(_mm_rcp_ps(bit_pun<__m128>(x)));
}
- static inline Vec<4,int> lrint(const Vec<4,float>& x) {
- return bit_pun<Vec<4,int>>(_mm_cvtps_epi32(bit_pun<__m128>(x)));
- }
static inline Vec<2,float> sqrt(const Vec<2,float>& x) {
return shuffle<0,1>( sqrt(shuffle<0,1,0,1>(x)));