Skip to main content
added 11 characters in body
Source Link

Register allocation

This may appear to be a weird answer, but consider these other questions: How many registers are necessary to arrange and call these functions? How many registers to keep alive or spill to memory, to care for intermediate results? What registers are clobbered in general or in this particular case? How much do these questions change on other machines?

These questions need not be answered in general, because C was created to abstract away these machine details and ABI conventions. Yet, C is about generating assembly and binary objects, where these questions are paramount.

Having all this unspecified allows for all sorts of micro optimizations at register allocation level.

And, I suspect, also allows some other tricks at source level, because many compound expressions can be freely (and fully) reordered then is possible, in principle, to examining all combinatorial arrangements of unsequenced subexpressions, to find some combination that uses less or spills less registers in the alternatives.

Divergent incompatible historicalhistorical implementations

I would also echo the excellent and eloquent points of Eric Lippert and Steve on the comments of the question (and encourage them to elaborate in answers), to point out that the history of C plays a very salient role here.

These details are underspecified on the standardstandard of the language, not to enable unspecified future optimizations, but to accommodate various divergent incompatible incompatiblehistorical behaviours in various compilers. Where in one vendor, compiler, or particular machine, one particular optimization is culturally acceptable, desirable and even necessary, in another it was not.

But by the time of language standardization, these incompatibilities were not or could not be worked on, so most of these historical incompatibilities optimizations were left intentionally unspecified.

Register allocation

This may appear to be a weird answer, but consider these other questions: How many registers are necessary to arrange and call these functions? How many registers to keep alive or spill to memory, to care for intermediate results? What registers are clobbered in general or in this particular case? How much do these questions change on other machines?

These questions need not be answered in general, because C was created to abstract away these machine details and ABI conventions. Yet, C is about generating assembly and binary objects, where these questions are paramount.

Having all this unspecified allows for all sorts of micro optimizations at register allocation level.

And, I suspect, also allows some other tricks at source level, because many compound expressions can be freely (and fully) reordered then is possible, in principle, to examining all combinatorial arrangements of unsequenced subexpressions, to find some combination that uses less or spills less registers in the alternatives.

Divergent incompatible historical implementations

I would also echo the excellent and eloquent points of Eric Lippert and Steve on the comments of the question (and encourage them to elaborate in answers), to point out that the history of C plays a very salient role here.

These details are underspecified on the standard of the language, not to enable unspecified future optimizations, but to accommodate various divergent incompatible behaviours in various compilers. Where in one vendor, compiler, or particular machine, one particular optimization is culturally acceptable, desirable and even necessary, in another it was not.

But by the time of language standardization, these incompatibilities were not or could not be worked on, so most of these historical incompatibilities optimizations were left intentionally unspecified.

Register allocation

This may appear to be a weird answer, but consider these other questions: How many registers are necessary to arrange and call these functions? How many registers to keep alive or spill to memory, to care for intermediate results? What registers are clobbered in general or in this particular case? How much do these questions change on other machines?

These questions need not be answered in general, because C was created to abstract away these machine details and ABI conventions. Yet, C is about generating assembly and binary objects, where these questions are paramount.

Having all this unspecified allows for all sorts of micro optimizations at register allocation level.

And, I suspect, also allows some other tricks at source level, because many compound expressions can be freely (and fully) reordered then is possible, in principle, to examining all combinatorial arrangements of unsequenced subexpressions, to find some combination that uses less or spills less registers in the alternatives.

Divergent incompatible historical implementations

I would also echo the excellent and eloquent points of Eric Lippert and Steve on the comments of the question (and encourage them to elaborate in answers), to point out that the history of C plays a very salient role here.

These details are underspecified on the standard of the language, not to enable unspecified future optimizations, but to accommodate various divergent incompatible historical behaviours in various compilers. Where in one vendor, compiler, or particular machine, one particular optimization is culturally acceptable, desirable and even necessary, in another it was not.

But by the time of language standardization, these incompatibilities were not or could not be worked on, so most of these historical incompatibilities optimizations were left intentionally unspecified.

