|Re: [eigen] log10 support?|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] log10 support?
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Mon, 7 Jun 2010 23:46:58 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=ZxIblUw/i+PYIY5ANn34BTP1sC38p5IIwjyQwNdRWPo=; b=cox/tT9b6XR6NhP6pKOfXlbp+Q2jg4525TrLdZZQI5ZqAf4hAU1XTvMs0doHVUuIVM YEg1toVy7vXVoo/Nc0oAaWfm2cezOaUGUvMTo1SaD1+krjLjZn7qz1+K9LBRD0jsTw0W z7q7YQnaR0WinC9xNjm0FQa3Oiv41DPzR8Xk8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RO6nAus68bALjB/tjmrmWAzPcv6gQ3GKxKT2KsVV6OOS/4AL0xrSh620UzNTWpXenX aGQYceD8i6xqv4FWavl+RMjIDNhA1mxe/UJdyGqmlNy4d4tSfIY+ZV16GDlZHvc+zWLk VQ0hijPCkGGLRTAHyNpHn7OeD4Zyy/wY8UmYg=
Let me try to answer for Benoit. :)
On Mon, Jun 7, 2010 at 11:20 PM, Trevor Irons <trevorirons@xxxxxxxxx> wrote:
> Sure, I can do this. I prefer store a minimum of constants. But if it will
> be faster, then sure.
> Why won't calls to std::log10 be vectorized? No sse instructions?
This is because std::log is not right away available as an SSE
intrinsic and we have a special version based on the code from here:
Nonetheless I think your patch is the right way to go. We could
achieve easily what Benoit suggests by offering a version of ei_plog10
Packet4f ei_plog10(Packet4f x)
const Packet4f ei_p4f_log10 = ei_plog(ei_pset1(10.0f));
return ei_pdiv(ei_plog(x), ei_p4f_log10);
which uses "Packet4f ei_plog(Packet4f x)". The constant would probably
be taken care of by a decent compiler, i.e. I don't think we need
> Also, is there any desire to have log10 defined your way in Eigen, for convenience? Or are you just suggesting I do this locally?
I am pretty sure he meant that it would be nice to really have this in
Eigen and not just in a local copy... though I am wildly guessing.
p.s. I am pretty tired an hope that I picked the right conversion factor ...