Revision: 53825
http://brlcad.svn.sourceforge.net/brlcad/?rev=53825&view=rev
Author: starseeker
Date: 2012-11-26 22:30:53 +0000 (Mon, 26 Nov 2012)
Log Message:
-----------
Back up changes to vector_x86.h and dvec.h - causing build failures on linux.
Wasn't showing up in CMake build because the header test that triggered it
wasn't in brlcad_config.h
Modified Paths:
--------------
brlcad/trunk/include/dvec.h
brlcad/trunk/include/vector_x86.h
Modified: brlcad/trunk/include/dvec.h
===================================================================
--- brlcad/trunk/include/dvec.h 2012-11-26 22:29:18 UTC (rev 53824)
+++ brlcad/trunk/include/dvec.h 2012-11-26 22:30:53 UTC (rev 53825)
@@ -38,12 +38,9 @@
const double VEQUALITY = 0.0000001;
template<int LEN>
- struct dvec_internal;
+ struct vec_internal;
template<int LEN>
- struct fvec_internal;
-
- template<int LEN>
class dvec;
template<int LEN>
@@ -65,15 +62,12 @@
class dvec {
public:
dvec(double s);
- dvec(const float* vals);
- dvec(const double* vals);
+ dvec(const double* vals, bool aligned=true);
dvec(const dvec<LEN>& p);
dvec<LEN>& operator=(const dvec<LEN>& p);
double operator[](int index) const;
- void u_store(float* arr) const;
void u_store(double* arr) const;
- void a_store(float* arr) const;
void a_store(double* arr) const;
bool operator==(const dvec<LEN>& b) const;
@@ -110,10 +104,9 @@
double operator()(double a) const { return ::sqrt(a); }
};
private:
- dvec_internal<LEN> data;
+ vec_internal<LEN> data;
- dvec(const dvec_internal<LEN>& d);
- dvec(const fvec_internal<LEN>& f);
+ dvec(const vec_internal<LEN>& d);
};
//#define DVEC4(V, t, a, b, c, d) double v#t[4] VEC_ALIGN = {(a), (b), (c),
(d)}; V(v#t)
@@ -187,15 +180,10 @@
return sqrt(sq.foldr(0, dvec<2>::add()));
}
inline
- void move(pt2d_t a, const float *b) {
+ void move(pt2d_t a, const pt2d_t b) {
a[0] = b[0];
a[1] = b[1];
}
- inline
- void move(pt2d_t a, const double *b) {
- a[0] = b[0];
- a[1] = b[1];
- }
}
#endif /* __DVEC_H__ */
Modified: brlcad/trunk/include/vector_x86.h
===================================================================
--- brlcad/trunk/include/vector_x86.h 2012-11-26 22:29:18 UTC (rev 53824)
+++ brlcad/trunk/include/vector_x86.h 2012-11-26 22:30:53 UTC (rev 53825)
@@ -62,24 +62,20 @@
}
template<int LEN>
-inline dvec<LEN>::dvec(const float* vals)
+inline dvec<LEN>::dvec(const double* vals, bool aligned)
{
- for (int i = 0; i < LEN/2; i++) {
- /* NOTE: assumes that vals are 16-byte aligned */
- data.v[i] = _mm_load_ps(&vals[i*2]);
+ if (aligned) {
+ for (int i = 0; i < LEN/2; i++) {
+ data.v[i] = _mm_load_pd(&vals[i*2]);
+ }
+ } else {
+ for (int i = 0; i < LEN/2; i++) {
+ data.v[i] = _mm_loadu_pd(&vals[i*2]);
+ }
}
}
template<int LEN>
-inline dvec<LEN>::dvec(const double* vals)
-{
- for (int i = 0; i < LEN/2; i++) {
- /* NOTE: assumes that vals are 16-byte aligned */
- data.v[i] = _mm_load_pd(&vals[i*2]);
- }
-}
-
-template<int LEN>
inline dvec<LEN>::dvec(const dvec<LEN>& p)
{
for (int i = 0; i < LEN/2; i++) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits