gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] gnash libbase/tu_swap.h libamf/amf.cpp server/p...


From: Martin Guy
Subject: Re: [Gnash-commit] gnash libbase/tu_swap.h libamf/amf.cpp server/p...
Date: Thu, 26 Apr 2007 16:51:57 +0100

why drop compile time tests ?

Because it trades a negligible speed thing against eternal porting
maintenance. It costs one assignment and a switch or a test (I didn't
figure out how to statically initialise one member of a union in C++)

John said they had used this technique in another project with great
relief. It went against the grain for me, but thinking on it I agreed.
Then I realised it would also let us handle hosts with middle-endian
IEEE754 doubles, which are still in use on ARM systems (and are a
Flash movie's native double format!), as well as opening a path for
non-IEEE754 floating point systems like IBM and Vax by having a final
catch-all option to interpret the floating point words explicitly.

The boost endian.hpp header has the correct macros on all
the platforms we have to support, so we should use them for endianess
detection.

They don't seem to detect middle-endian (PDP-endian) doubles, which
still exist today on ARM systems that do floating point emulation
using the nwpfe emulator that is in the linux kernel (the real
PDP-endian "FPA" that it emulates stopped being made in silicon in the
90s, but its ghost will not rest).

The point of compile-time tests is speed and code size, but there's
virtually nothing to be gained here. However, if someone wants to put
compile-time tests back in where integers are involved, I have no
problem with that:
$ find . -type f | xargs -d\\n grep -i endian
should find them all.

    M

while (chit_chat_over_trivia) actual_work--;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]