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
In GNU C, one can use the __builtin_expect construct in a conditional statement as a hint to the compiler, where the resulting assembly is arranged in a way that reduces the expected number of jumps and thus minimizes CPU pipeline stalls. It's often used in hot code where branching is unavoidable. I believe that exposing similar functionality to Zig would be useful, either as a built-in, or as a qualifier keyword used with conditional flow constructs (e.g. if, while).
The text was updated successfully, but these errors were encountered:
In GNU C, one can use the
__builtin_expect
construct in a conditional statement as a hint to the compiler, where the resulting assembly is arranged in a way that reduces the expected number of jumps and thus minimizes CPU pipeline stalls. It's often used in hot code where branching is unavoidable. I believe that exposing similar functionality to Zig would be useful, either as a built-in, or as a qualifier keyword used with conditional flow constructs (e.g.if
,while
).The text was updated successfully, but these errors were encountered: