aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library.js8
-rw-r--r--system/include/emscripten/vector.h10
-rw-r--r--tests/test_core.py1
3 files changed, 19 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 6eab2587..bcd6d7dc 100644
--- a/src/library.js
+++ b/src/library.js
@@ -8621,6 +8621,14 @@ LibraryManager.library = {
},
//============================
+ // emscripten vector ops
+ //============================
+
+ emscripten_float32x4_signmask__inline: function(x) {
+ return x + '.signMask()';
+ },
+
+ //============================
// i64 math
//============================
diff --git a/system/include/emscripten/vector.h b/system/include/emscripten/vector.h
index ea148f0d..938f2369 100644
--- a/system/include/emscripten/vector.h
+++ b/system/include/emscripten/vector.h
@@ -4,3 +4,13 @@
typedef float float32x4 __attribute__((__vector_size__(16)));
typedef unsigned int uint32x4 __attribute__((__vector_size__(16)));
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+unsigned int emscripten_float32x4_signmask(float32x4 x);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/tests/test_core.py b/tests/test_core.py
index b421659c..6857d803 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -8705,6 +8705,7 @@ int main(int argc, char **argv) {
c = _mm_set_ps(9.0, 4.0, 0, -9.0);
d = _mm_set_ps(10.0, 14.0, -12, -2.0);
printf("6floats! %d, %d, %d, %d %d, %d, %d, %d\n", (int)c[0], (int)c[1], (int)c[2], (int)c[3], (int)d[0], (int)d[1], (int)d[2], (int)d[3]);
+ //printf("7calcs: %d\n", emscripten_float32x4_signmask(c));
}
return 0;