Closed
Description
I'm sure this was mentioned somewhere but could not find an issue: The gist is as follows:
if (@areWeInComptime()) {
// use a slow fallback which we can compute in zig
} else {
// use a fast runtime version that uses assembly (or features not supported at comptime)
}
This is present in D for example via the __ctfe
variable. The current reason I need this is that I want to call sqrt
at compile-time but on x86_64 this uses an assembly routine which can not be evaluated at compile-time.