Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add hw sqrt for x86_64 #681
hmm, if there's a hardware instruction for sqrt, maybe we should add
The other problem a builtin would solve is executing std.math.sqrt at compile time. Without a builtin, we would need some kind of feature to detect whether we're executing at compile time or not. (because inline assembly cannot be executed at compile time).
We would still need the zig implementation of sqrt (with the modification proposed here) to put into builtin.o, because the sqrt llvm intrinsic can lower to a call to that function. So this is good to merge. I'll add a new issue.