Mail Archives: djgpp/2000/04/24/10:57:23
Hi Dieter:
> On 09 Mrz 2000, you wrote in comp.os.msdos.djgpp:
>
> >Send me a copy, I don't have it here.
>
> Salvador, my mail provider was not functioning for some days.
> So this is a bit late. I append the article.
>
> Celeron and Pentinum Pro do not show the problem. Eli has
> found a 1:3 performance hit with P166, I have found 1:10
> with AMD K6-2 266. I think, your suspect about an AMD bug
> was correct :-(
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).
If you put zseed inside the text segment and close to the function
things gets even worst. I got 1:7 and 1:16 for the second case. But
if you move both variables quite far (inside of the .text segment)
you'll get the same times that when using the variables in .data.
BTW: If you use const *and* compile it as C++ you'll get faster code
because C++ allows the compiler to use consts as C uses #define macros if
the compiler considers that's favorable.
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 -