![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include "backend/WasmDSL.hpp"
#include <functional>
#include <mutable/catalog/Schema.hpp>
#include <mutable/IR/PhysicalOptimizer.hpp>
#include <mutable/parse/AST.hpp>
#include <mutable/util/concepts.hpp>
#include <optional>
#include <variant>
#include <mutable/util/macro.hpp>
Go to the source code of this file.
Data Structures | |
struct | m::wasm::NChar |
struct | m::wasm::Decimal< Base > |
struct | m::wasm::ExprCompiler |
Compiles AST expressions m::Expr to Wasm ASTs m::wasm::Expr<T> . More... | |
struct | m::wasm::Environment |
Binds Schema::Identifier s to Expr<T> s. More... | |
struct | m::wasm::Scope |
struct | m::wasm::CodeGenContext |
The Wasm CodeGenContext provides context information necessary for code generation. More... | |
class | m::wasm::buffer_storage< false > |
class | m::wasm::buffer_storage< true > |
struct | m::wasm::Buffer< IsGlobal > |
Buffers tuples by materializing them into memory. More... | |
struct | m::wasm::buffer_load_proxy_t< IsGlobal > |
Proxy to implement loads from a buffer. More... | |
struct | m::wasm::buffer_store_proxy_t< IsGlobal > |
Proxy to implement stores to a buffer. More... | |
struct | m::wasm::buffer_swap_proxy_t< IsGlobal > |
Proxy to implement swaps in a buffer. More... | |
Namespaces | |
namespace | m |
| |
namespace | m::wasm |
Concepts | |
concept | m::wasm::sql_addr_type |
concept | m::wasm::sql_boolean_type |
Macros | |
#define | SQL_TYPES_SCALAR(X) |
#define | SQL_ADDR_TYPES_SCALAR(X) |
#define | SQL_TYPES(X) |
#define | SQL_ADDR_TYPES(X) |
#define | ADD_EXPR_SQL_TYPE(TYPE) template<> struct is_sql_type<TYPE>{}; |
#define | ADD_EXPR_SQL_ADDR_TYPE(TYPE) template<> struct is_sql_addr_type<TYPE>{}; |
#define | ADD_TYPE(TYPE) , TYPE |
#define | ADD_TYPE(TYPE) , TYPE |
Typedefs | |
using | m::wasm::Decimal32 = Decimal< int32_t > |
using | m::wasm::Decimal64 = Decimal< int64_t > |
using | m::wasm::SQL_t = std::variant< std::monostate #define ADD_TYPE(TYPE) SQL_TYPES(ADD_TYPE) > |
using | m::wasm::SQL_addr_t = std::variant< std::monostate #define ADD_TYPE(TYPE) SQL_ADDR_TYPES(ADD_TYPE) > |
using | m::wasm::SQL_boolean_t = std::variant< std::monostate, _Boolx1, _Boolx16, _Boolx32 > |
using | m::wasm::LocalBuffer = Buffer< false > |
using | m::wasm::GlobalBuffer = Buffer< true > |
Enumerations | |
enum | m::wasm::cmp_op { m::wasm::EQ , m::wasm::NE , m::wasm::LT , m::wasm::LE , m::wasm::GT , m::wasm::GE } |
More... | |
Functions | |
template<typename Base > requires expr_convertible<Base> | |
and signed_integral< typename expr_t< Base >::type > Decimal< typename expr_t< Base >::type > | m::wasm::operator+ (Base &&left, Decimal< typename expr_t< Base >::type > right) |
template<typename Base > requires expr_convertible<Base> | |
and signed_integral< typename expr_t< Base >::type > Decimal< typename expr_t< Base >::type > | m::wasm::operator- (Base &&left, Decimal< typename expr_t< Base >::type > right) |
template<typename Base > requires expr_convertible<Base> | |
and signed_integral< typename expr_t< Base >::type > Decimal< typename expr_t< Base >::type > | m::wasm::operator* (Base &&left, Decimal< typename expr_t< Base >::type > right) |
template<typename Base > requires expr_convertible<Base> | |
and signed_integral< typename expr_t< Base >::type > Decimal< typename expr_t< Base >::type > | m::wasm::operator/ (Base &&left, Decimal< typename expr_t< Base >::type > right) |
m::wasm::SQL_TYPES (ADD_EXPR_SQL_TYPE) SQL_ADDR_TYPES(ADD_EXPR_SQL_ADDR_TYPE) template< typename T > concept sql_type | |
void | m::wasm::discard (SQL_t &variant) |
void | m::wasm::discard (SQL_addr_t &variant) |
template<sql_type To> | |
To | m::wasm::convert (SQL_t &variant) |
bool | m::wasm::can_be_null (const SQL_t &variant) |
template<std::size_t L = 1> | |
Bool< L > | m::wasm::is_null (SQL_t &variant) |
template<std::size_t L = 1> | |
Bool< L > | m::wasm::not_null (SQL_t &variant) |
template<VariableKind Kind> | |
std::tuple< Block, Block, Block > | m::wasm::compile_store_sequential (const Schema &tuple_value_schema, const Schema &tuple_addr_schema, Ptr< void > base_address, const storage::DataLayout &layout, std::size_t num_simd_lanes, const Schema &layout_schema, Variable< uint32_t, Kind, false > &tuple_id) |
Compiles the data layout layout containing tuples of schema layout_schema such that it sequentially stores tuples of schema tuple_value_schema starting at memory address base_address and tuple ID tuple_id . | |
template<VariableKind Kind> | |
std::tuple< Block, Block, Block > | m::wasm::compile_store_sequential_single_pass (const Schema &tuple_value_schema, const Schema &tuple_addr_schema, Ptr< void > base_address, const storage::DataLayout &layout, std::size_t num_simd_lanes, const Schema &layout_schema, Variable< uint32_t, Kind, false > &tuple_id) |
Compiles the data layout layout containing tuples of schema layout_schema such that it sequentially stores tuples of schema tuple_value_schema starting at memory address base_address and tuple ID tuple_id . | |
template<VariableKind Kind> | |
std::tuple< Block, Block, Block > | m::wasm::compile_load_sequential (const Schema &tuple_value_schema, const Schema &tuple_addr_schema, Ptr< void > base_address, const storage::DataLayout &layout, std::size_t num_simd_lanes, const Schema &layout_schema, Variable< uint32_t, Kind, false > &tuple_id) |
Compiles the data layout layout containing tuples of schema layout_schema such that it sequentially loads tuples of schema tuple_value_schema starting at memory address base_address and tuple ID tuple_id . | |
void | m::wasm::compile_store_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 the single tuple with schema tuple_value_schema and ID tuple_id . | |
void | m::wasm::compile_load_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 loads the single tuple with schema tuple_value_schema and ID tuple_id . | |
template<typename T , std::size_t L> requires integral<typename T::type> | |
m::wasm::and (T::num_simd_lanes==L) void setbit(Ptr< T > bytes | |
Sets the n -th bit of the value pointed to by bytes to value . | |
_I32x1 | m::wasm::strncmp (NChar left, NChar right, U32x1 len, bool reverse=false) |
Compares two strings left and right . | |
_I32x1 | m::wasm::strcmp (NChar left, NChar right, bool reverse=false) |
Compares two strings left and right . | |
_Boolx1 | m::wasm::strncmp (NChar left, NChar right, U32x1 len, cmp_op op, bool reverse=false) |
Compares two strings left and right . | |
_Boolx1 | m::wasm::strcmp (NChar left, NChar right, cmp_op op, bool reverse=false) |
Compares two strings left and right . | |
Ptr< Charx1 > | m::wasm::strncpy (Ptr< Charx1 > dst, Ptr< Charx1 > src, U32x1 count) |
Copies the contents of src to dst , but no more than count characters. | |
_Boolx1 | m::wasm::like (NChar str, NChar pattern, const char escape_char='\\') |
Checks whether the string str matches the pattern pattern regarding SQL LIKE semantics using escape character escape_char . | |
_Boolx1 | m::wasm::like_contains (NChar str, const ThreadSafePooledString &pattern) |
Checks whether the string str contains the pattern pattern . | |
_Boolx1 | m::wasm::like_prefix (NChar str, const ThreadSafePooledString &pattern) |
Checks whether the string str has the prefix pattern . | |
_Boolx1 | m::wasm::like_suffix (NChar str, const ThreadSafePooledString &pattern) |
Checks whether the string str has the suffix pattern . | |
template<typename T > requires arithmetic<typename T::type> | |
T | m::wasm::signum (T value) |
Returns the signum of value , i.e. | |
template<bool Predicated> | |
I32x1 | m::wasm::compare (const Environment &env_left, const Environment &env_right, const std::vector< SortingOperator::order_type > &order) |
Compares two tuples, which must be already loaded into the environments env_left and env_right , according to the ordering order (the second element of each pair is true iff the corresponding sorting should be ascending). | |
template std::tuple< Block, Block, Block > | m::wasm::compile_store_sequential (const Schema &, const Schema &, Ptr< void >, const storage::DataLayout &, std::size_t, const Schema &, Var< U32x1 > &) |
template std::tuple< Block, Block, Block > | m::wasm::compile_store_sequential (const Schema &, const Schema &, Ptr< void >, const storage::DataLayout &, std::size_t, const Schema &, Global< U32x1 > &) |
template std::tuple< Block, Block, Block > | m::wasm::compile_store_sequential (const Schema &, const Schema &, Ptr< void >, const storage::DataLayout &, std::size_t, const Schema &, Variable< uint32_t, VariableKind::Param, false > &) |
template std::tuple< Block, Block, Block > | m::wasm::compile_store_sequential_single_pass (const Schema &, const Schema &, Ptr< void >, const storage::DataLayout &, std::size_t, const Schema &, Var< U32x1 > &) |
template std::tuple< Block, Block, Block > | m::wasm::compile_store_sequential_single_pass (const Schema &, const Schema &, Ptr< void >, const storage::DataLayout &, std::size_t, const Schema &, Global< U32x1 > &) |
template std::tuple< Block, Block, Block > | m::wasm::compile_store_sequential_single_pass (const Schema &, const Schema &, Ptr< void >, const storage::DataLayout &, std::size_t, const Schema &, Variable< uint32_t, VariableKind::Param, false > &) |
template std::tuple< Block, Block, Block > | m::wasm::compile_load_sequential (const Schema &, const Schema &, Ptr< void >, const storage::DataLayout &, std::size_t, const Schema &, Var< U32x1 > &) |
template std::tuple< Block, Block, Block > | m::wasm::compile_load_sequential (const Schema &, const Schema &, Ptr< void >, const storage::DataLayout &, std::size_t, const Schema &, Global< U32x1 > &) |
template std::tuple< Block, Block, Block > | m::wasm::compile_load_sequential (const Schema &, const Schema &, Ptr< void >, const storage::DataLayout &, std::size_t, const Schema &, Variable< uint32_t, VariableKind::Param, false > &) |
template I32x1 | m::wasm::compare< false > (const Environment &, const Environment &, const std::vector< SortingOperator::order_type > &) |
template I32x1 | m::wasm::compare< true > (const Environment &, const Environment &, const std::vector< SortingOperator::order_type > &) |
Variables | |
Bool< L > | m::wasm::value |
Bool< L > uint8_t | m::wasm::n |
Bool< L > T | m::wasm::mask |
#define ADD_EXPR_SQL_ADDR_TYPE | ( | TYPE | ) | template<> struct is_sql_addr_type<TYPE>{}; |
#define ADD_EXPR_SQL_TYPE | ( | TYPE | ) | template<> struct is_sql_type<TYPE>{}; |
Definition at line 378 of file WasmUtil.hpp.
#define ADD_TYPE | ( | TYPE | ) | , TYPE |
#define ADD_TYPE | ( | TYPE | ) | , TYPE |
#define SQL_ADDR_TYPES | ( | X | ) |
Definition at line 350 of file WasmUtil.hpp.
#define SQL_ADDR_TYPES_SCALAR | ( | X | ) |
Definition at line 312 of file WasmUtil.hpp.
#define SQL_TYPES | ( | X | ) |
Definition at line 322 of file WasmUtil.hpp.
#define SQL_TYPES_SCALAR | ( | X | ) |
Definition at line 302 of file WasmUtil.hpp.