Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/astro/boinc-setiathome/files/patch-client_vector_x86__float4.h
16125 views
1
--- client/vector/x86_float4.h.orig 2018-01-14 23:02:12 UTC
2
+++ client/vector/x86_float4.h
3
@@ -58,8 +58,8 @@ extern const_float4 INDGEN[2];
4
5
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
6
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
7
-#define SIGN_BITS (*(__m128i *)sign_bits)
8
-#define OTHER_BITS (*(__m128i *)other_bits)
9
+#define SIGN_BITS (*(__m128 *)sign_bits)
10
+#define OTHER_BITS (*(__m128 *)other_bits)
11
12
13
14
@@ -104,19 +104,19 @@ struct float4 {
15
#endif
16
return rv;
17
};
18
- inline float4 operator |(const __m128i &b) const {
19
+ inline float4 operator |(const __m128 &b) const {
20
register float4 rv;
21
#ifdef USE_INTRINSICS
22
- rv.m=_mm_or_ps(*(__m128 *)&b,m);
23
+ rv.m=_mm_or_ps(b,m);
24
#elif defined(__GNUC__)
25
__asm__ ( "orps %2,%0" : "=x" (rv.m) : "0" (b), "xm" (m));
26
#endif
27
return rv;
28
};
29
- inline float4 operator &(const __m128i &b) const {
30
+ inline float4 operator &(const __m128 &b) const {
31
register float4 rv;
32
#ifdef USE_INTRINSICS
33
- rv.m=_mm_and_ps(*(__m128 *)&b,m);
34
+ rv.m=_mm_and_ps(b,m);
35
#elif defined(__GNUC__)
36
__asm__ ( "andps %2,%0" : "=x" (rv.m) : "0" (b), "xm" (m));
37
#endif
38
@@ -159,7 +159,9 @@ struct float4 {
39
return *this;
40
}
41
inline operator __m128() {return m;};
42
+#ifdef __SSE2__
43
inline operator __m128i() {return *(__m128i *)&m; };
44
+#endif
45
inline float4 abs() const {
46
// clear the sign bits
47
return *this & OTHER_BITS;
48
@@ -258,7 +260,9 @@ struct const_float4 : public float4 {
49
inline const_float4(const float4 &b) { m=b.m; };
50
inline operator float4() const { return *this; };
51
inline operator __m128() {return m;};
52
+#ifdef __SSE2__
53
inline operator __m128i() {return *(__m128i *)&m; };
54
+#endif
55
};
56
57
#endif
58
59