OmniSciDB  fe05a0c208
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 86 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().

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

+ Here is the caller graph for this function:

bool is_pointer_type ( const Type  type)

Definition at line 100 of file ResultSetReductionInterpreterStubs.cpp.

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

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

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

+ 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 134 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT, and i.

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

Definition at line 127 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT, and i.

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

Definition at line 120 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT, and i.

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

Definition at line 153 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

154  {
155  return static_cast<const int32_t*>(read_stub_arg_pvoid(inputs_handle, i));
156 }
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 158 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

159  {
160  return static_cast<const int32_t*>(read_stub_arg_pvoid(inputs_handle, i));
161 }
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 148 of file ResultSetReductionInterpreterStubs.cpp.

References read_stub_arg_pvoid().

149  {
150  return static_cast<const int8_t*>(read_stub_arg_pvoid(inputs_handle, i));
151 }
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 163 of file ResultSetReductionInterpreterStubs.cpp.

References const, and read_stub_arg_pvoid().

165  {
166  return static_cast<const int64_t* const*>(read_stub_arg_pvoid(inputs_handle, i));
167 }
#define const
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 141 of file ResultSetReductionInterpreterStubs.cpp.

References CHECK_LT, and i.

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

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

+ 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 171 of file ResultSetReductionInterpreterStubs.cpp.

References ReductionInterpreter::EvalValue::int_val.

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