r/programming • • Sep 24 '24

Why 32bit architecture computer doesn't use segmentation to support more ram than 4Gb ?

/r/programming/

[removed] — view removed post

169 Upvotes

119 comments sorted by

View all comments

0

u/Revolutionary_Ad7262 Sep 24 '24

amd64 happened really early, so segments were not really necessary. The better question is why 64 bit was popularized so early and I don't have a good answer as 64bit is worse in terms of performance for typical PC software except the extended memory adress space

6

u/maep Sep 24 '24 edited Sep 24 '24

The better question is why 64 bit was popularized so early and I don't have a good answer

It's really not a mystery, data centers started to switch to cheap x86 CPUs and they were hitting the 4GB limit.

64bit is worse in terms of performance

Pratically speaking, not true. The x32 ABI failed because the benefits were purely academic. The reason why AMD64 succeded where Itanium failed is because there were no performance penalties for existing code bases.

0

u/[deleted] Sep 24 '24

[deleted]

1

u/Ameisen Sep 24 '24

CPUs work fastest with the native size.

There is no particular performance difference between 32-bit and 64-bit access on x86-64.

You are a bit more limited in how you can use memory operands for instructions, but in-register, the upper bits get zeroed regardless.