• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Would RISC have been better?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
I disagree. x86 is totally stack oriented. 25% of their original registers are dedicated to working off the stack and it includes the ENTER/LEAVE instructions for facilitating those operations. Code would be totally tedious without them and the base+offset operations on memory. Seriously there are only 4 gp registers and 2 of those are generally used for indexed addressing and loop operations.

Maybe you could make some argument that x86 was stack oriented in 16-bit mode, although even there it's pretty tenuous to claim that by bp alone since there isn't anything particularly stack-dedicated about it outside of enter/leave. The fact that sp isn't directly addressable would be a stronger argument towards stack orientation. But because of enter/leave? You'd may as well say that the rep prefix instructions make it string oriented. At least those instructions weren't gradually performance degraded into uselessness like enter/leave or loop were.

I've done a fair amount of x86 coding (none of it 30 years ago mind you, don't know what your experience was) and personally I've never used ebp/rbp for anything dedicated to stack addressing, nor have I ever used enter/leave. Compilers are more or less the same - they could use ebp/rbp as a frame pointer but that's no different from using a frame pointer in other ISAs (and removed with ie -fomit-frame-pointer)
 
Even though my previous post got caught up in semantics, let me correct the way I came across. x86 is not a stack based machine. What I am saying is because of it's limited set of registers, it uses the stack for a majority of its variable access. Just go into disassembly and count the number of dword ptr [ebp+-#]s, many of which are operated on directly. Yes stack frames are then norm in all modern ISAs, but CISC relies on them and operates more directly with them than RISC. I mean just look at the calling conventions of ARM.

I do understand that Enter/Leave has gone the way of the dodo, I was more trying to show that the design of x86 was geared towards the above relationship.
 
Last edited:
Back
Top