deleted 14 characters in body
Source Link

Register allocation

This may appear to be a weird answer, but consider these other questions: How many registers are necessary to arrange and call these functions? How many registers to keep alive or spill to memory, to care for intermediate results? What registers are clobbered in general or in this particular case? How much do these questions change on other machines?

These questions need not be answered in general, because C was created to abstract away these machine details and ABI conventions. Yet, C is about generating assembly and binary objects, where these questions are paramount.

Having all this unspecified allows for all sorts of micro optimizations at register allocation level.

And, I suspect, also allows some other tricks at source level, because many compound expressions can be freely (and fully) reordered then is possible, in principle, to examining all combinatorial arrangements of unsequenced subexpressions, to find some combination that uses less or spills less registers in the alternatives.

Divergent incompatible historical implementations

I would also echo the excellent and eloquent points of Eric Lippert and Steve on the comments of the question (and encourage them to elaborate in answers), to point out that the history of C plays a very salient role here.

These details are underspecified on the standard of the language, not to enable unspecified futurefuture optimizations, but to accommodate various divergent incompatible implementations of optimizationsbehaviours in various compilers. Where in one vendor, compiler, or particular machine, one particular optimization is culturally acceptable, desirable and even necessary, in another it was not.

But by the time of language standardization, these differencesincompatibilities were not or could not be worked on, so most of these historical incompatibilities optimizations were left intentionally unspecified.

Register allocation

This may appear to be a weird answer, but consider these other questions: How many registers are necessary to arrange and call these functions? How many registers to keep alive or spill to memory, to care for intermediate results? What registers are clobbered in general or in this particular case? How much do these questions change on other machines?

These questions need not be answered in general, because C was created to abstract away these machine details and ABI conventions. Yet, C is about generating assembly and binary objects, where these questions are paramount.

Having all this unspecified allows for all sorts of micro optimizations at register allocation level.

And, I suspect, also allows some other tricks at source level, because many compound expressions can be freely (and fully) reordered then is possible, in principle, to examining all combinatorial arrangements of unsequenced subexpressions, to find some combination that uses less or spills less registers in the alternatives.

Divergent incompatible historical implementations

I would also echo the excellent and eloquent points of Eric Lippert and Steve on the comments of the question (and encourage them to elaborate in answers), to point out that the history of C plays a very salient role here.

These details are underspecified on the standard of the language, not to enable unspecified future optimizations, but to accommodate various divergent incompatible implementations of optimizations in various compilers. Where in one vendor, compiler, or particular machine, one particular optimization is culturally acceptable, desirable and even necessary, in another it was not.

But by the time of language standardization, these differences were not or could not be worked on, so most of these historical incompatibilities optimizations were left intentionally unspecified.

Register allocation

This may appear to be a weird answer, but consider these other questions: How many registers are necessary to arrange and call these functions? How many registers to keep alive or spill to memory, to care for intermediate results? What registers are clobbered in general or in this particular case? How much do these questions change on other machines?

These questions need not be answered in general, because C was created to abstract away these machine details and ABI conventions. Yet, C is about generating assembly and binary objects, where these questions are paramount.

Having all this unspecified allows for all sorts of micro optimizations at register allocation level.

And, I suspect, also allows some other tricks at source level, because many compound expressions can be freely (and fully) reordered then is possible, in principle, to examining all combinatorial arrangements of unsequenced subexpressions, to find some combination that uses less or spills less registers in the alternatives.

Divergent incompatible historical implementations

I would also echo the excellent and eloquent points of Eric Lippert and Steve on the comments of the question (and encourage them to elaborate in answers), to point out that the history of C plays a very salient role here.

These details are underspecified on the standard of the language, not to enable unspecified future optimizations, but to accommodate various divergent incompatible behaviours in various compilers. Where in one vendor, compiler, or particular machine, one particular optimization is culturally acceptable, desirable and even necessary, in another it was not.

But by the time of language standardization, these incompatibilities were not or could not be worked on, so most of these historical incompatibilities optimizations were left intentionally unspecified.

added 73 characters in body
Source Link

Register allocation

