Preprocessor purge round 13: X86

This commit is contained in:
Tamás Bálint Misius 2023-01-09 21:59:59 +01:00
parent b16cbf86fc
commit 29d4d4e91c
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
6 changed files with 22 additions and 11 deletions

View File

@ -326,7 +326,7 @@ conf_data.set('LIN', host_platform == 'linux')
conf_data.set('AND', host_platform == 'android') conf_data.set('AND', host_platform == 'android')
conf_data.set('WIN', host_platform == 'windows') conf_data.set('WIN', host_platform == 'windows')
conf_data.set('MACOSX', host_platform == 'darwin') conf_data.set('MACOSX', host_platform == 'darwin')
conf_data.set('X86', is_x86) conf_data.set('X86', is_x86 ? 'true' : 'false')
conf_data.set('BETA', is_beta ? 'true' : 'false') conf_data.set('BETA', is_beta ? 'true' : 'false')
conf_data.set('INSTALL_CHECK', get_option('install_check') ? 'true' : 'false') conf_data.set('INSTALL_CHECK', get_option('install_check') ? 'true' : 'false')
conf_data.set('IGNORE_UPDATES', get_option('ignore_updates') ? 'true' : 'false') conf_data.set('IGNORE_UPDATES', get_option('ignore_updates') ? 'true' : 'false')

View File

@ -10,8 +10,8 @@
#mesondefine AND #mesondefine AND
#mesondefine WIN #mesondefine WIN
#mesondefine MACOSX #mesondefine MACOSX
#mesondefine X86
constexpr bool X86 = @X86@;
constexpr bool BETA = @BETA@; constexpr bool BETA = @BETA@;
constexpr bool SNAPSHOT = @SNAPSHOT@; constexpr bool SNAPSHOT = @SNAPSHOT@;
constexpr bool MOD = @MOD@; constexpr bool MOD = @MOD@;

View File

@ -11,11 +11,6 @@
#endif #endif
#include <SDL.h> #include <SDL.h>
#ifdef X86
# include <xmmintrin.h>
# include <pmmintrin.h>
#endif
#include <iostream> #include <iostream>
#if defined(LIN) #if defined(LIN)
# include "icon_exe.png.h" # include "icon_exe.png.h"
@ -37,6 +32,7 @@
#include <SDL.h> #include <SDL.h>
#include "Format.h" #include "Format.h"
#include "X86KillDenormals.h"
#include "Misc.h" #include "Misc.h"
#include "client/Client.h" #include "client/Client.h"
@ -833,10 +829,10 @@ int main(int argc, char * argv[])
} }
#endif #endif
#ifdef X86 if constexpr (X86)
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); {
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); X86KillDenormals();
#endif }
GameController * gameController = NULL; GameController * gameController = NULL;

9
src/X86KillDenormals.cpp Normal file
View File

@ -0,0 +1,9 @@
#include "X86KillDenormals.h"
#include <xmmintrin.h>
#include <pmmintrin.h>
void X86KillDenormals()
{
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
}

3
src/X86KillDenormals.h Normal file
View File

@ -0,0 +1,3 @@
#pragma once
void X86KillDenormals();

View File

@ -9,6 +9,9 @@ powder_files = files(
'lua/TPTScriptInterface.cpp', 'lua/TPTScriptInterface.cpp',
'lua/TPTSTypes.cpp', 'lua/TPTSTypes.cpp',
) )
if is_x86
powder_files += files('X86KillDenormals.cpp')
endif
render_files = files( render_files = files(
'PowderToyRenderer.cpp', 'PowderToyRenderer.cpp',