From ae7c664016471c08ba8fec252e0cab75db817286 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 9 Sep 2019 16:46:36 -0300 Subject: [PATCH] Add OpAny and OpAll --- include/sirit/sirit.h | 6 ++++++ src/instructions/logical.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h index 0c86601..1a0def9 100644 --- a/include/sirit/sirit.h +++ b/include/sirit/sirit.h @@ -346,6 +346,12 @@ public: // Logical + /// Result is true if any component of Vector is true, otherwise result is false. + Id OpAny(Id result_type, Id vector); + + /// Result is true if all components of Vector are true, otherwise result is false. + Id OpAll(Id result_type, Id vector); + /// Result is true if x is an IEEE NaN, otherwise result is false. Id OpIsNan(Id result_type, Id operand); diff --git a/src/instructions/logical.cpp b/src/instructions/logical.cpp index 87c5e2e..a40818b 100644 --- a/src/instructions/logical.cpp +++ b/src/instructions/logical.cpp @@ -35,6 +35,8 @@ namespace Sirit { return AddCode(std::move(op)); \ } +DEFINE_UNARY(OpAny, spv::Op::OpAny); +DEFINE_UNARY(OpAll, spv::Op::OpAll); DEFINE_UNARY(OpIsNan, spv::Op::OpIsNan) DEFINE_UNARY(OpIsInf, spv::Op::OpIsInf) DEFINE_BINARY(OpLogicalEqual, spv::Op::OpLogicalEqual)