blob: 6e500da606dd2c5c978668873f8f82d56d5b492f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
--- src/SeExpr/SeNoise.cpp.orig 2015-08-28 22:32:38 UTC
+++ src/SeExpr/SeNoise.cpp
@@ -16,7 +16,9 @@
*/
#include <iostream>
+#ifdef __SSE4_1__
#include <smmintrin.h>
+#endif
#include "SeExprBuiltins.h"
namespace{
@@ -25,14 +27,18 @@ namespace{
#include "SeNoise.h"
namespace SeExpr{
+#ifdef __SSE4_1__
inline double floorSSE(double val) {
- return _mm_cvtsd_f64(_mm_floor_sd(_mm_set_sd(0.0), _mm_set_sd(val)));
+ return _mm_floor_sd(_mm_set_sd(0.0), _mm_set_sd(val))[0];
}
inline double roundSSE(double val) {
- return _mm_cvtsd_f64(_mm_round_sd(_mm_set_sd(0.0), _mm_set_sd(val), _MM_FROUND_TO_NEAREST_INT));
+ return _mm_round_sd(_mm_set_sd(0.0), _mm_set_sd(val), _MM_FROUND_TO_NEAREST_INT)[0];
}
-
+#else
+#define floorSSE floor
+#define roundSSE round
+#endif
//! This is the Quintic interpolant from Perlin's Improved Noise Paper
double s_curve(double t) {
|