Y
Hacker News
new
|
ask
|
show
|
jobs
by
im3w1l
1572 days ago
x86 has cmps for doing comparison with postincrement / postdecrement.
2 comments
rswail
1572 days ago
Sure, but the point was that C was designed to implement Unix and Unix was implemented on DEC machines and DEC machines had a particular architecture around registers that included the pre/post increment, which lead to the C *p++ style to iterate.
link
im3w1l
1571 days ago
I wanted to point out that such instructions are in use to this day rather than being than being something from a long gone era.
link
azinman2
1572 days ago
Do compilers use that if you break it apart to something more legible? If you don’t, does the intel cpu end up doing the right thing anyway?
link
School-Cotton
1572 days ago
Yes, modern compilers should treat them the same.
link