"plugins/amoeba/vscode:/vscode.git/clone" did not exist on "df265df8845de7e9e25169d457c0d416e1dc6ff0"
Commit 352f5605 authored by Marc Marí's avatar Marc Marí
Browse files

Return masks as ivec4 in ARM vectorization implementation

parent f83289a4
...@@ -157,24 +157,13 @@ public: ...@@ -157,24 +157,13 @@ public:
fvec4 operator|(fvec4 other) const { fvec4 operator|(fvec4 other) const {
return vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(val), vreinterpretq_u32_f32(other))); return vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(val), vreinterpretq_u32_f32(other)));
} }
fvec4 operator==(fvec4 other) const {
return vcvtq_f32_s32(vreinterpretq_s32_u32(vceqq_f32(val, other))); ivec4 operator==(fvec4 other) const;
} ivec4 operator!=(fvec4 other) const;
fvec4 operator!=(fvec4 other) const { ivec4 operator>(fvec4 other) const;
return vcvtq_f32_s32(vreinterpretq_s32_u32(vmvnq_u32(vceqq_f32(val, other)))); // not(equals(val, other)) ivec4 operator<(fvec4 other) const;
} ivec4 operator>=(fvec4 other) const;
fvec4 operator>(fvec4 other) const { ivec4 operator<=(fvec4 other) const;
return vcvtq_f32_s32(vreinterpretq_s32_u32(vcgtq_f32(val, other)));
}
fvec4 operator<(fvec4 other) const {
return vcvtq_f32_s32(vreinterpretq_s32_u32(vcltq_f32(val, other)));
}
fvec4 operator>=(fvec4 other) const {
return vcvtq_f32_s32(vreinterpretq_s32_u32(vcgeq_f32(val, other)));
}
fvec4 operator<=(fvec4 other) const {
return vcvtq_f32_s32(vreinterpretq_s32_u32(vcleq_f32(val, other)));
}
operator ivec4() const; operator ivec4() const;
/** /**
...@@ -281,6 +270,32 @@ inline ivec4 fvec4::expandBitsToMask(int bitmask) { ...@@ -281,6 +270,32 @@ inline ivec4 fvec4::expandBitsToMask(int bitmask) {
bitmask & 4 ? -1 : 0, bitmask & 4 ? -1 : 0,
bitmask & 8 ? -1 : 0); bitmask & 8 ? -1 : 0);
} }
// Comparison operators
inline ivec4 fvec4::operator==(fvec4 other) const {
return vreinterpretq_s32_u32(vceqq_f32(val, other));
}
inline ivec4 fvec4::operator!=(fvec4 other) const {
return vreinterpretq_s32_u32(vmvnq_u32(vceqq_f32(val, other))); // not(equals(val, other))
}
inline ivec4 fvec4::operator>(fvec4 other) const {
return vreinterpretq_s32_u32(vcgtq_f32(val, other));
}
inline ivec4 fvec4::operator<(fvec4 other) const {
return vreinterpretq_s32_u32(vcltq_f32(val, other));
}
inline ivec4 fvec4::operator>=(fvec4 other) const {
return vreinterpretq_s32_u32(vcgeq_f32(val, other));
}
inline ivec4 fvec4::operator<=(fvec4 other) const {
return vreinterpretq_s32_u32(vcleq_f32(val, other));
}
// Functions that operate on fvec4s. // Functions that operate on fvec4s.
static inline fvec4 min(fvec4 v1, fvec4 v2) { static inline fvec4 min(fvec4 v1, fvec4 v2) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment