mirror of
https://github.com/bkaradzic/bx.git
synced 2026-10-29 12:05:42 +00:00
MSVC: Added ARM64 target. (#412)
This commit is contained in:
@@ -14,18 +14,20 @@ jobs:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include: [
|
||||
{ config: Debug, platform: x64, bindir: 'win64_vs2022', genie-action: 'vs2022', solution-ext: 'sln' },
|
||||
{ config: Release, platform: x64, bindir: 'win64_vs2022', genie-action: 'vs2022', solution-ext: 'sln' },
|
||||
{ config: Debug, platform: x64, runs-on: windows-latest, bindir: 'win64_vs2022', genie-action: 'vs2022', solution-ext: 'sln' },
|
||||
{ config: Release, platform: x64, runs-on: windows-latest, bindir: 'win64_vs2022', genie-action: 'vs2022', solution-ext: 'sln' },
|
||||
{ config: Debug, platform: ARM64, runs-on: windows-11-arm, bindir: 'arm64_vs2022', genie-action: 'vs2022', solution-ext: 'sln' },
|
||||
{ config: Release, platform: ARM64, runs-on: windows-11-arm, bindir: 'arm64_vs2022', genie-action: 'vs2022', solution-ext: 'sln' },
|
||||
# { config: Debug, platform: x64, bindir: 'win64_vs2026', genie-action: 'vs2026', solution-ext: 'slnx' },
|
||||
# { config: Release, platform: x64, bindir: 'win64_vs2026', genie-action: 'vs2026', solution-ext: 'slnx' },
|
||||
]
|
||||
name: msvc-${{ matrix.config }}-${{ matrix.platform }}
|
||||
runs-on: windows-latest
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
steps:
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
repository: ${{ github.repository }}
|
||||
path: bx
|
||||
- name: Prepare
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
@@ -54,7 +56,7 @@ jobs:
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
repository: ${{ github.repository }}
|
||||
path: bx
|
||||
- name: Prepare
|
||||
uses: msys2/setup-msys2@v2
|
||||
@@ -90,7 +92,7 @@ jobs:
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
repository: ${{ github.repository }}
|
||||
path: bx
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -115,7 +117,7 @@ jobs:
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
repository: ${{ github.repository }}
|
||||
path: bx
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -140,7 +142,7 @@ jobs:
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
repository: ${{ github.repository }}
|
||||
path: bx
|
||||
- uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
@@ -169,7 +171,7 @@ jobs:
|
||||
- name: Checkout bx
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: bkaradzic/bx
|
||||
repository: ${{ github.repository }}
|
||||
path: bx
|
||||
- uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
|
||||
@@ -357,9 +357,10 @@ namespace bx
|
||||
const float absA = abs(aa);
|
||||
const float cosA = cos(absA);
|
||||
const float cosASq = square(cosA);
|
||||
const float tmp0 = sqrt(1.0f - cosASq);
|
||||
const float tmp1 = aa > 0.0f && aa < kPi ? 1.0f : -1.0f;
|
||||
const float sinA = mul(tmp0, tmp1);
|
||||
const float tmp0 = max(0.0f, 1.0f - cosASq);
|
||||
const float tmp1 = sqrt(tmp0);
|
||||
const float tmp2 = aa > 0.0f && aa < kPi ? 1.0f : -1.0f;
|
||||
const float sinA = mul(tmp1, tmp2);
|
||||
|
||||
_outSinApprox = sinA;
|
||||
_outCos = cosA;
|
||||
|
||||
@@ -85,7 +85,8 @@
|
||||
// http://sourceforge.net/apps/mediawiki/predef/index.php?title=Architectures
|
||||
#if defined(__arm__) \
|
||||
|| defined(__aarch64__) \
|
||||
|| defined(_M_ARM)
|
||||
|| defined(_M_ARM) \
|
||||
|| defined(_M_ARM64)
|
||||
# undef BX_CPU_ARM
|
||||
# define BX_CPU_ARM 1
|
||||
# define BX_CACHE_LINE_SIZE 64
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@
|
||||
# define BX_SIMD_AVX 1
|
||||
#endif //
|
||||
|
||||
#if defined(__SSE2__) || (BX_COMPILER_MSVC && (BX_ARCH_64BIT || _M_IX86_FP >= 2) )
|
||||
#if BX_CPU_X86 && (defined(__SSE2__) || (BX_COMPILER_MSVC && (BX_ARCH_64BIT || _M_IX86_FP >= 2) ) )
|
||||
# include <emmintrin.h>
|
||||
# include <smmintrin.h> // SSE4.1 minspec is SSE4.2 so always available
|
||||
# if defined(__SSE4_2__) || BX_COMPILER_MSVC
|
||||
|
||||
+12
-1
@@ -435,6 +435,9 @@ function toolchain(_buildDir, _libDir)
|
||||
action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform
|
||||
end
|
||||
|
||||
-- Windows on ARM64 is a desktop target for MSVC.
|
||||
platforms { "ARM64" }
|
||||
|
||||
if (_ACTION .. "-clang") == _OPTIONS["vs"] then
|
||||
if "vs2017-clang" == _OPTIONS["vs"] then
|
||||
premake.vstudio.toolset = "v141_clang_c2"
|
||||
@@ -548,7 +551,7 @@ function toolchain(_buildDir, _libDir)
|
||||
"-Wno-tautological-constant-compare",
|
||||
}
|
||||
|
||||
configuration { "vs*", "not NX32", "not NX64" }
|
||||
configuration { "vs*", "not ARM64", "not NX32", "not NX64" }
|
||||
flags {
|
||||
"EnableAVX",
|
||||
}
|
||||
@@ -592,6 +595,14 @@ function toolchain(_buildDir, _libDir)
|
||||
path.join(_libDir, "lib/win64_" .. _ACTION),
|
||||
}
|
||||
|
||||
configuration { "ARM64", "vs*" }
|
||||
defines { "_WIN64" }
|
||||
targetdir (path.join(_buildDir, "arm64_" .. _ACTION, "bin"))
|
||||
objdir (path.join(_buildDir, "arm64_" .. _ACTION, "obj"))
|
||||
libdirs {
|
||||
path.join(_libDir, "lib/arm64_" .. _ACTION),
|
||||
}
|
||||
|
||||
configuration { "x32", "vs2017" }
|
||||
targetdir (path.join(_buildDir, "win32_" .. _ACTION, "bin"))
|
||||
objdir (path.join(_buildDir, "win32_" .. _ACTION, "obj"))
|
||||
|
||||
@@ -226,7 +226,9 @@ TEST_CASE("Format %f", "[string][printf]")
|
||||
REQUIRE(test("4.1", "%.1f", 4.1) );
|
||||
REQUIRE(test("0.00", "%.2f", 1e-4) );
|
||||
REQUIRE(test("-5.20", "%+4.2f", -5.2) );
|
||||
REQUIRE(test("0.0 ", "%-10.1f", 0.) );
|
||||
|
||||
volatile double zero = 0.0; // /fp:fast allows the compiler to disregard the sign of zero.
|
||||
REQUIRE(test("0.0 ", "%-10.1f", zero) );
|
||||
REQUIRE(test("-8.8888888800", "%.10f", -8.88888888) );
|
||||
REQUIRE(test("880.0888888800", "%.10f", 880.08888888) );
|
||||
REQUIRE(test("100056789.0", "%.1f", 100056789.0) );
|
||||
|
||||
Reference in New Issue
Block a user