Skip to content

Commit

Permalink
Initial ARM64EC build
Browse files Browse the repository at this point in the history
1. An arm64ec build with FLAC and MP3 turned off
2. make an installable zip but no installer

Addresses #1436
  • Loading branch information
baconpaul authored Oct 29, 2024
1 parent 4225533 commit aa27578
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 23 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
runTests: false
clapValidate: false

- name: "windows arm64ec"
os: windows-latest
target: shortcircuit-products
cmakeConfig: -G"Visual Studio 17 2022" -A arm64ec -DCMAKE_SYSTEM_VERSION=10
runTests: false
clapValidate: false

- name: "mac AU"
os: macos-latest
target: scxt_clapfirst_AU
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ defaults:

jobs:
build_plugin:
name: Release Build - ${{ matrix.os }}
name: Release Build ${{matrix.name }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
name: windows-x86
cmakeArgs: -GNinja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang

- os: windows-latest
name: windows-arm64ec
cmakeArgs: -G"Visual Studio 17 2022" -A arm64ec -DCMAKE_SYSTEM_VERSION=10

- os: macos-latest
name: macos
cmakeArgs: -GNinja -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
steps:
- name: Checkout code
Expand Down Expand Up @@ -61,7 +67,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
path: build/installer
name: build-${{ matrix.os }}
name: build-${{ matrix.name }}

build_plugin_docker:
name: Docker Build Ubuntu20 ${{ matrix.name }}
Expand Down
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# TODO Remove This before we ship non beta version. Remember
# the AU rescans only when versions change even if binaries are
# different.
message(STATUS "Using date-driven version while in alpha")
message(STATUS "ShortcircuitXT: Using date-driven version while in alpha")
string(TIMESTAMP DAY_OF_YEAR "%j")
string(TIMESTAMP YEAR "%Y")
math(EXPR PART0 "${YEAR}-2023 + 6")
Expand Down Expand Up @@ -62,8 +62,14 @@ option(SCXT_USE_JACK "Build with JACK when appropriate" ON)
option(SCXT_COPY_PLUGIN_AFTER_BUILD "Copy plugin after build if possible" OFF)
option(SCXT_SKIP_PIE_CHANGE "Dont add -no-pie to executables" OFF)

option(SCXT_USE_FLAC "Include FLAC support" ON)
option(SCXT_USE_MP3 "Include MP3 support" ON)
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64ec")
message(STATUS "Default skipping FLAC and MP3 on arm64ec for now")
option(SCXT_USE_FLAC "Include FLAC support" OFF)
option(SCXT_USE_MP3 "Include MP3 support" OFF)
else()
option(SCXT_USE_FLAC "Include FLAC support" ON)
option(SCXT_USE_MP3 "Include MP3 support" ON)
endif()

option(SCXT_SANITIZE "Build with clang/gcc address and undef sanitizer" OFF)
if (WIN32)
Expand All @@ -81,6 +87,9 @@ endif ()
# Share some information about the build
message(STATUS "Shortcircuit XT ${CMAKE_PROJECT_VERSION}")
message(STATUS "Compiler Version is ${CMAKE_CXX_COMPILER_VERSION}")
if (MSVC)
message(STATUS "Windows Architecture is ${CMAKE_GENERATOR_PLATFORM}")
endif()

# Everything here is C++ 17 now
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND UNIX AND NOT APPLE AND NOT SCXT_SKIP_PIE_CHANGE)
Expand Down
27 changes: 17 additions & 10 deletions cmake/basic-installer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,15 @@ endif ()

string(TIMESTAMP SCXT_DATE "%Y-%m-%d")
if (WIN32)
set(SCXT_ZIP ShortcircuitXT-${SCXT_DATE}-${VERSION_CHUNK}-${CMAKE_SYSTEM_NAME}-${BITS}bit.zip)
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64ec")
set(SCXT_ZIP ShortcircuitXT-${SCXT_DATE}-${VERSION_CHUNK}-${CMAKE_SYSTEM_NAME}-${CMAKE_GENERATOR_PLATFORM}.zip)
else()
set(SCXT_ZIP ShortcircuitXT-${SCXT_DATE}-${VERSION_CHUNK}-${CMAKE_SYSTEM_NAME}-${BITS}bit.zip)
endif()
else ()
set(SCXT_ZIP ShortcircuitXT-${SCXT_EXTRA_INSTALLER_NAME}${SCXT_DATE}-${VERSION_CHUNK}-${CMAKE_SYSTEM_NAME}.zip)
message(STATUS "Installer ZIP is ${SCXT_ZIP}")
endif ()

message(STATUS "Installer ZIP is ${SCXT_ZIP}")

