|Re: [eigen] Patch for quaternion normalization and cross product for Vector4f|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Patch for quaternion normalization and cross product for Vector4f
- From: Rohit Garg <rpg.314@xxxxxxxxx>
- Date: Tue, 10 Mar 2009 17:08:20 +0530
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=CTW5F1t0rXqtEGTamumAGkpaB0EEbLraVmwS84PKJZw=; b=dgDwgeGupZXXgVd/MK8TquMcAEkK6a/ufchXcjqSh0+m81TZrAuFiZZSQ3HJac0p8T f8WU37LqM2/5rErxuArxXOGTgdgD+G6aEpWAii4KSJDFxBkACtirVvGOyb0091tuDX3D /mpqpQbWHTQC+TFEmNEedTrR8j5BiaAH7hIrg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=lZr4kwiMgWtX9ebdBhixWlTbiJUJZjZ7uskwaDQ4FFMdRQHz6Dbh3vufjQYNAk9JFp 4CxCGDdCvcGlwOSVbKAoJFMph3PdQZ+dbCU3zZ5ra2XYmIv/+Yq7J6TMjExdkuWrFn1z iQZWB+nw1fcz3RHtYE1aX3VepvVywUQGyL8rY=
On Tue, Mar 10, 2009 at 4:13 PM, Gael Guennebaud
> for your information normalize was already automagically vectorized
I didn't know that. Thanks for telling me.
> About the cross product, the perf boost is pretty low (x1.25), so I
> don't know if that's really worth it. It is much better to pack your
> data such that 4 cross products can be performed once.
Well, that's the classic AoS vs SoA argument. It's just that I have
seen many people use Vector3f where you lose vectorization. And yes, I
am doing an app where using vec4f for 3dim vectors would be a definite
win even without the cross product. So it is not an abstract demand.
In this case, the perf boost may not be much but added with other
cases, such as add, sub, dot, in a large app, it will almost always
turn out to be better.
SoA may be better from vectorization pov, but AoS is used more often
simply because it is easier from a conceptual pov. IMHO, it is a small
thing which makes vec4f much better overall and usable for stuff like
3d geometry. So please consider including it. If you look at the
Bullet physics SDK, they implement vec3 routines using sse only.
> Beyond that, yes "svn diff" is the right way to generate a patch.
So I got something right here. :)
Department of Physics
Indian Institute of Technology