Skip to content

Commit 6ecf497

Browse files
authored
Merge pull request #25936 from Traxar/master
Add some missing features to `std.Io.Timestamp` and `spirv/CodeGen.zig`
2 parents 83d9a59 + 8684130 commit 6ecf497

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/std/Io.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,10 @@ pub const Timestamp = struct {
903903
return .{ .nanoseconds = x };
904904
}
905905

906+
pub fn toMilliseconds(t: Timestamp) i64 {
907+
return @intCast(@divTrunc(t.nanoseconds, std.time.ns_per_ms));
908+
}
909+
906910
pub fn toSeconds(t: Timestamp) i64 {
907911
return @intCast(@divTrunc(t.nanoseconds, std.time.ns_per_s));
908912
}

src/codegen/spirv/CodeGen.zig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,14 @@ const UnaryOp = enum {
21762176
.ceil => .Ceil,
21772177
.trunc => .Trunc,
21782178
.round => .Round,
2179+
.sin => .Sin,
2180+
.cos => .Cos,
2181+
.tan => .Tan,
2182+
.sqrt => .Sqrt,
2183+
.exp => .Exp,
2184+
.exp2 => .Exp2,
2185+
.log => .Log,
2186+
.log2 => .Log2,
21792187
else => return null,
21802188
})),
21812189
else => unreachable,

0 commit comments

Comments
 (0)