Skip to content

Commit

Permalink
BREAKING Cannot build -a x86 anymore (32-bit x86) plug-ins in Dplug. …
Browse files Browse the repository at this point in the history
…We are about the last vendors to support that, and users have moved on.

Unrelated: Remove some remnants of "carbon" backend.
  • Loading branch information
Guillaume Piolat committed Dec 12, 2024
1 parent 2adc96c commit 6ba0d66
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 149 deletions.
3 changes: 1 addition & 2 deletions client/dplug/client/graphics.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ enum GraphicsBackend
{
autodetect,
win32,
carbon,
cocoa,
x11
}
Expand All @@ -25,7 +24,7 @@ interface IGraphics
nothrow:
@nogc:
/// Create an UI, return a system-specific handle for the window/view
abstract void* openUI(void* parentInfo,
abstract void* openUI(void* parentInfo,
void* controlInfo, // must be null, was a Carbon thing
IClient client,
GraphicsBackend backend);
Expand Down
27 changes: 0 additions & 27 deletions core/dplug/core/fpcontrol.d
Original file line number Diff line number Diff line change
Expand Up @@ -104,30 +104,3 @@ version(isX86)
}
}

unittest
{
// TEST FOR DENORMAL FLUSH TO ZERO

FPControl control;
control.initialize();

// Doesn't work since constant folder may use "real" precision.
/*
// Trying to see if FTZ is working, 1e-37 is a very small normalized number
float denormal = 1e-37f * 0.1f;
version(DigitalMars)
{
version(X86)
{
// DMD x86 32-bit may use FPU operations, hence not suppressing denormals
}
else
assert(denormal == 0);
}
else
assert(denormal == 0);
*/
}
62 changes: 0 additions & 62 deletions dsp/dplug/dsp/iir.d
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ import std.complex: Complex,
import dplug.core.math;
import inteli.emmintrin;

// DMD with a 32-bit target uses the FPU
version(X86)
{
version(DigitalMars)
{
version = killDenormals;
}
}

// TODO: function to make biquads from z-plane poles and zeroes

public
Expand Down Expand Up @@ -77,14 +68,6 @@ public

double current = a0 * input + a1 * x1 + a2 * x2 - a3 * y1 - a4 * y2;

// kill denormals,and double values that would be converted
// to float denormals
version(killDenormals)
{
current += 1e-18f;
current -= 1e-18f;
}

_x0 = input;
_x1 = x1;
_y0 = current;
Expand All @@ -107,14 +90,6 @@ public

double current = a0 * input + a1 * x1 + a2 * x2 - a3 * y1 - a4 * y2;

// kill denormals, and double values that would be converted
// to float denormals
version(killDenormals)
{
current += 1e-18f;
current -= 1e-18f;
}

_x0 = input;
_x1 = x1;
_y0 = current;
Expand Down Expand Up @@ -306,19 +281,6 @@ public
else
static assert(false, "Not implemented for this platform.");

// Kill small signals that can cause denormals (no precision loss was measurable)
version(killDenormals)
{
x0 += 1e-10;
x0 -= 1e-10;
x1 += 1e-10;
x1 -= 1e-10;
y0 += 1e-10;
y0 -= 1e-10;
y1 += 1e-10;
y1 -= 1e-10;
}

