OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ResultSetReductionInterpreterStubs.cpp File Reference
+ Include dependency graph for ResultSetReductionInterpreterStubs.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{ResultSetReductionInterpreterStubs.cpp}
 

Functions

llvm::Function * anonymous_namespace{ResultSetReductionInterpreterStubs.cpp}::create_stub_function (const std::string &name, CgenState *cgen_state)
 
std::string anonymous_namespace{ResultSetReductionInterpreterStubs.cpp}::get_stub_read_argument_name (const Type arg_type)
 
bool is_integer_type (const Type type)
 
bool is_pointer_type (const Type type)
 
RUNTIME_EXPORT int64_t read_stub_arg_int (const void *inputs_handle, const int32_t i)
 
RUNTIME_EXPORT float read_stub_arg_float (const void *inputs_handle, const int32_t i)
 
RUNTIME_EXPORT double read_stub_arg_double (const void *inputs_handle, const int32_t i)
 
RUNTIME_EXPORT const void * read_stub_arg_pvoid (const void *inputs_handle, const int32_t i)
 
RUNTIME_EXPORT const int8_t * read_stub_arg_pi8 (const void *inputs_handle, const int32_t i)
 
RUNTIME_EXPORT const int32_t * read_stub_arg_pi32 (const void *inputs_handle, const int32_t i)
 
RUNTIME_EXPORT const int32_t * read_stub_arg_pi64 (const void *inputs_handle, const int32_t i)
 
RUNTIME_EXPORT const int64_t
*const * 
read_stub_arg_ppi64 (const void *inputs_handle, const int32_t i)
 
RUNTIME_EXPORT void write_stub_result_int (void *output_handle, const int64_t int_val)
 

Function Documentation

bool is_integer_type ( const Type  type)

Definition at line 87 of file ResultSetReductionInterpreterStubs.cpp.

References Int1, Int32, Int64, and Int8.

Referenced by StubGenerator::generateStub(), ReductionInterpreterImpl::runAlloca(), ReductionInterpreterImpl::runBinaryOperator(), ReductionInterpreterImpl::runCast(), ReductionInterpreterImpl::runFor(), ReductionInterpreterImpl::runICmp(), and ReductionInterpreterImpl::runMemCpy().

87  {
88  switch (type) {
89  case Type::Int1:
90  case Type::Int8:
91  case Type::Int32:
92  case Type::Int64: {
93  return true;
94  }
95  default: {
96  return false;
97  }
98  }
99 }

+ Here is the caller graph for this function:

bool is_pointer_type ( const Type  type)

Definition at line 101 of file ResultSetReductionInterpreterStubs.cpp.

References DoublePtr, FloatPtr, Int32Ptr, Int64Ptr, Int64PtrPtr, Int8Ptr, and VoidPtr.

Referenced by StubGenerator::generateStub(), ReductionInterpreterImpl::runCast(), ReductionInterpreterImpl::runLoad(), and ReductionInterpreterImpl::runMemCpy().

101  {
102  switch (type) {
103  case Type::Int8Ptr:
104  case Type::Int32Ptr:
105  case Type::Int64Ptr:
106  case Type::FloatPtr:
107  case Type::DoublePtr:
108  case Type::VoidPtr:
109  case Type::Int64PtrPtr: {
110  return true;
111  }
112  default: {
113  return false;
114  }
115  }
116 }

+ Here is the caller graph for this function:

RUNTIME_EXPORT double read_stub_arg_double ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 135 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT.

136  {
137  const auto& inputs = *reinterpret_cast<const StubGenerator::InputsType*>(inputs_handle);
138  CHECK_LT(static_cast<size_t>(i), inputs.size());
139  return inputs[i].double_val;
140 }
std::vector< ReductionInterpreter::EvalValue > InputsType
#define CHECK_LT(x, y)
Definition: Logger.h:303
RUNTIME_EXPORT float read_stub_arg_float ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 128 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT.

129  {
130  const auto& inputs = *reinterpret_cast<const StubGenerator::InputsType*>(inputs_handle);
131  CHECK_LT(static_cast<size_t>(i), inputs.size());
132  return inputs[i].float_val;
133 }
std::vector< ReductionInterpreter::EvalValue > InputsType
#define CHECK_LT(x, y)
Definition: Logger.h:303
RUNTIME_EXPORT int64_t read_stub_arg_int ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 121 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT.

122  {
123  const auto& inputs = *reinterpret_cast<const StubGenerator::InputsType*>(inputs_handle);
124  CHECK_LT(static_cast<size_t>(i), inputs.size());
125  return inputs[i].int_val;
126 }
std::vector< ReductionInterpreter::EvalValue > InputsType
#define CHECK_LT(x, y)
Definition: Logger.h:303
RUNTIME_EXPORT const int32_t* read_stub_arg_pi32 ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 154 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

155  {
156  return static_cast<const int32_t*>(read_stub_arg_pvoid(inputs_handle, i));
157 }
RUNTIME_EXPORT const void * read_stub_arg_pvoid(const void *inputs_handle, const int32_t i)

+ Here is the call graph for this function:

RUNTIME_EXPORT const int32_t* read_stub_arg_pi64 ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 159 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

160  {
161  return static_cast<const int32_t*>(read_stub_arg_pvoid(inputs_handle, i));
162 }
RUNTIME_EXPORT const void * read_stub_arg_pvoid(const void *inputs_handle, const int32_t i)

+ Here is the call graph for this function:

RUNTIME_EXPORT const int8_t* read_stub_arg_pi8 ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 149 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

150  {
151  return static_cast<const int8_t*>(read_stub_arg_pvoid(inputs_handle, i));
152 }
RUNTIME_EXPORT const void * read_stub_arg_pvoid(const void *inputs_handle, const int32_t i)

+ Here is the call graph for this function:

RUNTIME_EXPORT const int64_t* const* read_stub_arg_ppi64 ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 164 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

166  {
167  return static_cast<const int64_t* const*>(read_stub_arg_pvoid(inputs_handle, i));
168 }
RUNTIME_EXPORT const void * read_stub_arg_pvoid(const void *inputs_handle, const int32_t i)

+ Here is the call graph for this function:

RUNTIME_EXPORT const void* read_stub_arg_pvoid ( const void *  inputs_handle,
const int32_t  i 
)

Definition at line 142 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT.

Referenced by read_stub_arg_pi32(), read_stub_arg_pi64(), read_stub_arg_pi8(), and read_stub_arg_ppi64().

143  {
144  const auto& inputs = *reinterpret_cast<const StubGenerator::InputsType*>(inputs_handle);
145  CHECK_LT(static_cast<size_t>(i), inputs.size());
146  return inputs[i].ptr;
147 }
std::vector< ReductionInterpreter::EvalValue > InputsType
#define CHECK_LT(x, y)
Definition: Logger.h:303

+ Here is the caller graph for this function:

RUNTIME_EXPORT void write_stub_result_int ( void *  output_handle,
const int64_t  int_val 
)

Definition at line 172 of file ResultSetReductionInterpreterStubs.cpp.

References ReductionInterpreter::EvalValue::int_val.

173  {
174  auto output = reinterpret_cast<ReductionInterpreter::EvalValue*>(output_handle);
175  output->int_val = int_val;
176 }