mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
WasmUtil.cpp File Reference
#include "backend/WasmUtil.hpp"
#include "backend/Interpreter.hpp"
#include "backend/WasmMacro.hpp"
#include "mutable/util/macro.hpp"
#include <mutable/util/concepts.hpp>
#include <optional>
#include <regex>
#include <tuple>
Include dependency graph for WasmUtil.cpp:

Go to the source code of this file.

Namespaces

namespace  options
 

‍command-line options for the HeuristicSearchPlanEnumerator


 
namespace  m
 

‍mutable namespace


 
namespace  m::wasm
 

Macros

#define UNOP(OP)
 
#define BINOP(OP)
 
#define CMPOP(OP, STRCMP_OP)
 
#define CALL(TYPE)   if constexpr (IsStore) store.template operator()<TYPE>(); else load.template operator()<TYPE>()
 
#define CALL(TYPE)   if constexpr (IsStore) store.template operator()<TYPE>(); else load.template operator()<TYPE>()
 

Functions

template<arithmetic T>
void convert_in_place (SQL_t &operand)
 Convert operand of some SQL_t type to the target type.
 
void convert_in_place (SQL_t &operand, const Numeric *to_type)
 Convert operand to runtime type to_type.
 
template<bool CanBeNull, std::size_t L>
std::conditional_t< CanBeNull, _Bool< L >, Bool< L > > compile_cnf (ExprCompiler &C, const cnf::CNF &cnf)
 
template<bool IsStore, std::size_t L, bool SinglePass, bool PointerSharing, VariableKind Kind>
requires (L > 0)
 m::wasm::and (is_pow_2(L)) std
 Compiles the data layout layout containing tuples of schema layout_schema such that it sequentially stores/loads (depending on.
 
template<bool IsStore>
void m::wasm::compile_data_layout_point_access (const Schema &_tuple_value_schema, const Schema &_tuple_addr_schema, Ptr< void > base_address, const storage::DataLayout &layout, const Schema &layout_schema, U32x1 tuple_id)
 Compiles the data layout layout starting at memory address base_address and containing tuples of schema layout_schema such that it stores/loads the single tuple with schema _tuple_value_schema and ID tuple_id.
 

Macro Definition Documentation

◆ BINOP

#define BINOP (   OP)
Value:
apply_binop( \
[](auto lhs, auto rhs) -> decltype(lhs.operator OP(rhs)) { return lhs.operator OP(rhs); } \
); break

◆ CALL [1/2]

#define CALL (   TYPE)    if constexpr (IsStore) store.template operator()<TYPE>(); else load.template operator()<TYPE>()

◆ CALL [2/2]

#define CALL (   TYPE)    if constexpr (IsStore) store.template operator()<TYPE>(); else load.template operator()<TYPE>()

◆ CMPOP

#define CMPOP (   OP,
  STRCMP_OP 
)
Value:
{ \
if (e.lhs->type()->is_character_sequence()) { \
M_insist(e.rhs->type()->is_character_sequence()); \
M_insist(CodeGenContext::Get().num_simd_lanes() == 1, "invalid number of SIMD lanes"); \
apply_binop( \
[](NChar lhs, NChar rhs) -> _Boolx1 { \
return strcmp(lhs, rhs, STRCMP_OP); \
} \
); break; \
} else { \
BINOP(OP); \
} \
}
_I32x1 strcmp(NChar left, NChar right, bool reverse=false)
Compares two strings left and right.
Definition: WasmUtil.cpp:3270
static constexpr std::size_t num_simd_lanes
‍the number of SIMD lanes of the represented expression, i.e. 1 for scalar and at least 2 for vectori...
Definition: WasmDSL.hpp:1466
static CodeGenContext & Get()
Definition: WasmUtil.hpp:889

◆ UNOP

#define UNOP (   OP)
Value:
apply_unop(overloaded { \
[](auto &&expr) -> decltype(expr.operator OP()) { return expr.operator OP(); }, \
}); \
break
Helper type to deduce the Expr<U> type given a.
Definition: WasmDSL.hpp:160

Function Documentation

◆ compile_cnf()

template<bool CanBeNull, std::size_t L>
std::conditional_t< CanBeNull, _Bool< L >, Bool< L > > compile_cnf ( ExprCompiler C,
const cnf::CNF cnf 
)

Definition at line 112 of file WasmUtil.cpp.

References m::and, m::wasm::ExprCompiler::compile(), M_CONSTEXPR_COND, and M_insist.

◆ convert_in_place() [1/2]

template<arithmetic T>
void convert_in_place ( SQL_t operand)

Convert operand of some SQL_t type to the target type.

Template Parameters
T.
Tmust be a SQL_t type. Conversion is done in place, i.e. the SQL_t instance is directly modified.

Definition at line 61 of file WasmUtil.cpp.

References M_unreachable.

Referenced by m::wasm::ExprCompiler::operator()().

◆ convert_in_place() [2/2]

void convert_in_place ( SQL_t operand,
const Numeric to_type 
)

Convert operand to runtime type to_type.

This is done by delegating to convert_in_place<T> through a dynamic dispatch based on to_type.

Definition at line 78 of file WasmUtil.cpp.

References M_unreachable, and m::Numeric::size().