3 ms·
In 32-bit x86 there aren't very many registers to play with, and there were legacy ABIs that didn't preserve registers for TLS, so the segment registers were us
by bdonlan 8y ago
In 32-bit x86 there aren't very many registers to play with, and there were legacy ABIs that didn't preserve registers for TLS, so the segment registers were used instead. When x86-64 arrived, it had a lot more registers (but still less than many other architectures) and a clean ABI break, but it kept enough segment register functionality to use for TLS, so it continued to be used to free up that one register - why not, after all?
- chrisseaton 8y ago> why not, after all? Because it seems to need the kernel to set it? But I guess that's only done once each time you create a new thread and you're already doing a syscall in that case, so it's probably better than taking up a general purpose register.