3 ms·
there's no reason for a cross-compiler to be slower than a native compiler. if your compiler binary is compiled for architecture A and emits code for an archit
by znpy 5y ago
there's no reason for a cross-compiler to be slower than a native compiler.
if your compiler binary is compiled for architecture A and emits code for an architecture B, it's going to perform the same as a compiler compiled for an architecture A and emitting code for the same architecture A.
- deleted 5y ago[deleted]
- cle 5y agoWell to get a little nuanced, it depends on if the backend for B is doing roughly the same stuff as for A (e.g. same optimizations?). I have no idea if that's generally true or not.
- karmakaze 5y agoWell there's one. If people tend to compile natively much more often than cross-compile, then it would make sense to spend time optimizing what benefits users.
- testific8 5y agoYes but you probably would make those optimizations in C code and not assembly. The amd64 compiler is basicially the same C code whether or not it's been bootstrapped on armv8 or amd64.
- mlyle 5y agoThere are some small nits, where representation of constants etc can be different and require more work for a cross-compiler.
- cma 5y agoEndianess differences would require more work, across all pointer math output, etc., though maybe still not significant.