Displaying 1 result from an estimated 1 matches for "zqkesi".
Did you mean:
zqkesy
2019 Jun 25
2
Optimised stack direction?
Why does LLVM struggle to optimize the following stack direction check?
#include <stdint.h>
inline int stack_direction() {
int x = 0;
int y = 0;
return uintptr_t(&x) < uintptr_t(&y);
}
int main(int argc, const char * argv[]) {
return stack_direction();
}
It generates the following assembly:
main: # @main
lea rcx, [rsp - 8]
lea rdx, [rsp - 4]
xor eax, eax