mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
disable AVX512 until Zig issue is resolved
https://github.com/ziglang/zig/issues/20414
This commit is contained in:
30
build.zig
30
build.zig
@ -1028,11 +1028,31 @@ fn addDeps(
|
|||||||
// C++ files
|
// C++ files
|
||||||
step.linkLibCpp();
|
step.linkLibCpp();
|
||||||
step.addIncludePath(b.path("src"));
|
step.addIncludePath(b.path("src"));
|
||||||
step.addCSourceFiles(.{ .files = &.{
|
{
|
||||||
"src/simd/codepoint_width.cpp",
|
// From hwy/detect_targets.h
|
||||||
"src/simd/index_of.cpp",
|
const HWY_AVX3_SPR: c_int = 1 << 4;
|
||||||
"src/simd/vt.cpp",
|
const HWY_AVX3_ZEN4: c_int = 1 << 6;
|
||||||
} });
|
const HWY_AVX3_DL: c_int = 1 << 7;
|
||||||
|
const HWY_AVX3: c_int = 1 << 8;
|
||||||
|
|
||||||
|
// Zig 0.13 bug: https://github.com/ziglang/zig/issues/20414
|
||||||
|
// To workaround this we just disable AVX512 support completely.
|
||||||
|
// The performance difference between AVX2 and AVX512 is not
|
||||||
|
// significant for our use case and AVX512 is very rare on consumer
|
||||||
|
// hardware anyways.
|
||||||
|
const HWY_DISABLED_TARGETS: c_int = HWY_AVX3_SPR | HWY_AVX3_ZEN4 | HWY_AVX3_DL | HWY_AVX3;
|
||||||
|
|
||||||
|
step.addCSourceFiles(.{
|
||||||
|
.files = &.{
|
||||||
|
"src/simd/codepoint_width.cpp",
|
||||||
|
"src/simd/index_of.cpp",
|
||||||
|
"src/simd/vt.cpp",
|
||||||
|
},
|
||||||
|
.flags = if (step.rootModuleTarget().cpu.arch == .x86_64) &.{
|
||||||
|
b.fmt("-DHWY_DISABLED_TARGETS={}", .{HWY_DISABLED_TARGETS}),
|
||||||
|
} else &.{},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// If we're building a lib we have some different deps
|
// If we're building a lib we have some different deps
|
||||||
const lib = step.kind == .lib;
|
const lib = step.kind == .lib;
|
||||||
|
@ -19,7 +19,9 @@ pub fn build(b: *std.Build) !void {
|
|||||||
|
|
||||||
var flags = std.ArrayList([]const u8).init(b.allocator);
|
var flags = std.ArrayList([]const u8).init(b.allocator);
|
||||||
defer flags.deinit();
|
defer flags.deinit();
|
||||||
try flags.appendSlice(&.{});
|
// Zig 0.13 bug: https://github.com/ziglang/zig/issues/20414
|
||||||
|
// (See root Ghostty build.zig on why we do this)
|
||||||
|
try flags.appendSlice(&.{"-DSIMDUTF_IMPLEMENTATION_ICELAKE=0"});
|
||||||
|
|
||||||
lib.addCSourceFiles(.{
|
lib.addCSourceFiles(.{
|
||||||
.flags = flags.items,
|
.flags = flags.items,
|
||||||
|
Reference in New Issue
Block a user