New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: @prefetch builtin #3600
Labels
Milestone
Comments
yeah I like it, except that isData should be a enum with |
Updated. |
andrewrk
added
the
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
label
Nov 14, 2019
ifreund
added a commit
to tigerbeetle/tigerbeetle
that referenced
this issue
Nov 26, 2021
Currently the stage1 zig compiler allows access to all LLVM instrinsics if you know what you are doing: ziglang/zig#2291 This is however a bug, and we should use the @prefetch() builtin when availible ziglang/zig#3600.
To go into std.builtin: /// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Prefetch = struct {
rw: Rw = .read,
/// 0 means no locality.
/// 3 means extremely local, keep in cache.
locality: u2 = 3,
type: Type = .data,
pub const Rw = enum { read, write };
pub const Type = enum { instruction, data };
};
Any objections? |
Merged
Landed in 97c0373 just in time for 0.9.0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Accepted Proposal
LLVM docs
Possible syntax:
Related: #767
The text was updated successfully, but these errors were encountered: