Skip to content

Commit

Permalink
wasm-linker: update to llvm19 (add half-precision)
Browse files Browse the repository at this point in the history
In llvm19 a new Wasm cpu-feature was added (half-precision). As linker
features have to match the cpu features in terms of integer value, the
new half-precision feature tag was added. The Wasm backend does not yet
make use of this new feature.
  • Loading branch information
Luukdegram committed Aug 29, 2024
1 parent 1237128 commit e948d89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/link/Wasm/types.zig
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ pub const Feature = struct {
bulk_memory,
exception_handling,
extended_const,
half_precision,
multimemory,
multivalue,
mutable_globals,
Expand All @@ -208,7 +209,7 @@ pub const Feature = struct {

/// From a given cpu feature, returns its linker feature
pub fn fromCpuFeature(feature: std.Target.wasm.Feature) Tag {
return @as(Tag, @enumFromInt(@intFromEnum(feature)));
return @enumFromInt(@intFromEnum(feature));
}

pub fn format(tag: Tag, comptime fmt: []const u8, opt: std.fmt.FormatOptions, writer: anytype) !void {
Expand All @@ -219,6 +220,7 @@ pub const Feature = struct {
.bulk_memory => "bulk-memory",
.exception_handling => "exception-handling",
.extended_const => "extended-const",
.half_precision => "half-precision",
.multimemory => "multimemory",
.multivalue => "multivalue",
.mutable_globals => "mutable-globals",
Expand Down Expand Up @@ -251,6 +253,7 @@ pub const known_features = std.StaticStringMap(Feature.Tag).initComptime(.{
.{ "bulk-memory", .bulk_memory },
.{ "exception-handling", .exception_handling },
.{ "extended-const", .extended_const },
.{ "half-precision", .half_precision },
.{ "multivalue", .multivalue },
.{ "mutable-globals", .mutable_globals },
.{ "nontrapping-fptoint", .nontrapping_fptoint },
Expand Down

0 comments on commit e948d89

Please sign in to comment.