Hacker News new | ask | show | jobs
by vezzy-fnord 4018 days ago
It used to, but it's nowhere near as correspondent with modern architectures that incorporate SIMD/SSE, complicated branching and pipelining strategies, SMT and so on. Nowadays C is a register machine model of its own, with plenty of gotchas and UB that are quite specific to it.

The spec isn't terse for a reason.

1 comments

*With -O0
No, C does not expose a 1:1 mapping to assembly in any architecture, at -O0 or otherwise. To give one simple example, the C pointer types correspond to nothing meaningful in any commonly used ISA.
asm("xorl %eax, %eax");

And I'm not sure about your example, a C pointer type would be stored as a number that will be used with "lea" or "mov [pointer], foo". Elaborate.