Mail Archives: djgpp/2000/04/19/15:28:08
Dieter Buerssner wrote:
> I made a joke. I am no native English speaker (neither are you).
> Perhaps, the joke was bad/wrong. Don't you see, that a plane C
> (not *plain*), should be able to texture planes quite efficiently.
> I just thought, this was a *nice* misspelling.
I see. :)
> >> > };
> >> ^
> >> Why this semicolon? The same thing I see everywhere in your sources.
> >
> >Do you think this semicolon makes something slower?
>
> No. But why the semicolon. It seems highly unconventional to me.
But not for me. Let me explain it... First programming language that I've learnt
is Pascal (I don't say about Basic, because IMHO it's not a PL, it's something
for beginners and dummies :). In Pascal composite operators are made this way:
BEGIN
operator1;
operator2;
END;
^ this semicolon must be present always.
So there is nothing surprising that I still put this semicolon in C. Btw, the
semicolon after "operator2" is not really needed in Borland Pascal, but such
semicolon is always needed in C before "}".
>
> [code snipped]
>
> >And they differ. 57 vs 70. Is it an improvement???
>
> I don't doubt your numbers at all.
And I don't believe yours. :) Really. Your code works here either the same as
before or slower. If I remove span() and put your code, it runs slower. If I
throw away the FIDIVRL rep[lacing it with plane C, it also runs slower. The rest
of the code doesn't matter. It works almost the same in both C and ASM.
> Perhaps in my configuration, the
> speed is limited by the access to the screen, and not in your config.
> But it is clear, that the interface change (pointers vs. integer)
> could make a small difference. When you call span(..., &u1, &u2, ...),
> gcc most probably will not be able to hold u1 and u2 in registers.
>
> I already said, that your ASM for span looks highly optimized,
> so I was really surprised by my findings. It may also be a
> BUG in my CPU, or a cache issue. Your version unrolls by an higher
> factor.
Btw, it's possible to speed up my ASM a bit too. Just replace what goes after
"_span_1" label with the following:
------------8<--------------
_span_1:
mov al, [ebx]
mov [edi], al
_span_0:
pop edi
pop esi
pop ebx
pop ebp
ret
------------8<--------------
There was some dead/redundant code.
bye.
Alexei A. Frounze
-----------------------------------------
Homepage: http://alexfru.chat.ru
Mirror: http://members.xoom.com/alexfru
- Raw text -