Mail Archives: djgpp/2000/04/25/11:18:34
Hans-Bernhard Broeker wrote:
> salvador <salvador AT inti DOT gov DOT ar> wrote:
>
> > I found the problem, when you make the value a constant it is stored
> > in the code segment, too close to the code that is executed. It looks like
> > that's close enough to be inside the pipeline (probably because the CPU
> > is fetching groups of aligned bytes, not just code). Looks like K6 does some
> > pipeline flush when you read/write data that is inside the pipeline (or
> > perhaps a pre-fetch buffer is a better name for it).
>
> This should not usually be any big speed problem, unless you *write*
> into the middle of the code segment, i.e. you violate the const-ness
> of those variables. For all other cases, the CPU should always be able
> to notice that this variable is only read, not written to. Only
> writing into the middle of the .text segment would trigger the code
> cache/prefetch queue to have to be nuked and refilled from scratch, in
> the worst case.
I agree with you but it doesn't seem to be the case of the K6 CPU. If you have a
better theory please explain it. Just moving the constant a little bit does the
magic and isn't the aligment because I tried with different values.
It looks like K6 can't read data from the code that is processing without
introducing a penalty.
SET
--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
set AT ieee DOT org set-soft AT bigfoot DOT com
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013
- Raw text -