You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running with x86 backend zig run src/timestamp.zig -fno-llvm -fno-lld gives error
❯ zig run .\src\timestamp.zig -fno-llvm -fno-lld
error(x86_64_encoder): no encoding found for: none or xmm0 rax none none
user_path\zig\0.13.0-dev.46+3648d7df1\files\lib\std\time.zig:74:5: error: CodeGen failed to find a viable instruction. This is a bug in the Zig compiler.
pub fn milliTimestamp() i64 {
~~~~^~~~~~~~~~~~~~~~~~~~~~~
Expected Behavior
Expected to print timestamp, similar to the llvm backend.
❯ zig run .\src\timestamp.zig
1714405874063
The text was updated successfully, but these errors were encountered:
So I did some more digging. And I found that std.time.timestamp() , std.time.microTimestamp() and std.time.milliTimestamp() directly or indirectly call std.time.nanoTimestamp() when calculating timestamp and when trying to directly call std.time.nanoTimestamp() it silently fails without an error message. Reproduction steps below
Zig Version
0.13.0-dev.46+3648d7df1
Steps to Reproduce and Observed Behavior
Given a simple program where you try to print the current milliseconds unix timestamp.
When running with x86 backend
zig run src/timestamp.zig -fno-llvm -fno-lld
gives errorExpected Behavior
Expected to print timestamp, similar to the llvm backend.
The text was updated successfully, but these errors were encountered: