MCPcopy Create free account
hub / github.com/apache/arrow / AddMappings

Method AddMappings

cpp/src/gandiva/decimal_xlarge.cc:41–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39namespace gandiva {
40
41arrow::Status ExportedDecimalFunctions::AddMappings(Engine* engine) const {
42 std::vector<llvm::Type*> args;
43 auto types = engine->types();
44
45 // gdv_multiply_and_scale_down
46 args = {types->i64_type(), // int64_t x_high
47 types->i64_type(), // uint64_t x_low
48 types->i64_type(), // int64_t y_high
49 types->i64_type(), // uint64_t x_low
50 types->i32_type(), // int32_t reduce_scale_by
51 types->i64_ptr_type(), // int64_t* out_high
52 types->i64_ptr_type(), // uint64_t* out_low
53 types->i8_ptr_type()}; // bool* overflow
54
55 engine->AddGlobalMappingForFunc(
56 "gdv_xlarge_multiply_and_scale_down", types->void_type() /*return_type*/, args,
57 reinterpret_cast<void*>(gdv_xlarge_multiply_and_scale_down));
58
59 // gdv_xlarge_scale_up_and_divide
60 args = {types->i64_type(), // int64_t x_high
61 types->i64_type(), // uint64_t x_low
62 types->i64_type(), // int64_t y_high
63 types->i64_type(), // uint64_t y_low
64 types->i32_type(), // int32_t increase_scale_by
65 types->i64_ptr_type(), // int64_t* out_high
66 types->i64_ptr_type(), // uint64_t* out_low
67 types->i8_ptr_type()}; // bool* overflow
68
69 engine->AddGlobalMappingForFunc(
70 "gdv_xlarge_scale_up_and_divide", types->void_type() /*return_type*/, args,
71 reinterpret_cast<void*>(gdv_xlarge_scale_up_and_divide));
72
73 // gdv_xlarge_mod
74 args = {types->i64_type(), // int64_t x_high
75 types->i64_type(), // uint64_t x_low
76 types->i32_type(), // int32_t x_scale
77 types->i64_type(), // int64_t y_high
78 types->i64_type(), // uint64_t y_low
79 types->i32_type(), // int32_t y_scale
80 types->i64_ptr_type(), // int64_t* out_high
81 types->i64_ptr_type()}; // uint64_t* out_low
82
83 engine->AddGlobalMappingForFunc("gdv_xlarge_mod", types->void_type() /*return_type*/,
84 args, reinterpret_cast<void*>(gdv_xlarge_mod));
85
86 // gdv_xlarge_compare
87 args = {types->i64_type(), // int64_t x_high
88 types->i64_type(), // uint64_t x_low
89 types->i32_type(), // int32_t x_scale
90 types->i64_type(), // int64_t y_high
91 types->i64_type(), // uint64_t y_low
92 types->i32_type()}; // int32_t y_scale
93
94 engine->AddGlobalMappingForFunc("gdv_xlarge_compare", types->i32_type() /*return_type*/,
95 args, reinterpret_cast<void*>(gdv_xlarge_compare));
96 return arrow::Status::OK();
97}
98

Callers

nothing calls this directly

Calls 3

typesMethod · 0.80
OKFunction · 0.50

Tested by

no test coverage detected