Re: [eigen] Use of vec_min/max on ppc |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Use of vec_min/max on ppc
- From: Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Jan 2020 17:44:48 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-bremen.de; s=2019; t=1579279488; i=@uni-bremen.de; bh=u6vef51r3naofr9rIRM90CrzZ/PYc7O4jR+Xm5svQvc=; h=To:References:From:Date:In-Reply-To; b=IJMT0u0OKIflFS08M1RD1/Cerf4KmGSfMFSUiMwnWGewIrmkNUPFTrYhg2Do6XyBb oeMFLuXMqcJmIN+ZRZ8a35+m/TQIUZG4Fde4X300ExHZzZY1xz9ay2998TJGq2yjC/ V7/lXWnsHgYLu1etstGAIS4dZB0Lg9+u3xw33cfqpKLlvajOY9u5Hh84Ik8dqkZVLu bW4neFa2GtFakvgrHvu/7646MYqdy8KVpn3pPjrnvnBQ3j5IxVlD5uJ1RKe+Xu4ij2 6lFZx91i4appDWjWXTDxHxgkrKmfyQz1b5tz+wZGsPKi2EV+t8nWa7p6Ms07nzwLjX TWbR2HiqnRnuQ==
Hi!
Which IEEE754 version are you referring to?
In IEEE754-1985, there was no min/max, then the 2008 draft suggested
introducing minNum/maxNum which propagate numbers, and the 2019 draft
suggests replacing those by
{min,max}imum{,Number,Magnitude,MagnitudeNumber} which either propagate
NaNs or numbers. (All to the best of my knowledge, please correct me, if
I'm wrong).
Eigen follows the `std::min`/`std::max` convention of propagating the
first argument, if one argument is NaN. SSE/AVX propagates the first,
which is why we change the order for those.
I'm really no expert on Altivec/PPC, so no idea if there is a more
efficient instruction consistent with `std::min/max`.
For reference: Here is the commit which introduced the lines you are
referring to:
https://gitlab.com/libeigen/eigen/commit/e91e314347c14774206307a91d1b427e49f9b3e2
Also, check these issues for further discussion on the topic:
https://gitlab.com/libeigen/eigen/issues/564
https://gitlab.com/libeigen/eigen/issues/1373
https://gitlab.com/libeigen/eigen/issues/1494
Cheers,
Christoph
On 17/01/2020 16.50, Everton Rufino Constantino1 wrote:
Hi,
looking at the implementation of pmin and pmax for Packet4f on
Altivec/PacketMath.h I came across the following statement to justify not using
VSX's intrinsics:
"// NOTE: about 10% slower than vec_min, but consistent with std::min and SSE regarding NaN"
I fail to understand the reasoning, afaik ppc and stdlib both are IEEE
compatible right? Can somebody please clarify the statement? I think sometime in
the past ppc had a non-IEEE mode that you could turn on or off but that's gone
for a while now.
Best regards,
Everton Constantino
<everton.constantino@xxxxxxx>
--
Dr.-Ing. Christoph Hertzberg
Besuchsadresse der Nebengeschäftsstelle:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Postadresse der Hauptgeschäftsstelle Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 1
28359 Bremen, Germany
Tel.: +49 421 178 45-4021
Zentrale: +49 421 178 45-0
E-Mail: christoph.hertzberg@xxxxxxx
Weitere Informationen: http://www.dfki.de/robotik
-------------------------------------------------------------
Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
Trippstadter Straße 122, D-67663 Kaiserslautern, Germany
Geschäftsführung:
Prof. Dr. Antonio Krüger (Vorsitzender)
Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats:
Dr. Gabriël Clemens
Amtsgericht Kaiserslautern, HRB 2313
-------------------------------------------------------------