[Scummvm-git-logs] scummvm master -> 94755eb83876e357c82445a20e9794c40184778b

sev- noreply at scummvm.org
Sun Sep 3 20:47:33 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
94755eb838 BUILD: MACOS: Fix building with NEON enabled


Commit: 94755eb83876e357c82445a20e9794c40184778b
    https://github.com/scummvm/scummvm/commit/94755eb83876e357c82445a20e9794c40184778b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-09-03T22:47:00+02:00

Commit Message:
BUILD: MACOS: Fix building with NEON enabled

Changed paths:
    engines/ags/lib/allegro/surface_neon.cpp
    graphics/blit/blit-neon.cpp


diff --git a/engines/ags/lib/allegro/surface_neon.cpp b/engines/ags/lib/allegro/surface_neon.cpp
index 831efea7456..5fa0f273fad 100644
--- a/engines/ags/lib/allegro/surface_neon.cpp
+++ b/engines/ags/lib/allegro/surface_neon.cpp
@@ -19,9 +19,11 @@
  *
  */
 
+#include "ags/ags.h"
+
 #ifdef SCUMMVM_NEON
+
 #include <arm_neon.h>
-#include "ags/ags.h"
 #include "ags/globals.h"
 #include "ags/lib/allegro/color.h"
 #include "ags/lib/allegro/flood.h"
@@ -224,7 +226,7 @@ inline uint32x4_t blendTintSpriteSIMD(uint32x4_t srcCols, uint32x4_t destCols, u
 	const float32x4_t eplison0 = vmovq_n_f32(0.0000001);
 
 	float32x4_t chroma = vmaxq_f32(vsubq_f32(smaxes, smins), eplison0);
-	
+
 	// RGB to HSV is a piecewise function, so we compute each part of the function first...
 	float32x4_t hr, hg, hb, hue, chromaReq;
 	chromaReq = vrecpeq_f32(chroma);
diff --git a/graphics/blit/blit-neon.cpp b/graphics/blit/blit-neon.cpp
index 60a65c59fde..8f7480b566d 100644
--- a/graphics/blit/blit-neon.cpp
+++ b/graphics/blit/blit-neon.cpp
@@ -19,8 +19,9 @@
  *
  */
 
-#ifdef SCUMMVM_NEON
 #include "common/scummsys.h"
+
+#ifdef SCUMMVM_NEON
 #include <arm_neon.h>
 
 #include "graphics/blit.h"
@@ -37,7 +38,7 @@ struct AlphaBlend {
         else
             ina = vandq_u32(src, vmovq_n_u32(BlendBlit::kAModMask));
         uint32x4_t alphaMask = vceqq_u32(ina, vmovq_n_u32(0));
-    
+
         if (rgbmod) {
             uint32x4_t dstR = vshrq_n_u32(vandq_u32(dst, vmovq_n_u32(BlendBlit::kRModMask)), 16);
             uint32x4_t srcR = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kRModMask)), 16);
@@ -45,7 +46,7 @@ struct AlphaBlend {
             uint32x4_t srcG = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kGModMask)), 8);
             uint32x4_t dstB = vandq_u32(dst, vmovq_n_u32(BlendBlit::kBModMask));
             uint32x4_t srcB = vandq_u32(src, vmovq_n_u32(BlendBlit::kBModMask));
-    
+
             dstR = vshrq_n_u32(vmulq_u32(dstR, vsubq_u32(vmovq_n_u32(255), ina)), 8);
             dstG = vshrq_n_u32(vmulq_u32(dstG, vsubq_u32(vmovq_n_u32(255), ina)), 8);
             dstB = vshrq_n_u32(vmulq_u32(dstB, vsubq_u32(vmovq_n_u32(255), ina)), 8);
@@ -60,7 +61,7 @@ struct AlphaBlend {
             uint32x4_t srcRB = vshrq_n_u32(vandq_u32(src, vmovq_n_u32(BlendBlit::kRModMask | BlendBlit::kBModMask)), 8);
             uint32x4_t dstG = vandq_u32(dst, vmovq_n_u32(BlendBlit::kGModMask));
             uint32x4_t srcG = vandq_u32(src, vmovq_n_u32(BlendBlit::kGModMask));
-    
+
             dstRB = vmulq_u32(dstRB, vsubq_u32(vmovq_n_u32(255), ina));
             dstG = vshrq_n_u32(vmulq_u32(dstG, vsubq_u32(vmovq_n_u32(255), ina)), 8);
             srcRB = vaddq_u32(dstRB, vmulq_u32(srcRB, ina));
@@ -68,7 +69,7 @@ struct AlphaBlend {
             src = vorrq_u32(vandq_u32(srcG, vmovq_n_u32(BlendBlit::kGModMask)), vmovq_n_u32(BlendBlit::kAModMask));
             src = vorrq_u32(vandq_u32(srcRB, vmovq_n_u32(BlendBlit::kBModMask | BlendBlit::kRModMask)), src);
         }
-    
+
         dst = vandq_u32(alphaMask, dst);
         src = vandq_u32(vmvnq_u32(alphaMask), src);
         return vorrq_u32(dst, src);
@@ -326,7 +327,7 @@ static inline void blitInnerLoop(BlendBlit::Args &args) {
             }
 
             PixelFunc<doscale, rgbmod, alphamod>::normal(in, out, ca, cr, cg, cb);
-            
+
             if (doscale)
                 scaleXCtr += args.scaleX;
             else




More information about the Scummvm-git-logs mailing list