![]() |
mutable
A Database System for Research and Fast Prototyping
|
An Expr<T, L>
combines a PrimitiveExpr<T, L>
value with a PrimitiveExpr<bool, L>
, called NULL information, to implement a value with three-valued logic (3VL).
More...
#include <WasmDSL.hpp>
Public Types | |
using | type = T |
using | primitive_type = PrimitiveExpr< T, L > |
Public Member Functions | |
Expr (PrimitiveExpr< T, L > value) | |
| |
Expr (PrimitiveExpr< T, L > value, PrimitiveExpr< bool, L > is_null) | |
| |
Expr (std::pair< PrimitiveExpr< T, L >, PrimitiveExpr< bool, L > > value) | |
| |
Expr (Us... value) | |
template<decayable... Us> requires (sizeof...(Us) > 0) (Us... us) | |
and (dsl_primitive< std::decay_t< Us > > and ...) and | |
Constructs an Expr from a decayable constant value . | |
Expr (Us... value) | |
Expr (const Expr &)=delete | |
Expr (Expr &other) | |
| |
Expr (Expr &&other) | |
| |
Expr & | operator= (Expr &&)=delete |
~Expr () | |
operator bool () const | |
Returns true if this Expr actually holds a value (Binaryen AST), false otherwise. | |
PrimitiveExpr< T, L > | insist_not_null () |
Moves the current value_ out of this . | |
std::pair< PrimitiveExpr< T, L >, PrimitiveExpr< bool, L > > | split () |
Splits this Expr into a PrimitiveExpr<T, L> with the value and a PrimitiveExpr<bool, L> with the NULL information. | |
Expr | clone () const |
Returns a deep copy of this . | |
void | discard () |
Discards this . | |
bool | can_be_null () const |
Returns true if this may be NULL , false otherwise. | |
PrimitiveExpr< bool, L > | is_null () |
Returns true if this is NULL , false otherwise. | |
PrimitiveExpr< bool, L > | not_null () |
Returns true if this is NOT NULL , false otherwise. | |
PrimitiveExpr< bool, L > | is_true_and_not_null () |
Returns true if the value is true and NOT NULL . | |
PrimitiveExpr< bool, L > | is_false_and_not_null () |
Returns true if the value is false and NOT NULL . | |
template<dsl_primitive To, std::size_t ToL = L> requires requires { static_cast<PrimitiveExpr<To, ToL>>(value_); } | |
operator Expr< To, ToL > () | |
Implicitly converts an Expr<T, L> to an Expr<To, ToL> . | |
template<dsl_primitive To, std::size_t ToL = L> requires requires { value_.template to<To, ToL>(); } | |
Expr< To, ToL > | to () |
Explicitly converts an Expr<T, L> to an Expr<To, ToL> . | |
template<dsl_primitive To, std::size_t ToL = L> requires requires { value_.template reinterpret<To, ToL>(); } | |
Expr< To, ToL > | reinterpret () |
Reinterpret an Expr<T, L> to an Expr<To, ToL> . | |
template<std::size_t ToL> requires requires { value_.template broadcast<ToL>(); is_null_.template broadcast<ToL>(); } | |
Expr< T, ToL > | broadcast () |
Broadcasts a PrimitiveExpr<T, 1> to a PrimitiveExpr<T, ToL> . | |
UNARY_LIST (UNARY) auto add_pairwise() | |
Expr< uint32_t, 1 > | bitmask () |
Expr< bool, 1 > | any_true () |
Expr< bool, 1 > | all_true () |
PrimitiveExpr< uint64_t, L > | hash () |
BINARY (operator+)BINARY(operator-)BINARY(operator*)BINARY(operator/)BINARY(operator%)BINARY(operator bitand) BINARY(operator bitor) BINARY(operator xor) BINARY(operator<<) BINARY(operator>>) BINARY(operator | |
L | operator and (Expr< bool, L > other) |
Expr< bool, L > | and_not (Expr< bool, L > other) |
Implements logical and not according to 3VL of Kleene and Priest's logic. | |
Expr< bool, L > | operator or (Expr< bool, L > other) |
Implements logical or according to 3VL of Kleene and Priest's logic. | |
template<std::size_t M> requires requires { value_.template extract<M>(); } | |
Expr< T, 1 > | extract () |
Extracts the. | |
template<std::size_t M, expr_convertible U> requires requires (expr_t<U> u) { Expr<T, 1>(u); } requires (Expr<T, 1> e) { this->value_.template replace<M>(e.value_); } | |
Expr | replace (U &&_value) |
Replaces the. | |
Expr | swizzle_bytes (PrimitiveExpr< uint8_t, 16 > indices) and |
Selects lanes of this in byte granularity depending on the indices specified by indices . | |
Static Public Member Functions | |
static Expr | Null () |
Returns an Expr that is NULL . | |
Data Fields | |
template<dsl_primitive... Us> | |
and { PrimitiveExpr<T, L>(us...) | |
Constructs an Expr from a constant value . | |
Static Public Attributes | |
static constexpr std::size_t | num_simd_lanes = L |
Private Member Functions | |
std::pair< PrimitiveExpr< T, L >, PrimitiveExpr< bool, L > > | split_unsafe () |
Splits this Expr into a PrimitiveExpr<T, L> with the value and a PrimitiveExpr<bool, L> with the NULL information. | |
Private Attributes | |
PrimitiveExpr< T, L > | value_ |
| |
PrimitiveExpr< bool, L > | is_null_ = PrimitiveExpr<bool, L>() |
A boolean expression that evaluates to true at runtime iff this Expr is NULL . | |
Friends | |
template<typename , std::size_t > | |
struct | Expr |
template<typename , VariableKind , bool , std::size_t > | |
class | detail::variable_storage |
An Expr<T, L>
combines a PrimitiveExpr<T, L>
value with a PrimitiveExpr<bool, L>
, called NULL information, to implement a value with three-valued logic (3VL).
Expr<T, L>
provides the same operations as PrimitiveExpr<T, L>
. It delegates operations to the underlying value and additionally combines the NULL information of the operand(s) into the new NULL information of the result. Particular exceptions are operator and
and operator or
, for which Expr<T, L>
implements 3VL according to Kleene and Priest's logic.
Definition at line 4515 of file WasmDSL.hpp.
using m::wasm::Expr< T, L >::primitive_type = PrimitiveExpr<T, L> |
Definition at line 4519 of file WasmDSL.hpp.
using m::wasm::Expr< T, L >::type = T |
Definition at line 4517 of file WasmDSL.hpp.
|
inline |
Implicitly constructs an
Expr
from avalue
.
Definition at line 4534 of file WasmDSL.hpp.
References M_insist, and m::wasm::value.
|
inline |
Constructs an
Expr
from avalue
and NULL informationis_null
.
Definition at line 4539 of file WasmDSL.hpp.
References m::wasm::is_null(), M_insist, M_insist_no_ternary_logic, and m::wasm::value.
|
inlineexplicit |
Constructs an
Expr
from astd::pair
value
of value and NULL info.
Definition at line 4549 of file WasmDSL.hpp.
References m::wasm::value.
|
inlineexplicit |
Definition at line 4556 of file WasmDSL.hpp.
References m::wasm::L, m::T(), and m::wasm::value.
|
inlineexplicit |
Definition at line 4564 of file WasmDSL.hpp.
References m::wasm::value.
|
delete |
Constructs a new
Expr
by moving the underlyingvalue_
andis_null_
ofother
tothis
.
Definition at line 4570 of file WasmDSL.hpp.
|
inline |
Constructs a new
Expr
by moving the underlyingvalue_
andis_null_
ofother
tothis
.
Definition at line 4572 of file WasmDSL.hpp.
|
inline |
Definition at line 4576 of file WasmDSL.hpp.
References M_insist.
|
inline |
Definition at line 4783 of file WasmDSL.hpp.
|
inline |
Constructs an Expr
from a decayable constant value
.
Definition at line 4562 of file WasmDSL.hpp.
|
inline |
Implements logical and not according to 3VL of Kleene and Priest's logic.
Definition at line 4941 of file WasmDSL.hpp.
|
inline |
Definition at line 4776 of file WasmDSL.hpp.
m::wasm::Expr< T, L >::BINARY | ( | operator+ | ) |
References m::operator<<().
|
inline |
Definition at line 4767 of file WasmDSL.hpp.
|
inline |
Broadcasts a PrimitiveExpr<T, 1>
to a PrimitiveExpr<T, ToL>
.
Only applicable if PrimitiveExpr<T, 1>
can be broadcasted to PrimitiveExpr<T, ToL>
.
Definition at line 4716 of file WasmDSL.hpp.
|
inline |
Returns true
if this
may be NULL
, false
otherwise.
Definition at line 4637 of file WasmDSL.hpp.
References m::wasm::bool.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 4792 of file WasmDSL.hpp.
|
inline |
Moves the current value_
out of this
.
Requires (and insists) that this
cannot be NULL
.
Definition at line 4596 of file WasmDSL.hpp.
References m::wasm::can_be_null(), M_insist, and Wasm_insist.
|
inline |
Returns true
if the value is false
and NOT NULL
.
Useful to use this Expr<bool, L>
for conditional control flow.
Definition at line 4672 of file WasmDSL.hpp.
References and(), and m::wasm::can_be_null().
|
inline |
Returns true
if this
is NULL
, false
otherwise.
Definition at line 4640 of file WasmDSL.hpp.
References m::wasm::can_be_null(), and M_insist_no_ternary_logic.
|
inline |
Returns true
if the value is true
and NOT NULL
.
Useful to use this Expr<bool, L>
for conditional control flow.
Definition at line 4663 of file WasmDSL.hpp.
References and(), and m::wasm::can_be_null().
|
inline |
Returns true
if this
is NOT NULL
, false
otherwise.
Definition at line 4651 of file WasmDSL.hpp.
References m::wasm::can_be_null(), and M_insist_no_ternary_logic.
|
inlinestatic |
|
inline |
Definition at line 4903 of file WasmDSL.hpp.
References and().
|
inlineexplicit |
Returns true
if this Expr
actually holds a value (Binaryen AST), false
otherwise.
Can be used to test whether this Expr
has already been used.
Definition at line 4593 of file WasmDSL.hpp.
References m::wasm::bool.
|
inline |
Implicitly converts an Expr<T, L>
to an Expr<To, ToL>
.
Only applicable if PrimitiveExpr<T, L>
is implicitly convertible to PrimitiveExpr<To, ToL>
.
Definition at line 4698 of file WasmDSL.hpp.
|
inline |
Implements logical or according to 3VL of Kleene and Priest's logic.
Definition at line 4980 of file WasmDSL.hpp.
|
delete |
|
inline |
Reinterpret an Expr<T, L>
to an Expr<To, ToL>
.
Only applicable if PrimitiveExpr<T, L>
can be reinterpreted to PrimitiveExpr<To, ToL>
.
Definition at line 4710 of file WasmDSL.hpp.
|
inline |
Replaces the.
M | -th value of this with u . |
Definition at line 5033 of file WasmDSL.hpp.
|
inline |
Splits this Expr
into a PrimitiveExpr<T, L>
with the value and a PrimitiveExpr<bool, L>
with the NULL
information.
Then, moves these PrimitiveExpr
s out of this
.
Definition at line 4605 of file WasmDSL.hpp.
References m::wasm::is_null(), M_insist, and m::wasm::value.
|
inlineprivate |
Splits this Expr
into a PrimitiveExpr<T, L>
with the value and a PrimitiveExpr<bool, L>
with the NULL
information.
Then, moves these PrimitiveExpr
s out of this
. Special care must be taken as the NULL information may be unusable, i.e. missing AST.
Definition at line 4585 of file WasmDSL.hpp.
References M_insist.
|
inline |
Selects lanes of this
in byte granularity depending on the indices specified by indices
.
Indices i
in the range [0, 15] select the i
-th` lane, indices outside of this range result in the value 0.
Definition at line 5046 of file WasmDSL.hpp.
References m::wasm::indices, and m::T().
|
inline |
Explicitly converts an Expr<T, L>
to an Expr<To, ToL>
.
Only applicable if PrimitiveExpr<T, L>
is explicitly convertible to PrimitiveExpr<To, ToL>
(via method to<To, ToL>()
).
Definition at line 4704 of file WasmDSL.hpp.
|
inline |
Definition at line 4751 of file WasmDSL.hpp.
References m::wasm::add_pairwise().
|
friend |
Definition at line 4523 of file WasmDSL.hpp.
|
friend |
Definition at line 4522 of file WasmDSL.hpp.
m::wasm::Expr< T, L >::and { PrimitiveExpr<T, L>(us...) |
Constructs an Expr
from a constant value
.
Definition at line 4555 of file WasmDSL.hpp.
|
private |
A boolean expression that evaluates to true
at runtime iff this Expr
is NULL
.
If this Expr
cannot be NULL
, then is_null_
evaluates to false
at compile time, i.e. not is_null_
.
Definition at line 4530 of file WasmDSL.hpp.
|
staticconstexpr |
Definition at line 4518 of file WasmDSL.hpp.
|
private |
the referenced value expression
Definition at line 4527 of file WasmDSL.hpp.