unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: Andreas Enge <andreas@enge.fr>, 61586@debbugs.gnu.org
Subject: [bug#61586] BinaryEn
Date: Sun, 12 Mar 2023 09:16:45 +0100	[thread overview]
Message-ID: <a895e3af8df2d5c77d3bc08b6aee8944e075f097.camel@gmail.com> (raw)
In-Reply-To: <ZA0FW589iSuSS/H9@jurong>

Am Samstag, dem 11.03.2023 um 23:48 +0100 schrieb Andreas Enge:
> Hello Liliana,
Hi Andreas, please don't forget to add me in CC.

> how about you start by pushing the python-filecheck package?
I'd only do that if it has another user and for the time being I don't
see that.  Don't worry, I still got more python packages in my backlog
:)

> Do you have a pointer to BinaryEn using -msse2 for precision?
> I am not familiar with SSE2, but a quick look-up on Wikipedia only
> shows (packed) double floating point operations and packed integer
> arithmetic.
> All these should be feasible directly in C, although maybe more
> slowly.
Possible, but more slowly in C doesn't translate that nicely if you
don't want to code up your own float/double types and you really don't
want that.

The problem here is that expressions like:
  double a, b, c;
  c = sqrt(a * a, b * b);
can use 80 bit intermediaries on x87 chips, which they don't when using
SSE2 – hence the precision argument.  You would have to redefine all
basic operations for your floating point (which would still be doable
in C++ due to operator overloading, but be a major pain in the butt to
do correctly and well-tested, hence the deference to SSE2, I believe).

> In the CMakeLists.txt file there are the following lines:
>   if(NOT EMSCRIPTEN)
>     if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
>       # wasm doesn't allow for x87 floating point math
>       add_compile_flag("-msse2")
>       add_compile_flag("-mfpmath=sse")
>     elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv[2-6]" AND NOT
> CMAKE_CXX_FLAGS MATCHES "-mfpu=")
>       add_compile_flag("-mfpu=vfpv3")
>     endif()
>   endif()
> 
> So the -msse2 flag will not be added on arm; the package is compiled
> successfully on aarch64, and I see no reason why in principal it
> should not also work on armhf. 
It does require the vfpv3 fpu, which I believe won't exist on all arms.

> Maybe there is a more precise test for x86_64 that could be used
> instead of
>     if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") ?
Not for the kind of check they want to make, I believe.

Cheers




  reply	other threads:[~2023-03-12  8:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 20:45 [bug#61586] [PATCH RFC 0/2] Add BinaryEn Liliana Marie Prikler
2023-02-17 20:27 ` [bug#61586] [PATCH RFC 1/2] gnu: Add python-filecheck Liliana Marie Prikler
2023-02-17 20:28 ` [bug#61586] [PATCH RFC 2/2] gnu: Add binaryen Liliana Marie Prikler
2023-04-06 21:38   ` Thompson, David
2023-06-11  8:04     ` bug#61586: " Liliana Marie Prikler
2023-03-11 22:48 ` [bug#61586] BinaryEn Andreas Enge
2023-03-12  8:16   ` Liliana Marie Prikler [this message]
2023-03-12 10:49     ` Andreas Enge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a895e3af8df2d5c77d3bc08b6aee8944e075f097.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=61586@debbugs.gnu.org \
    --cc=andreas@enge.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).