Am 08.11.2021 um 17:08 schrieb Charles Mills:
Only if you write into the data areas;
the OP wrote of constants in macros, so the areas should be read-only.
Can someone who knows the hardware architecture definitively confirm or deny 
that assertion? I always thought there were separate D- and I-cache lines, and 
so the branch-around technique will cause some D-cache to be flushed and 
re-loaded, and ultimately flushed and re-loaded again, just to accommodate your 
one constant.

Also, of course, branches are not performance-enhancing.

Charles


If I understand Ed Jaffe's comment correctly,
the D-cache line must be populated in the case of embedded constants,
if not done before (in the best case: only when first executing this code sequence). This may be better with literals which reside at another place, together with other literals in a literal pool, where the probability is higher that the D-cache line
is already loaded.

But the D-cache line is never flushed in this case;
it would be flushed only if there was a write access into this area.
In this case the I-cache line would also be flushed, which would do
even greater harm (so-called SIIS).

HTH, kind regards

Bernd

Reply via email to