if (APPLE)
message(STATUS "Configuring for Mac installer.")
Expand All @@ -158,13 +161,17 @@ elseif (WIN32)
COMMAND ${CMAKE_COMMAND} -E echo "ZIP Installer in: installer/${SCXT_ZIP}")
find_program(SHORTCIRCUIT_NUGET_EXE nuget.exe PATHS ENV "PATH")
if(SHORTCIRCUIT_NUGET_EXE)
message(STATUS "NuGet found at ${SHORTCIRCUIT_NUGET_EXE}")
add_custom_command(
TARGET shortcircuit-installer
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${SHORTCIRCUIT_NUGET_EXE} install Tools.InnoSetup -version 6.2.1
COMMAND Tools.InnoSetup.6.2.1/tools/iscc.exe /O"installer" /DSCXT_SRC="${CMAKE_SOURCE_DIR}" /DSCXT_BIN="${CMAKE_BINARY_DIR}" /DMyAppVersion="${SCXT_DATE}-${VERSION_CHUNK}" "${CMAKE_SOURCE_DIR}/resources/installer_win/scxt${BITS}.iss")
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64ec")
message(STATUS "Zip only for now on arm64ec")
else()
message(STATUS "NuGet found at ${SHORTCIRCUIT_NUGET_EXE}")
add_custom_command(
TARGET shortcircuit-installer
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${SHORTCIRCUIT_NUGET_EXE} install Tools.InnoSetup -version 6.2.1
COMMAND Tools.InnoSetup.6.2.1/tools/iscc.exe /O"installer" /DSCXT_SRC="${CMAKE_SOURCE_DIR}" /DSCXT_BIN="${CMAKE_BINARY_DIR}" /DMyAppVersion="${SCXT_DATE}-${VERSION_CHUNK}" "${CMAKE_SOURCE_DIR}/resources/installer_win/scxt${BITS}.iss")
endif()
else()
message(STATUS "NuGet not found!")
endif()
Expand Down
3 changes: 3 additions & 0 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ add_subdirectory(fmt)
# Modify this basedon the outcome of https://github.com/taocpp/PEGTL/issues/347
set(PEGTL_NO_STD_FILESYSTEM ON CACHE BOOL "Skip PEGTL FileSystem")
add_subdirectory(taocpp_json)
if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64ec")
target_compile_definitions(taocpp-json INTERFACE -DRYU_ONLY_64_BIT_OPS)
endif()
add_subdirectory(sqlite3-3.42.0)

add_subdirectory(xiph)
Expand Down
2 changes: 1 addition & 1 deletion libs/simde
Submodule simde updated 926 files
3 changes: 2 additions & 1 deletion libs/xiph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ if (${SCXT_USE_FLAC})
add_subdirectory(flac)
target_compile_definitions(FLAC++ PUBLIC SCXT_USE_FLAC=1)
else ()
add_target(FLAC++ INTERFACE)
add_library(FLAC INTERFACE)
add_library(FLAC++ INTERFACE)
endif ()
2 changes: 1 addition & 1 deletion libs/xiph/flac
Submodule flac updated 271 files
3 changes: 2 additions & 1 deletion src-ui/app/edit-screen/components/GroupTriggersCard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ struct GroupTriggersCard::ConditionRow : juce::Component, HasEditor
p.addSeparator();

auto mkv = [this](auto v) {
return [w = juce::Component::SafePointer(this), v]() {
auto that = this; // darn you MSVC
return [w = juce::Component::SafePointer(that), v]() {
if (!w)
return;
w->parent->cond.storage[w->index].id = (engine::GroupTriggerID)v;
Expand Down
2 changes: 1 addition & 1 deletion src/dsp/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void KernelOp<InterpolationTypes::Sinc, int16_t>::Process(
// int16
// SSE2 path
__m128i lipol0, tmp, sL8A, sR8A, tmp2, sL8B, sR8B;
__m128 fL, fR;
__m128 fL = _mm_setzero_ps(), fR = _mm_setzero_ps();
lipol0 = _mm_set1_epi16(ks.SampleSubPos & 0xffff);

tmp = _mm_add_epi16(_mm_mulhi_epi16(*((__m128i *)&sincTable.SincOffsetI16[m0]), lipol0),
Expand Down
2 changes: 1 addition & 1 deletion src/engine/group_and_zone_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ bool HasGroupZoneProcessors<T>::checkOrAdjustBoolConsistency(int whichProcessor)
if (pd.supportsKeytrack)
{
auto &ps = asT()->processorStorage[whichProcessor];
if (ps.previousIsKeytracked < 0 || ps.isKeytracked != ps.previousIsKeytracked)
if (ps.previousIsKeytracked < 0 || ((int)ps.isKeytracked) != ps.previousIsKeytracked)
{
ps.previousIsKeytracked = ps.isKeytracked ? 1 : 0;
asT()->setupProcessorControlDescriptions(whichProcessor, ps.type, nullptr, true);
Expand Down
4 changes: 3 additions & 1 deletion src/infrastructure/sse_include.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
#ifndef SCXT_SRC_INFRASTRUCTURE_SSE_INCLUDE_H
#define SCXT_SRC_INFRASTRUCTURE_SSE_INCLUDE_H

#if defined(__aarch64__)
#if defined(__aarch64__) || defined(_M_ARM64)
#define SIMDE_ENABLE_NATIVE_ALIASES
#include "simde/x86/sse4.2.h"
#elif defined(_M_ARM64EC)
#include <intrin.h>
#else
#include <xmmintrin.h>
#include <immintrin.h>
Expand Down
2 changes: 1 addition & 1 deletion src/messaging/messaging.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ struct MessageController : MoveableOnly<MessageController>
std::unique_ptr<std::thread> serializationThread;

int64_t localCopyOfEngineProcessRuns{engineProcessRuns};
int64_t localCopyOfIsAudioRunning{isAudioRunning};
bool localCopyOfIsAudioRunning{isAudioRunning};
static constexpr int32_t engineOffCountdownInit{4};
int32_t engineOffCountdown{engineOffCountdownInit};
};
Expand Down

0 comments on commit aa27578

Please sign in to comment.