aboutsummaryrefslogtreecommitdiff
path: root/libphobos/libdruntime/gcc/simd.d
diff options
context:
space:
mode:
Diffstat (limited to 'libphobos/libdruntime/gcc/simd.d')
-rw-r--r--libphobos/libdruntime/gcc/simd.d26
1 files changed, 19 insertions, 7 deletions
diff --git a/libphobos/libdruntime/gcc/simd.d b/libphobos/libdruntime/gcc/simd.d
index ffca50f..ebd94bf 100644
--- a/libphobos/libdruntime/gcc/simd.d
+++ b/libphobos/libdruntime/gcc/simd.d
@@ -306,13 +306,25 @@ template blendvector(V0, V1, M)
* assert(c.array == [0, 0, -1, -1]);
* ---
*/
-V equalMask(V)(V op1, V op2) if (isVectorType!V);
+V equalMask(V)(V op1, V op2) if (isVectorType!V)
+{
+ return op1 == op2;
+}
/// Ditto
-V notEqualMask(V)(V op1, V op2) if (isVectorType!V);
+V notEqualMask(V)(V op1, V op2) if (isVectorType!V)
+{
+ return op1 != op2;
+}
/// Ditto
-V greaterMask(V)(V op1, V op2) if (isVectorType!V);
+V greaterMask(V)(V op1, V op2) if (isVectorType!V)
+{
+ return op1 > op2;
+}
/// Ditto
-V greaterOrEqualMask(V)(V op1, V op2) if (isVectorType!V);
+V greaterOrEqualMask(V)(V op1, V op2) if (isVectorType!V)
+{
+ return op1 >= op2;
+}
/**
* Perform an element-wise logical comparison between two vectors, producing
@@ -326,19 +338,19 @@ V greaterOrEqualMask(V)(V op1, V op2) if (isVectorType!V);
*/
V notMask(V)(V op1) if (isVectorType!V)
{
- return equalMask(op1, 0);
+ return op1 == 0;
}
/// Ditto
V andAndMask(V)(V op1, V op2) if (isVectorType!V)
{
- return notEqualMask(op1, 0) & notEqualMask(op2, 0);
+ return (op1 != 0) & (op2 != 0);
}
/// Ditto
V orOrMask(V)(V op1, V op2) if (isVectorType!V)
{
- return notEqualMask(op1, 0) | notEqualMask(op2, 0);
+ return (op1 != 0) | (op2 != 0);
}
// Private helper templates.