This may appear to be a weird answer, but consider these other questions: How many registers are necessary to arrange and call these functions? How many registers to keep alive or spill to memory, to care for intermediate results? What registers are clobbered in general or in this particular case? How much do these questions change on other machines?

These questions need not be answered in general, because C was created to abstract away these machine details and ABI conventions. Yet, C is about generating assembly and/or binary objects, where these questions are paramount.

Having all this unspecified allows for all sorts of micro optimizations at register allocation level.

And, I suspect, also allows some other tricks at source level, because many compound expressions can be freely (and fully) reordered then is possible, in principle, to examining all combinatorial arrangements of unsequenced subexpressions, to find some combination that uses less or spills less registers in the multitudealternatives.

Incompatible divergentDivergent incompatible historical optimizationsimplementations

I would also echo the excellent and eloquent points of Eric Lippert and Steve on the comments of the question (and encourage them to elaborate in answers), to point out that the history of C plays a very salient role here.

These details are underspecified on the standard of the language, not to enable unspecified future optimizations, but to accommodate various incompatibledivergent divergentincompatible implementations of languageoptimizations in various compilers. Where in one vendor/compiler/particular, compiler, or particular machine, one particular optimization is culturally acceptable, desirable and even necessary, in another it wouldwas not.

But by the time of language standardization, these differences arewere not or could not be worked on, so most of these historical divergencesincompatibilities historical optimizations were left intentionally unspecified.

Register allocation

This may appear to be a weird answer, but consider these questions: How many registers are necessary to arrange and call these functions? How many registers to keep alive or spill to memory to care for intermediate results? What registers are clobbered in general or in this particular case? How much do these questions change on other machines?

These questions need not be answered in general, because C was created to abstract away these machine details and ABI conventions. Yet, C is about generating assembly and/or binary objects, where these questions are paramount.

Having all this unspecified allows for all sorts of micro optimizations at register allocation level.

And, I suspect, also allows some other tricks at source level, because many compound expressions can be freely (and fully) reordered then is possible, in principle, to examining all combinatorial arrangements of unsequenced subexpressions, to find some combination that uses less or spills less registers in the multitude.

Incompatible divergent historical optimizations

I would also echo the excellent and eloquent points of Eric Lippert and Steve on the comments of the question (and encourage them to elaborate in answers), to point out that the history of C plays a very salient role here.

These details are underspecified on the standard language, not to enable unspecified optimizations, but to accommodate various incompatible divergent implementations of language. Where in one vendor/compiler/particular machine, one particular optimization is culturally acceptable, desirable and even necessary, in another it would not.

But by the time of language standardization, these differences are not or could not be worked on, so most of these divergences historical optimizations were left unspecified.

Register allocation

This may appear to be a weird answer, but consider these other questions: How many registers are necessary to arrange and call these functions? How many registers to keep alive or spill to memory, to care for intermediate results? What registers are clobbered in general or in this particular case? How much do these questions change on other machines?

These questions need not be answered in general, because C was created to abstract away these machine details and ABI conventions. Yet, C is about generating assembly and binary objects, where these questions are paramount.

Having all this unspecified allows for all sorts of micro optimizations at register allocation level.

And, I suspect, also allows some other tricks at source level, because many compound expressions can be freely (and fully) reordered then is possible, in principle, to examining all combinatorial arrangements of unsequenced subexpressions, to find some combination that uses less or spills less registers in the alternatives.

Divergent incompatible historical implementations

I would also echo the excellent and eloquent points of Eric Lippert and Steve on the comments of the question (and encourage them to elaborate in answers), to point out that the history of C plays a very salient role here.

These details are underspecified on the standard of the language, not to enable unspecified future optimizations, but to accommodate various divergent incompatible implementations of optimizations in various compilers. Where in one vendor, compiler, or particular machine, one particular optimization is culturally acceptable, desirable and even necessary, in another it was not.

But by the time of language standardization, these differences were not or could not be worked on, so most of these historical incompatibilities optimizations were left intentionally unspecified.

added 121 characters in body
Source Link
Loading
Source Link
Loading