_x0 = x0;
_x1 = x1;
_y0 = y0;
Expand All @@ -341,14 +303,6 @@ public
{
double current = a0 * input[i] + a1 * x0 + a2 * x1 - a3 * y0 - a4 * y1;

// kill denormals,and double values that would be converted
// to float denormals
version(killDenormals)
{
current += 1e-18f;
current -= 1e-18f;
}

x1 = x0;
x0 = input[i];
y1 = y0;
Expand Down Expand Up @@ -433,14 +387,6 @@ public
{
double current = a0 * input + a1 * x0 + a2 * x1 - a3 * y0 - a4 * y1;

// kill denormals,and double values that would be converted
// to float denormals
version(killDenormals)
{
current += 1e-18f;
current -= 1e-18f;
}

x1 = x0;
x0 = input;
y1 = y0;
Expand Down Expand Up @@ -471,14 +417,6 @@ public
{
double current = a0 * input + a1 * x0 + a2 * x1 - a3 * y0 - a4 * y1;

// kill denormals,and double values that would be converted
// to float denormals
version(killDenormals)
{
current += 1e-18f;
current -= 1e-18f;
}

x1 = x0;
x0 = input;
y1 = y0;
Expand Down
1 change: 0 additions & 1 deletion gui/dplug/gui/graphics.d
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ nothrow:
case GraphicsBackend.autodetect: wbackend = WindowBackend.autodetect; break;
case GraphicsBackend.win32: wbackend = WindowBackend.win32; break;
case GraphicsBackend.cocoa: wbackend = WindowBackend.cocoa; break;
case GraphicsBackend.carbon: wbackend = WindowBackend.carbon; break;
case GraphicsBackend.x11: wbackend = WindowBackend.x11; break;
}

Expand Down
19 changes: 6 additions & 13 deletions tools/dplug-build/source/arch.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import std.string;
// Architecture (one single dplug-build invocation may specify several of them)
enum Arch
{
x86,
x86_64,
arm32, // ARM 32-bit for Raspberry Pi
arm64, // Apple Silicon
Expand All @@ -18,7 +17,6 @@ bool isSingleArchEnum(Arch arch) pure
{
final switch(arch) with (Arch)
{
case x86: return true;
case x86_64: return true;
case arm32: return true;
case arm64: return true;
Expand All @@ -31,7 +29,6 @@ string convertArchToPrettyString(Arch arch) pure
{
final switch(arch) with (Arch)
{
case x86: return "x86";
case x86_64: return "x86_64";
case arm32: return "arm32";
case arm64: return "arm64";
Expand All @@ -44,7 +41,6 @@ string convertArchToVST3WindowsDirectoryName(Arch arch) pure
{
final switch(arch) with (Arch)
{
case x86: return "x86-win";
case x86_64: return "x86_64-win";
case arm32: return "arm-win";
case arm64: return "arm64-win";
Expand All @@ -57,7 +53,6 @@ string convertArchToDUBFlag(Arch arch, OS targetOS) pure
{
final switch(arch) with (Arch)
{
case x86: return "x86 ";
case x86_64: return "x86_64 ";

// Explanation: the dub and ldc2 bundled on Raspberry Pi OS build to the right arch by default
Expand All @@ -71,7 +66,7 @@ string convertArchToDUBFlag(Arch arch, OS targetOS) pure
return "arm64-apple-macos ";
else
return "aarch64 ";
}
}

case universalBinary: assert(false);
case all: assert(false);
Expand Down Expand Up @@ -110,16 +105,14 @@ OS buildOS()
// Build architecture, the arch dplug-build is built for.
Arch buildArch()
{
version(X86)
return Arch.x86;
else version(X86_64)
version(X86_64)
return Arch.x86_64;
else version(ARM)
return Arch.arm32;
else version(AArch64)
return Arch.arm64;
else
static assert(false, "dplug-build was built for an architecture unknown to itself.");
static assert(false, "dplug-build was built for an architecture unknown to itself. Note that -a x86 is not valid anymore for dplug-build.");
}

Arch[] allArchitecturesWeCanBuildForThisOS(OS targetOS)
Expand All @@ -140,10 +133,10 @@ Arch[] allArchitecturesWeCanBuildForThisOS(OS targetOS)

case OS.windows:
{
if (buildArch == Arch.x86 || buildArch == Arch.x86_64 )
return [ Arch.x86_64, Arch.x86];
if (buildArch == Arch.x86_64)
return [ Arch.x86_64 ];
else
throw new Exception("dplug-build on Windows should be built with a x86_64 or x86 architecture.");
throw new Exception("dplug-build on Windows should be built with a x86_64 architecture.");
}

case OS.linux:
Expand Down
39 changes: 6 additions & 33 deletions tools/dplug-build/source/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,7 @@ int main(string[] args)

// You can select a single arch for fast building, or "all".
// all is also the default.
if (args[i] == "x86")
archs = [ Arch.x86 ];
else if (args[i] == "x86_64")
if (args[i] == "x86_64")
archs = [ Arch.x86_64 ];
else if (args[i] == "arm32")
archs = [ Arch.arm32 ];
Expand Down Expand Up @@ -428,7 +426,6 @@ int main(string[] args)
{
final switch(arch) with (Arch)
{
case x86: return "32b-";
case x86_64: return "64b-";
case arm32: return "arm32-";
case arm64: return "arm64-";
Expand Down Expand Up @@ -502,29 +499,13 @@ int main(string[] args)

foreach (size_t archCount, arch; architectures)
{
// Only build x86_64 AAX on Windows
if (targetOS == OS.windows && configIsAAX(config) && (arch != Arch.x86_64) && !(legacyPT10 && arch == Arch.x86) )
// Only build x86_64 on Windows
if (targetOS == OS.windows && arch != Arch.x86_64)
{
cwritefln("info: Skipping architecture %s for AAX on Windows\n", arch);
cwritefln("info: Skipping architecture %s for Windows\n", arch);
continue;
}

// Only build x86_64 FLP on Windows
if (targetOS == OS.windows && configIsFLP(config) && (arch != Arch.x86_64))
{
cwritefln("info: Skipping architecture %s for FLP on Windows\n", arch);
continue;
}

// Does not try to build 32-bit under Mac
if (targetOS == OS.macOS)
{
if (arch == Arch.x86)
{
throw new Exception("Can't make 32-bit x86 builds for macOS");
}
}

// Does not try to build AU under Windows
if (targetOS == OS.windows)
{
Expand Down Expand Up @@ -807,12 +788,6 @@ int main(string[] args)
fileMove(plugin.dubOutputFileName, contentsDir ~ "x64/" ~ pluginFinalName);
signAAXBinaryWithPACE(contentsDir ~ "x64/" ~ pluginFinalName);
}
else if (arch == Arch.x86)
{
mkdirRecurse(contentsDir ~ "Win32");
fileMove(plugin.dubOutputFileName, contentsDir ~ "Win32/" ~ pluginFinalName);
signAAXBinaryWithPACE(contentsDir ~ "Win32/" ~ pluginFinalName);
}
else
throw new Exception("AAX doesn't support this arch");

Expand Down Expand Up @@ -848,9 +823,7 @@ int main(string[] args)
// $PROGRAMFILES\Image-Line\FL Studio $FLVER\Plugins\Fruity\Generators
//
string pluginFinalName;
if (arch == Arch.x86)
pluginFinalName = plugin.pluginName ~ ".dll";
else if (arch == Arch.x86_64)
if (arch == Arch.x86_64)
pluginFinalName = plugin.pluginName ~ "_x64.dll";
else
throw new Exception("Unsupported architecture for FLP plug-in format");
Expand Down Expand Up @@ -1271,7 +1244,7 @@ int main(string[] args)
{
cwriteln("*** Validation with auval...");

bool is32b = (arch == Arch.x86);
bool is32b = false;
string exename = is32b ? "auval" : "auvaltool";
cmd = format("%s%s -v aufx %s %s -de -dw",
exename,
Expand Down
5 changes: 0 additions & 5 deletions tools/dplug-build/source/plugin.d
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ string toStringArchs(Arch[] archs)
{
final switch(arch) with (Arch)
{
case x86:
if (i) r ~= " and ";
r ~= "x86";
break;
case x86_64:
if (i) r ~= " and ";
r ~= "x86_64";
Expand Down Expand Up @@ -1475,7 +1471,6 @@ string makeRSRC_with_Rez(Plugin plugin, Arch arch, bool verbose)
string archFlags;
final switch(arch) with (Arch)
{
case x86: archFlags = "-arch i386"; break;
case x86_64: archFlags = "-arch x86_64"; break;
case arm32: assert(false);
case arm64: assert(false);
Expand Down
8 changes: 2 additions & 6 deletions window/dplug/window/window.d
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ enum WindowBackend
{
autodetect,
win32,
carbon, // Legacy, now unsupported
cocoa,
x11
}
Expand All @@ -275,8 +274,6 @@ static isWindowBackendSupported(WindowBackend backend) nothrow @nogc
return (backend == WindowBackend.cocoa);
else version(X86_64)
return (backend == WindowBackend.cocoa);
else version(X86)
return (backend == WindowBackend.cocoa);
else
static assert(false, "unsupported arch");
}
Expand All @@ -299,11 +296,10 @@ static isWindowBackendSupported(WindowBackend backend) nothrow @nogc
///
/// parentInfo = OS handle of the parent window.
/// For `WindowBackend.win32` it's a HWND.
/// For `WindowBackend.carbon` it's a NSWindow.
/// For `WindowBackend.x11` it's _unused_.
///
/// controlInfo = only used in Carbon Audio Units, an additional parenting information.
/// Can be `null` otherwise.
/// controlInfo = was used in Carbon Audio Units, an additional parenting information.
/// Should be `null` otherwise.
///
/// listener = A `IWindowListener` which listens to events by this window. Can be `null` for the moment.
/// Must outlive the created window.
Expand Down

0 comments on commit 6ba0d66

Please sign in to comment.