On Mon, 2016-04-18 at 09:51 +0800, Paul Wise wrote:
> Hmm, compile-time choice of CPU instructions doesn't sound like a 
> good idea, because if I build on an old crappy build machine or a 
> base-level  qemu virtual machine then I won't be getting SSE4 when I 
> run on my fast powerful desktop machine. Please ask upstream to 
> switch to runtime choice based on the available instructions on the
> user's CPU.

Upstream has been pretty much MIA for a long time. But even if I
managed to track him down, I reckon I know what he would say: Portable
floating point calculations can come at the expense of performance and
in order to mitigate this as much as possible, hardware level
optimizations are necessary and heavily tied to the method of
implementation.

The user can still select the best library during configure time. e.g.
with autoconf like so...

# Select correct library based on host hardware...
case "$host_cpu" in

    # For Intel based hardware, use SSE2 hardware accelerated variant...
    i?86) ;&
    x86_64) 
        PKG_CHECK_MODULES(
        [streflop], [streflop-sse >= 0.3], [],
        [AC_MSG_ERROR([streflop-sse >= 0.3 missing...])])        
        ;;

    # Otherwise fallback to software emulated variant...
    *)
        PKG_CHECK_MODULES(
        [streflop], [streflop-soft >= 0.3], [],
        [AC_MSG_ERROR([streflop-soft >= 0.3 missing...])])
        ;;
esac

> Please talk to upstream about the test suite stuff too.

Believe me, I've tried. He's MIA. The test suite I've "rigged up" in
one of my quilt patches might be sufficient, but we'll never know for
certain until he checks.

> The upstream website says that it uses the SoftFloat library for the
> software floating-point implementation. Since this is a modified
> embedded code copy too, please document this in the security team's
> embedded code copies file and talk to the upstreams about it. 
> Likewise for the old libc code and for Random.cpp.

Yup. And ideally the package would depend on SoftFloat, but I'm really
not sure how much of the latter he's modified or dependent on in the
way it was back when he wrote streflop.

> Great work convincing them!

Yeah. I think it will end up saving them time in not having to maintain
their own embedded copy and be responsible for it.

-- 
Kip Warner -- Senior Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to