diff --git a/src/aggfuncs.c b/src/aggfuncs.c index f7e6cd0c4..bd8c81fa8 100644 --- a/src/aggfuncs.c +++ b/src/aggfuncs.c @@ -94,7 +94,7 @@ check_float8_value(float8 value, bool inf_is_valid, bool zero_is_valid) /* * NROWS */ -Datum +PUBLIC_FUNCTION(Datum) pgstrom_partial_nrows(PG_FUNCTION_ARGS) { int i; @@ -110,7 +110,7 @@ pgstrom_partial_nrows(PG_FUNCTION_ARGS) /* * MIN(X) and MAX(X) functions */ -Datum +PUBLIC_FUNCTION(Datum) pgstrom_partial_minmax_int64(PG_FUNCTION_ARGS) { kagg_state__pminmax_int64_packed *r; @@ -123,7 +123,7 @@ pgstrom_partial_minmax_int64(PG_FUNCTION_ARGS) PG_RETURN_POINTER(r); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_partial_minmax_fp64(PG_FUNCTION_ARGS) { kagg_state__pminmax_fp64_packed *r; @@ -171,31 +171,31 @@ pgstrom_partial_minmax_fp64(PG_FUNCTION_ARGS) } \ PG_RETURN_POINTER(state); -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fmin_trans_int64(PG_FUNCTION_ARGS) { __MINMAX_TRANS_TEMPLATE(int64,Min); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fmin_trans_fp64(PG_FUNCTION_ARGS) { __MINMAX_TRANS_TEMPLATE(fp64,Min); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fmax_trans_int64(PG_FUNCTION_ARGS) { __MINMAX_TRANS_TEMPLATE(int64,Max); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fmax_trans_fp64(PG_FUNCTION_ARGS) { __MINMAX_TRANS_TEMPLATE(fp64,Max); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fminmax_final_int8(PG_FUNCTION_ARGS) { kagg_state__pminmax_int64_packed *state @@ -207,7 +207,7 @@ pgstrom_fminmax_final_int8(PG_FUNCTION_ARGS) PG_RETURN_INT32(state->value); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fminmax_final_int16(PG_FUNCTION_ARGS) { kagg_state__pminmax_int64_packed *state @@ -219,7 +219,7 @@ pgstrom_fminmax_final_int16(PG_FUNCTION_ARGS) PG_RETURN_INT32(state->value); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fminmax_final_int32(PG_FUNCTION_ARGS) { kagg_state__pminmax_int64_packed *state @@ -231,7 +231,7 @@ pgstrom_fminmax_final_int32(PG_FUNCTION_ARGS) PG_RETURN_INT32(state->value); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fminmax_final_int64(PG_FUNCTION_ARGS) { kagg_state__pminmax_int64_packed *state @@ -241,7 +241,7 @@ pgstrom_fminmax_final_int64(PG_FUNCTION_ARGS) PG_RETURN_INT64(state->value); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fminmax_final_fp16(PG_FUNCTION_ARGS) { kagg_state__pminmax_fp64_packed *state @@ -251,7 +251,7 @@ pgstrom_fminmax_final_fp16(PG_FUNCTION_ARGS) PG_RETURN_UINT16(__half_as_short__(fp64_to_fp16(state->value))); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fminmax_final_fp32(PG_FUNCTION_ARGS) { kagg_state__pminmax_fp64_packed *state @@ -261,7 +261,7 @@ pgstrom_fminmax_final_fp32(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(state->value); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fminmax_final_fp64(PG_FUNCTION_ARGS) { kagg_state__pminmax_fp64_packed *state @@ -271,7 +271,7 @@ pgstrom_fminmax_final_fp64(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(state->value); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fminmax_final_numeric(PG_FUNCTION_ARGS) { kagg_state__pminmax_fp64_packed *state @@ -285,7 +285,7 @@ pgstrom_fminmax_final_numeric(PG_FUNCTION_ARGS) /* * SUM(X),AVG(X) functions */ -Datum +PUBLIC_FUNCTION(Datum) pgstrom_partial_sum_int(PG_FUNCTION_ARGS) { kagg_state__psum_int_packed *r = palloc(sizeof(kagg_state__psum_int_packed)); @@ -297,7 +297,7 @@ pgstrom_partial_sum_int(PG_FUNCTION_ARGS) PG_RETURN_POINTER(r); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_partial_sum_fp(PG_FUNCTION_ARGS) { kagg_state__psum_fp_packed *r = palloc(sizeof(kagg_state__psum_fp_packed)); @@ -309,7 +309,7 @@ pgstrom_partial_sum_fp(PG_FUNCTION_ARGS) PG_RETURN_POINTER(r); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_partial_sum_cash(PG_FUNCTION_ARGS) { kagg_state__psum_int_packed *r = palloc(sizeof(kagg_state__psum_int_packed)); @@ -321,7 +321,7 @@ pgstrom_partial_sum_cash(PG_FUNCTION_ARGS) PG_RETURN_POINTER(r); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fsum_trans_int(PG_FUNCTION_ARGS) { kagg_state__psum_int_packed *state; @@ -351,7 +351,7 @@ pgstrom_fsum_trans_int(PG_FUNCTION_ARGS) PG_RETURN_POINTER(state); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fsum_trans_fp(PG_FUNCTION_ARGS) { kagg_state__psum_fp_packed *state; @@ -381,7 +381,7 @@ pgstrom_fsum_trans_fp(PG_FUNCTION_ARGS) PG_RETURN_POINTER(state); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fsum_final_int(PG_FUNCTION_ARGS) { kagg_state__psum_int_packed *state; @@ -392,7 +392,7 @@ pgstrom_fsum_final_int(PG_FUNCTION_ARGS) PG_RETURN_INT64(state->sum); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fsum_final_int_as_numeric(PG_FUNCTION_ARGS) { kagg_state__psum_int_packed *state; @@ -404,7 +404,7 @@ pgstrom_fsum_final_int_as_numeric(PG_FUNCTION_ARGS) Int64GetDatum(state->sum))); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fsum_final_int_as_cash(PG_FUNCTION_ARGS) { kagg_state__psum_int_packed *state; @@ -415,7 +415,7 @@ pgstrom_fsum_final_int_as_cash(PG_FUNCTION_ARGS) PG_RETURN_CASH(state->sum); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fsum_final_fp32(PG_FUNCTION_ARGS) { kagg_state__psum_fp_packed *state @@ -425,7 +425,7 @@ pgstrom_fsum_final_fp32(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(state->sum); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fsum_final_fp64(PG_FUNCTION_ARGS) { kagg_state__psum_fp_packed *state @@ -435,7 +435,7 @@ pgstrom_fsum_final_fp64(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(state->sum); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_fsum_final_fp64_as_numeric(PG_FUNCTION_ARGS) { kagg_state__psum_fp_packed *state @@ -446,7 +446,7 @@ pgstrom_fsum_final_fp64_as_numeric(PG_FUNCTION_ARGS) Float8GetDatum(state->sum))); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_favg_final_int(PG_FUNCTION_ARGS) { kagg_state__psum_int_packed *state; @@ -461,7 +461,7 @@ pgstrom_favg_final_int(PG_FUNCTION_ARGS) PG_RETURN_DATUM(DirectFunctionCall2(numeric_div, sum, n)); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_favg_final_fp(PG_FUNCTION_ARGS) { kagg_state__psum_fp_packed *state; @@ -472,7 +472,7 @@ pgstrom_favg_final_fp(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8((double)state->sum / (double)state->nitems); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_favg_final_num(PG_FUNCTION_ARGS) { kagg_state__psum_fp_packed *state; @@ -490,7 +490,7 @@ pgstrom_favg_final_num(PG_FUNCTION_ARGS) /* * STDDEV/VARIANCE */ -Datum +PUBLIC_FUNCTION(Datum) pgstrom_partial_variance(PG_FUNCTION_ARGS) { kagg_state__stddev_packed *r = palloc(sizeof(kagg_state__stddev_packed)); @@ -503,7 +503,7 @@ pgstrom_partial_variance(PG_FUNCTION_ARGS) PG_RETURN_POINTER(r); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_stddev_trans(PG_FUNCTION_ARGS) { kagg_state__stddev_packed *state; @@ -535,7 +535,7 @@ pgstrom_stddev_trans(PG_FUNCTION_ARGS) PG_RETURN_POINTER(state); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_var_sampf_final(PG_FUNCTION_ARGS) { kagg_state__stddev_packed *state @@ -550,7 +550,7 @@ pgstrom_var_sampf_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_var_samp_final(PG_FUNCTION_ARGS) { Datum datum = pgstrom_var_sampf_final(fcinfo); @@ -560,7 +560,7 @@ pgstrom_var_samp_final(PG_FUNCTION_ARGS) PG_RETURN_DATUM(DirectFunctionCall1(float8_numeric, datum)); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_var_popf_final(PG_FUNCTION_ARGS) { kagg_state__stddev_packed *state @@ -575,7 +575,7 @@ pgstrom_var_popf_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_var_pop_final(PG_FUNCTION_ARGS) { Datum datum = pgstrom_var_popf_final(fcinfo); @@ -585,7 +585,7 @@ pgstrom_var_pop_final(PG_FUNCTION_ARGS) PG_RETURN_DATUM(DirectFunctionCall1(float8_numeric, datum)); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_stddev_sampf_final(PG_FUNCTION_ARGS) { Datum datum = pgstrom_var_sampf_final(fcinfo); @@ -595,7 +595,7 @@ pgstrom_stddev_sampf_final(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(sqrt(DatumGetFloat8(datum))); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_stddev_samp_final(PG_FUNCTION_ARGS) { Datum datum = pgstrom_stddev_sampf_final(fcinfo); @@ -605,7 +605,7 @@ pgstrom_stddev_samp_final(PG_FUNCTION_ARGS) PG_RETURN_DATUM(DirectFunctionCall1(float8_numeric, datum)); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_stddev_popf_final(PG_FUNCTION_ARGS) { Datum datum = pgstrom_var_popf_final(fcinfo); @@ -615,7 +615,7 @@ pgstrom_stddev_popf_final(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(sqrt(DatumGetFloat8(datum))); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_stddev_pop_final(PG_FUNCTION_ARGS) { Datum datum = pgstrom_stddev_popf_final(fcinfo); @@ -628,7 +628,7 @@ pgstrom_stddev_pop_final(PG_FUNCTION_ARGS) /* * COVAR/REGR_* */ -Datum +PUBLIC_FUNCTION(Datum) pgstrom_partial_covar(PG_FUNCTION_ARGS) { kagg_state__covar_packed *r = palloc(sizeof(kagg_state__covar_packed)); @@ -646,7 +646,7 @@ pgstrom_partial_covar(PG_FUNCTION_ARGS) PG_RETURN_POINTER(r); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_covar_accum(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state; @@ -681,7 +681,7 @@ pgstrom_covar_accum(PG_FUNCTION_ARGS) PG_RETURN_POINTER(state); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_covar_samp_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -697,7 +697,7 @@ pgstrom_covar_samp_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_covar_pop_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -713,7 +713,7 @@ pgstrom_covar_pop_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_regr_avgx_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -727,7 +727,7 @@ pgstrom_regr_avgx_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_regr_avgy_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -741,7 +741,7 @@ pgstrom_regr_avgy_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_regr_count_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -750,7 +750,7 @@ pgstrom_regr_count_final(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8((float8_t)state->nitems); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_regr_intercept_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -765,7 +765,7 @@ pgstrom_regr_intercept_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_regr_r2_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -780,7 +780,7 @@ pgstrom_regr_r2_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_regr_slope_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -792,7 +792,7 @@ pgstrom_regr_slope_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_regr_sxx_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -804,7 +804,7 @@ pgstrom_regr_sxx_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_regr_sxy_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -816,7 +816,7 @@ pgstrom_regr_sxy_final(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_regr_syy_final(PG_FUNCTION_ARGS) { kagg_state__covar_packed *state @@ -1084,13 +1084,13 @@ __pgstrom_hll_sketch_update_common(PG_FUNCTION_ARGS, uint64 hash) #define PGSTROM_HLL_HANDLER_TEMPLATE(NAME) \ PG_FUNCTION_INFO_V1(pgstrom_hll_hash_##NAME); \ PG_FUNCTION_INFO_V1(pgstrom_hll_sketch_update_##NAME); \ - Datum \ + PUBLIC_FUNCTION(Datum) \ pgstrom_hll_hash_##NAME(PG_FUNCTION_ARGS) \ { \ Datum arg = PG_GETARG_DATUM(0); \ PG_RETURN_UINT64(__pgstrom_hll_hash_##NAME(arg)); \ } \ - Datum \ + PUBLIC_FUNCTION(Datum) \ pgstrom_hll_sketch_update_##NAME(PG_FUNCTION_ARGS) \ { \ if (PG_ARGISNULL(1)) \ @@ -1127,7 +1127,7 @@ PGSTROM_HLL_HANDLER_TEMPLATE(uuid) /* * pgstrom_hll_sketch_new */ -Datum +PUBLIC_FUNCTION(Datum) pgstrom_hll_sketch_new(PG_FUNCTION_ARGS) { uint64 nrooms = (1UL << pgstrom_hll_register_bits); @@ -1153,7 +1153,7 @@ pgstrom_hll_sketch_new(PG_FUNCTION_ARGS) /* * pgstrom_hll_sketch_merge */ -Datum +PUBLIC_FUNCTION(Datum) pgstrom_hll_sketch_merge(PG_FUNCTION_ARGS) { MemoryContext aggcxt; @@ -1204,7 +1204,7 @@ pgstrom_hll_sketch_merge(PG_FUNCTION_ARGS) /* * pgstrom_hll_count_final */ -Datum +PUBLIC_FUNCTION(Datum) pgstrom_hll_count_final(PG_FUNCTION_ARGS) { bytea *hll_state; @@ -1255,7 +1255,7 @@ pgstrom_hll_count_final(PG_FUNCTION_ARGS) /* * pgstrom_hll_sketch_histogram */ -Datum +PUBLIC_FUNCTION(Datum) pgstrom_hll_sketch_histogram(PG_FUNCTION_ARGS) { bytea *hll_state = PG_GETARG_BYTEA_P(0); diff --git a/src/arrow_fdw.c b/src/arrow_fdw.c index 5d46bbc6c..cc3302a6b 100644 --- a/src/arrow_fdw.c +++ b/src/arrow_fdw.c @@ -189,11 +189,6 @@ static bool arrow_fdw_enabled; /* GUC */ static bool arrow_fdw_stats_hint_enabled; /* GUC */ static int arrow_metadata_cache_size_kb; /* GUC */ -PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_handler); -PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_validator); -PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_import_file); -PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_precheck_schema); - /* ---------------------------------------------------------------- * * Apache Arrow <--> PG Types Mapping Routines @@ -4227,6 +4222,7 @@ ArrowImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid) * However, it is not a reasonable restriction for foreign-table, because * it does not use heap-format internally. */ +PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_import_file); static void __insertPgAttributeTuple(Relation pg_attr_rel, CatalogIndexState pg_attr_index, @@ -4291,7 +4287,7 @@ __insertPgAttributeTuple(Relation pg_attr_rel, heap_freetuple(tup); } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_arrow_fdw_import_file(PG_FUNCTION_ARGS) { CreateForeignTableStmt stmt; @@ -4399,7 +4395,8 @@ pgstrom_arrow_fdw_import_file(PG_FUNCTION_ARGS) /* * handler of Arrow_Fdw */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_handler); +PUBLIC_FUNCTION(Datum) pgstrom_arrow_fdw_handler(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(&pgstrom_arrow_fdw_routine); @@ -4408,7 +4405,8 @@ pgstrom_arrow_fdw_handler(PG_FUNCTION_ARGS) /* * validator of Arrow_Fdw */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_validator); +PUBLIC_FUNCTION(Datum) pgstrom_arrow_fdw_validator(PG_FUNCTION_ARGS) { List *options = untransformRelOptions(PG_GETARG_DATUM(0)); @@ -4457,7 +4455,8 @@ pgstrom_arrow_fdw_validator(PG_FUNCTION_ARGS) /* * pgstrom_arrow_fdw_precheck_schema */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_arrow_fdw_precheck_schema); +PUBLIC_FUNCTION(Datum) pgstrom_arrow_fdw_precheck_schema(PG_FUNCTION_ARGS) { EventTriggerData *trigdata; diff --git a/src/extra.c b/src/extra.c index aceb6fe8d..3f372106a 100644 --- a/src/extra.c +++ b/src/extra.c @@ -19,7 +19,6 @@ static int gpudirect_driver_kind; static __thread void *gpudirect_vfs_dma_buffer = NULL; static __thread size_t gpudirect_vfs_dma_buffer_sz = 0UL; -PG_FUNCTION_INFO_V1(pgstrom_license_query); /* * heterodbExtraModuleInfo @@ -150,6 +149,7 @@ heterodbValidateDevice(int gpu_device_id, /* * pgstrom_license_query */ +PG_FUNCTION_INFO_V1(pgstrom_license_query); static char * __heterodb_license_query(void) { @@ -172,7 +172,7 @@ __heterodb_license_query(void) goto retry; } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_license_query(PG_FUNCTION_ARGS) { char *license; @@ -864,6 +864,10 @@ pgstrom_init_extra(void) enum_options[enum_index].val = GPUDIRECT_DRIVER__VFS; enum_index++; + /* MEMO: Since PGv16, GUC variable must be initialized with the boot + * value to pass assertion checks. + */ + gpudirect_driver_kind = enum_options[0].val; DefineCustomEnumVariable("pg_strom.gpudirect_driver", "Choice of GPU-Direct SQL Driver", NULL, diff --git a/src/float2.c b/src/float2.c index cc363b755..f42c4b48e 100644 --- a/src/float2.c +++ b/src/float2.c @@ -28,107 +28,6 @@ #define PG_RETURN_FP64_AS_FP16(x) PG_RETURN_FP16(fp64_to_fp16(x)) #endif -/* type i/o handler */ -PG_FUNCTION_INFO_V1(pgstrom_float2in); -PG_FUNCTION_INFO_V1(pgstrom_float2out); -PG_FUNCTION_INFO_V1(pgstrom_float2recv); -PG_FUNCTION_INFO_V1(pgstrom_float2send); -/* type cast */ -PG_FUNCTION_INFO_V1(pgstrom_float2_to_float4); -PG_FUNCTION_INFO_V1(pgstrom_float2_to_float8); -PG_FUNCTION_INFO_V1(pgstrom_float2_to_int1); -PG_FUNCTION_INFO_V1(pgstrom_float2_to_int2); -PG_FUNCTION_INFO_V1(pgstrom_float2_to_int4); -PG_FUNCTION_INFO_V1(pgstrom_float2_to_int8); -PG_FUNCTION_INFO_V1(pgstrom_float2_to_numeric); -PG_FUNCTION_INFO_V1(pgstrom_float4_to_float2); -PG_FUNCTION_INFO_V1(pgstrom_float8_to_float2); -PG_FUNCTION_INFO_V1(pgstrom_int1_to_float2); -PG_FUNCTION_INFO_V1(pgstrom_int2_to_float2); -PG_FUNCTION_INFO_V1(pgstrom_int4_to_float2); -PG_FUNCTION_INFO_V1(pgstrom_int8_to_float2); -PG_FUNCTION_INFO_V1(pgstrom_numeric_to_float2); -/* type comparison */ -PG_FUNCTION_INFO_V1(pgstrom_float2eq); -PG_FUNCTION_INFO_V1(pgstrom_float2ne); -PG_FUNCTION_INFO_V1(pgstrom_float2lt); -PG_FUNCTION_INFO_V1(pgstrom_float2le); -PG_FUNCTION_INFO_V1(pgstrom_float2gt); -PG_FUNCTION_INFO_V1(pgstrom_float2ge); -PG_FUNCTION_INFO_V1(pgstrom_float2cmp); -PG_FUNCTION_INFO_V1(pgstrom_float2larger); -PG_FUNCTION_INFO_V1(pgstrom_float2smaller); -PG_FUNCTION_INFO_V1(pgstrom_float2hash); - -PG_FUNCTION_INFO_V1(pgstrom_float42eq); -PG_FUNCTION_INFO_V1(pgstrom_float42ne); -PG_FUNCTION_INFO_V1(pgstrom_float42lt); -PG_FUNCTION_INFO_V1(pgstrom_float42le); -PG_FUNCTION_INFO_V1(pgstrom_float42gt); -PG_FUNCTION_INFO_V1(pgstrom_float42ge); -PG_FUNCTION_INFO_V1(pgstrom_float42cmp); - -PG_FUNCTION_INFO_V1(pgstrom_float82eq); -PG_FUNCTION_INFO_V1(pgstrom_float82ne); -PG_FUNCTION_INFO_V1(pgstrom_float82lt); -PG_FUNCTION_INFO_V1(pgstrom_float82le); -PG_FUNCTION_INFO_V1(pgstrom_float82gt); -PG_FUNCTION_INFO_V1(pgstrom_float82ge); -PG_FUNCTION_INFO_V1(pgstrom_float82cmp); - -PG_FUNCTION_INFO_V1(pgstrom_float24eq); -PG_FUNCTION_INFO_V1(pgstrom_float24ne); -PG_FUNCTION_INFO_V1(pgstrom_float24lt); -PG_FUNCTION_INFO_V1(pgstrom_float24le); -PG_FUNCTION_INFO_V1(pgstrom_float24gt); -PG_FUNCTION_INFO_V1(pgstrom_float24ge); -PG_FUNCTION_INFO_V1(pgstrom_float24cmp); - -PG_FUNCTION_INFO_V1(pgstrom_float28eq); -PG_FUNCTION_INFO_V1(pgstrom_float28ne); -PG_FUNCTION_INFO_V1(pgstrom_float28lt); -PG_FUNCTION_INFO_V1(pgstrom_float28le); -PG_FUNCTION_INFO_V1(pgstrom_float28gt); -PG_FUNCTION_INFO_V1(pgstrom_float28ge); -PG_FUNCTION_INFO_V1(pgstrom_float28cmp); - -/* unary operators */ -PG_FUNCTION_INFO_V1(pgstrom_float2up); -PG_FUNCTION_INFO_V1(pgstrom_float2um); -PG_FUNCTION_INFO_V1(pgstrom_float2abs); -/* arithmetric operators */ -PG_FUNCTION_INFO_V1(pgstrom_float2pl); -PG_FUNCTION_INFO_V1(pgstrom_float2mi); -PG_FUNCTION_INFO_V1(pgstrom_float2mul); -PG_FUNCTION_INFO_V1(pgstrom_float2div); - -PG_FUNCTION_INFO_V1(pgstrom_float24pl); -PG_FUNCTION_INFO_V1(pgstrom_float24mi); -PG_FUNCTION_INFO_V1(pgstrom_float24mul); -PG_FUNCTION_INFO_V1(pgstrom_float24div); - -PG_FUNCTION_INFO_V1(pgstrom_float28pl); -PG_FUNCTION_INFO_V1(pgstrom_float28mi); -PG_FUNCTION_INFO_V1(pgstrom_float28mul); -PG_FUNCTION_INFO_V1(pgstrom_float28div); - -PG_FUNCTION_INFO_V1(pgstrom_float42pl); -PG_FUNCTION_INFO_V1(pgstrom_float42mi); -PG_FUNCTION_INFO_V1(pgstrom_float42mul); -PG_FUNCTION_INFO_V1(pgstrom_float42div); - -PG_FUNCTION_INFO_V1(pgstrom_float82pl); -PG_FUNCTION_INFO_V1(pgstrom_float82mi); -PG_FUNCTION_INFO_V1(pgstrom_float82mul); -PG_FUNCTION_INFO_V1(pgstrom_float82div); - -/* misc functions */ -PG_FUNCTION_INFO_V1(pgstrom_cash_mul_flt2); -PG_FUNCTION_INFO_V1(pgstrom_flt2_mul_cash); -PG_FUNCTION_INFO_V1(pgstrom_cash_div_flt2); -PG_FUNCTION_INFO_V1(pgstrom_float2_accum); -PG_FUNCTION_INFO_V1(pgstrom_float2_sum); - static inline void print_fp16(const char *prefix, uint32 value) { @@ -181,7 +80,8 @@ print_fp64(const char *prefix, uint64 value) /* * pgstrom_float2in */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2in); +PUBLIC_FUNCTION(Datum) pgstrom_float2in(PG_FUNCTION_ARGS) { float fval = DatumGetFloat4(float4in(fcinfo)); @@ -192,7 +92,8 @@ pgstrom_float2in(PG_FUNCTION_ARGS) /* * pgstrom_float2out */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2out); +PUBLIC_FUNCTION(Datum) pgstrom_float2out(PG_FUNCTION_ARGS) { float fval = PG_GETARG_FP16_AS_FP32(0); @@ -203,7 +104,8 @@ pgstrom_float2out(PG_FUNCTION_ARGS) /* * pgstrom_float2recv */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2recv); +PUBLIC_FUNCTION(Datum) pgstrom_float2recv(PG_FUNCTION_ARGS) { return int2recv(fcinfo); @@ -212,7 +114,8 @@ pgstrom_float2recv(PG_FUNCTION_ARGS) /* * pgstrom_float2send */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2send); +PUBLIC_FUNCTION(Datum) pgstrom_float2send(PG_FUNCTION_ARGS) { return int2send(fcinfo); @@ -221,7 +124,8 @@ pgstrom_float2send(PG_FUNCTION_ARGS) /* * pgstrom_float2_to_float4 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2_to_float4); +PUBLIC_FUNCTION(Datum) pgstrom_float2_to_float4(PG_FUNCTION_ARGS) { float fval = PG_GETARG_FP16_AS_FP32(0); @@ -232,7 +136,8 @@ pgstrom_float2_to_float4(PG_FUNCTION_ARGS) /* * pgstrom_float2_to_float8 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2_to_float8); +PUBLIC_FUNCTION(Datum) pgstrom_float2_to_float8(PG_FUNCTION_ARGS) { double fval = PG_GETARG_FP16_AS_FP64(0); @@ -243,7 +148,8 @@ pgstrom_float2_to_float8(PG_FUNCTION_ARGS) /* * pgstrom_float2_to_int1 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2_to_int1); +PUBLIC_FUNCTION(Datum) pgstrom_float2_to_int1(PG_FUNCTION_ARGS) { float fval = PG_GETARG_FP16_AS_FP32(0); @@ -260,7 +166,8 @@ pgstrom_float2_to_int1(PG_FUNCTION_ARGS) /* * pgstrom_float2_to_int2 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2_to_int2); +PUBLIC_FUNCTION(Datum) pgstrom_float2_to_int2(PG_FUNCTION_ARGS) { float fval = PG_GETARG_FP16_AS_FP32(0); @@ -271,7 +178,8 @@ pgstrom_float2_to_int2(PG_FUNCTION_ARGS) /* * pgstrom_float2_to_int4 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2_to_int4); +PUBLIC_FUNCTION(Datum) pgstrom_float2_to_int4(PG_FUNCTION_ARGS) { float fval = PG_GETARG_FP16_AS_FP32(0); @@ -282,7 +190,8 @@ pgstrom_float2_to_int4(PG_FUNCTION_ARGS) /* * pgstrom_float2_to_int8 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2_to_int8); +PUBLIC_FUNCTION(Datum) pgstrom_float2_to_int8(PG_FUNCTION_ARGS) { float fval = PG_GETARG_FP16_AS_FP32(0); @@ -293,7 +202,8 @@ pgstrom_float2_to_int8(PG_FUNCTION_ARGS) /* * pgstrom_float2_to_numeric */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2_to_numeric); +PUBLIC_FUNCTION(Datum) pgstrom_float2_to_numeric(PG_FUNCTION_ARGS) { float fval = PG_GETARG_FP16_AS_FP32(0); @@ -304,7 +214,8 @@ pgstrom_float2_to_numeric(PG_FUNCTION_ARGS) /* * pgstrom_float4_to_float2 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float4_to_float2); +PUBLIC_FUNCTION(Datum) pgstrom_float4_to_float2(PG_FUNCTION_ARGS) { float fval = PG_GETARG_FLOAT4(0); @@ -315,7 +226,8 @@ pgstrom_float4_to_float2(PG_FUNCTION_ARGS) /* * pgstrom_float8_to_float2 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float8_to_float2); +PUBLIC_FUNCTION(Datum) pgstrom_float8_to_float2(PG_FUNCTION_ARGS) { double fval = PG_GETARG_FLOAT8(0); @@ -326,7 +238,8 @@ pgstrom_float8_to_float2(PG_FUNCTION_ARGS) /* * pgstrom_int1_to_float2 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_to_float2); +PUBLIC_FUNCTION(Datum) pgstrom_int1_to_float2(PG_FUNCTION_ARGS) { int32 ival = (int32)PG_GETARG_DATUM(0); @@ -337,7 +250,8 @@ pgstrom_int1_to_float2(PG_FUNCTION_ARGS) /* * pgstrom_int2_to_float2 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int2_to_float2); +PUBLIC_FUNCTION(Datum) pgstrom_int2_to_float2(PG_FUNCTION_ARGS) { float fval = (float) PG_GETARG_INT16(0); @@ -348,7 +262,8 @@ pgstrom_int2_to_float2(PG_FUNCTION_ARGS) /* * pgstrom_int4_to_float2 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int4_to_float2); +PUBLIC_FUNCTION(Datum) pgstrom_int4_to_float2(PG_FUNCTION_ARGS) { double fval = (double) PG_GETARG_INT32(0); @@ -359,7 +274,8 @@ pgstrom_int4_to_float2(PG_FUNCTION_ARGS) /* * pgstrom_int8_to_float2 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int8_to_float2); +PUBLIC_FUNCTION(Datum) pgstrom_int8_to_float2(PG_FUNCTION_ARGS) { double fval = (double) PG_GETARG_INT64(0); @@ -370,7 +286,8 @@ pgstrom_int8_to_float2(PG_FUNCTION_ARGS) /* * pgstrom_numeric_to_float2 */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_numeric_to_float2); +PUBLIC_FUNCTION(Datum) pgstrom_numeric_to_float2(PG_FUNCTION_ARGS) { float fval = DatumGetFloat4(numeric_float4(fcinfo)); @@ -381,7 +298,8 @@ pgstrom_numeric_to_float2(PG_FUNCTION_ARGS) /* * Comparison operators */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2eq); +PUBLIC_FUNCTION(Datum) pgstrom_float2eq(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -390,7 +308,8 @@ pgstrom_float2eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) == 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2ne); +PUBLIC_FUNCTION(Datum) pgstrom_float2ne(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -399,7 +318,8 @@ pgstrom_float2ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) != 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2lt); +PUBLIC_FUNCTION(Datum) pgstrom_float2lt(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -408,7 +328,8 @@ pgstrom_float2lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) < 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2le); +PUBLIC_FUNCTION(Datum) pgstrom_float2le(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -417,7 +338,8 @@ pgstrom_float2le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) <= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2gt); +PUBLIC_FUNCTION(Datum) pgstrom_float2gt(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -426,7 +348,8 @@ pgstrom_float2gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) > 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2ge); +PUBLIC_FUNCTION(Datum) pgstrom_float2ge(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -435,7 +358,8 @@ pgstrom_float2ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) >= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2cmp); +PUBLIC_FUNCTION(Datum) pgstrom_float2cmp(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -445,7 +369,8 @@ pgstrom_float2cmp(PG_FUNCTION_ARGS) PG_RETURN_INT32(comp > 0 ? 1 : (comp < 0 ? -1 : 0)); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2larger); +PUBLIC_FUNCTION(Datum) pgstrom_float2larger(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -454,7 +379,8 @@ pgstrom_float2larger(PG_FUNCTION_ARGS) PG_RETURN_DATUM(arg1 > arg2 ? PG_GETARG_DATUM(0) : PG_GETARG_DATUM(1)); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2smaller); +PUBLIC_FUNCTION(Datum) pgstrom_float2smaller(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -463,7 +389,8 @@ pgstrom_float2smaller(PG_FUNCTION_ARGS) PG_RETURN_DATUM(arg1 < arg2 ? PG_GETARG_DATUM(0) : PG_GETARG_DATUM(1)); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2hash); +PUBLIC_FUNCTION(Datum) pgstrom_float2hash(PG_FUNCTION_ARGS) { half_t fval = PG_GETARG_UINT16(0); @@ -485,7 +412,8 @@ pgstrom_float2hash(PG_FUNCTION_ARGS) return hash_any((unsigned char *)&fval, sizeof(half_t)); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42eq); +PUBLIC_FUNCTION(Datum) pgstrom_float42eq(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -494,7 +422,8 @@ pgstrom_float42eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) == 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42ne); +PUBLIC_FUNCTION(Datum) pgstrom_float42ne(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -503,7 +432,8 @@ pgstrom_float42ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) != 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42lt); +PUBLIC_FUNCTION(Datum) pgstrom_float42lt(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -512,7 +442,8 @@ pgstrom_float42lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) < 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42le); +PUBLIC_FUNCTION(Datum) pgstrom_float42le(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -521,7 +452,8 @@ pgstrom_float42le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) <= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42gt); +PUBLIC_FUNCTION(Datum) pgstrom_float42gt(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -530,7 +462,8 @@ pgstrom_float42gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) > 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42ge); +PUBLIC_FUNCTION(Datum) pgstrom_float42ge(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -539,7 +472,8 @@ pgstrom_float42ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) >= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42cmp); +PUBLIC_FUNCTION(Datum) pgstrom_float42cmp(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -549,7 +483,8 @@ pgstrom_float42cmp(PG_FUNCTION_ARGS) PG_RETURN_INT32(comp > 0 ? 1 : (comp < 0 ? -1 : 0)); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82eq); +PUBLIC_FUNCTION(Datum) pgstrom_float82eq(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -558,7 +493,8 @@ pgstrom_float82eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) == 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82ne); +PUBLIC_FUNCTION(Datum) pgstrom_float82ne(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -567,7 +503,8 @@ pgstrom_float82ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) != 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82lt); +PUBLIC_FUNCTION(Datum) pgstrom_float82lt(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -576,7 +513,8 @@ pgstrom_float82lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) < 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82le); +PUBLIC_FUNCTION(Datum) pgstrom_float82le(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -585,7 +523,8 @@ pgstrom_float82le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) <= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82gt); +PUBLIC_FUNCTION(Datum) pgstrom_float82gt(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -594,7 +533,8 @@ pgstrom_float82gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) > 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82ge); +PUBLIC_FUNCTION(Datum) pgstrom_float82ge(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -603,7 +543,8 @@ pgstrom_float82ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) >= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82cmp); +PUBLIC_FUNCTION(Datum) pgstrom_float82cmp(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -613,7 +554,8 @@ pgstrom_float82cmp(PG_FUNCTION_ARGS) PG_RETURN_INT32(comp > 0 ? 1 : (comp < 0 ? -1 : 0)); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24eq); +PUBLIC_FUNCTION(Datum) pgstrom_float24eq(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -622,7 +564,8 @@ pgstrom_float24eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) == 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24ne); +PUBLIC_FUNCTION(Datum) pgstrom_float24ne(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -631,7 +574,8 @@ pgstrom_float24ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) != 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24lt); +PUBLIC_FUNCTION(Datum) pgstrom_float24lt(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -640,7 +584,8 @@ pgstrom_float24lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) < 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24le); +PUBLIC_FUNCTION(Datum) pgstrom_float24le(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -649,7 +594,8 @@ pgstrom_float24le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) <= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24gt); +PUBLIC_FUNCTION(Datum) pgstrom_float24gt(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -658,7 +604,8 @@ pgstrom_float24gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) > 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24ge); +PUBLIC_FUNCTION(Datum) pgstrom_float24ge(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -667,7 +614,8 @@ pgstrom_float24ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float4_cmp_internal(arg1, arg2) >= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24cmp); +PUBLIC_FUNCTION(Datum) pgstrom_float24cmp(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -677,7 +625,8 @@ pgstrom_float24cmp(PG_FUNCTION_ARGS) PG_RETURN_INT32(comp > 0 ? 1 : (comp < 0 ? -1 : 0)); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28eq); +PUBLIC_FUNCTION(Datum) pgstrom_float28eq(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -686,7 +635,8 @@ pgstrom_float28eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) == 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28ne); +PUBLIC_FUNCTION(Datum) pgstrom_float28ne(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -695,7 +645,8 @@ pgstrom_float28ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) != 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28lt); +PUBLIC_FUNCTION(Datum) pgstrom_float28lt(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -704,7 +655,8 @@ pgstrom_float28lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) < 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28le); +PUBLIC_FUNCTION(Datum) pgstrom_float28le(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -713,7 +665,8 @@ pgstrom_float28le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) <= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28gt); +PUBLIC_FUNCTION(Datum) pgstrom_float28gt(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -722,7 +675,8 @@ pgstrom_float28gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) > 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28ge); +PUBLIC_FUNCTION(Datum) pgstrom_float28ge(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -731,7 +685,8 @@ pgstrom_float28ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(float8_cmp_internal(arg1, arg2) >= 0); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28cmp); +PUBLIC_FUNCTION(Datum) pgstrom_float28cmp(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -744,7 +699,8 @@ pgstrom_float28cmp(PG_FUNCTION_ARGS) /* * unary operators */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2up); +PUBLIC_FUNCTION(Datum) pgstrom_float2up(PG_FUNCTION_ARGS) { float2_t fval = PG_GETARG_FP16(0); @@ -752,7 +708,8 @@ pgstrom_float2up(PG_FUNCTION_ARGS) PG_RETURN_FP16(fval); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2um); +PUBLIC_FUNCTION(Datum) pgstrom_float2um(PG_FUNCTION_ARGS) { float2_t fval = PG_GETARG_FP16(0); @@ -764,7 +721,8 @@ pgstrom_float2um(PG_FUNCTION_ARGS) PG_RETURN_FP16(fval); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2abs); +PUBLIC_FUNCTION(Datum) pgstrom_float2abs(PG_FUNCTION_ARGS) { float2_t fval = PG_GETARG_FP16(0); @@ -779,7 +737,8 @@ pgstrom_float2abs(PG_FUNCTION_ARGS) /* * arithmetic operations */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2pl); +PUBLIC_FUNCTION(Datum) pgstrom_float2pl(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -792,7 +751,8 @@ pgstrom_float2pl(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2mi); +PUBLIC_FUNCTION(Datum) pgstrom_float2mi(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -804,7 +764,8 @@ pgstrom_float2mi(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2mul); +PUBLIC_FUNCTION(Datum) pgstrom_float2mul(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -819,7 +780,8 @@ pgstrom_float2mul(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2div); +PUBLIC_FUNCTION(Datum) pgstrom_float2div(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -836,7 +798,8 @@ pgstrom_float2div(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24pl); +PUBLIC_FUNCTION(Datum) pgstrom_float24pl(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -849,7 +812,8 @@ pgstrom_float24pl(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24mi); +PUBLIC_FUNCTION(Datum) pgstrom_float24mi(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -862,7 +826,8 @@ pgstrom_float24mi(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24mul); +PUBLIC_FUNCTION(Datum) pgstrom_float24mul(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -876,7 +841,8 @@ pgstrom_float24mul(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float24div); +PUBLIC_FUNCTION(Datum) pgstrom_float24div(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -894,7 +860,8 @@ pgstrom_float24div(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28pl); +PUBLIC_FUNCTION(Datum) pgstrom_float28pl(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP32(0); @@ -907,7 +874,8 @@ pgstrom_float28pl(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28mi); +PUBLIC_FUNCTION(Datum) pgstrom_float28mi(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -920,7 +888,8 @@ pgstrom_float28mi(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28mul); +PUBLIC_FUNCTION(Datum) pgstrom_float28mul(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -934,7 +903,8 @@ pgstrom_float28mul(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float28div); +PUBLIC_FUNCTION(Datum) pgstrom_float28div(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FP16_AS_FP64(0); @@ -952,7 +922,8 @@ pgstrom_float28div(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42pl); +PUBLIC_FUNCTION(Datum) pgstrom_float42pl(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -964,7 +935,8 @@ pgstrom_float42pl(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42mi); +PUBLIC_FUNCTION(Datum) pgstrom_float42mi(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -976,7 +948,8 @@ pgstrom_float42mi(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42mul); +PUBLIC_FUNCTION(Datum) pgstrom_float42mul(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -990,7 +963,8 @@ pgstrom_float42mul(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float42div); +PUBLIC_FUNCTION(Datum) pgstrom_float42div(PG_FUNCTION_ARGS) { float arg1 = PG_GETARG_FLOAT4(0); @@ -1007,7 +981,8 @@ pgstrom_float42div(PG_FUNCTION_ARGS) PG_RETURN_FLOAT4(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82pl); +PUBLIC_FUNCTION(Datum) pgstrom_float82pl(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -1019,7 +994,8 @@ pgstrom_float82pl(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82mi); +PUBLIC_FUNCTION(Datum) pgstrom_float82mi(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -1031,7 +1007,8 @@ pgstrom_float82mi(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82mul); +PUBLIC_FUNCTION(Datum) pgstrom_float82mul(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -1046,7 +1023,8 @@ pgstrom_float82mul(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float82div); +PUBLIC_FUNCTION(Datum) pgstrom_float82div(PG_FUNCTION_ARGS) { double arg1 = PG_GETARG_FLOAT8(0); @@ -1067,7 +1045,8 @@ pgstrom_float82div(PG_FUNCTION_ARGS) /* * Misc functions */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_cash_mul_flt2); +PUBLIC_FUNCTION(Datum) pgstrom_cash_mul_flt2(PG_FUNCTION_ARGS) { Cash c = PG_GETARG_CASH(0); @@ -1078,7 +1057,8 @@ pgstrom_cash_mul_flt2(PG_FUNCTION_ARGS) PG_RETURN_CASH(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_flt2_mul_cash); +PUBLIC_FUNCTION(Datum) pgstrom_flt2_mul_cash(PG_FUNCTION_ARGS) { float8 f = PG_GETARG_FP16_AS_FP64(0); @@ -1089,7 +1069,8 @@ pgstrom_flt2_mul_cash(PG_FUNCTION_ARGS) PG_RETURN_CASH(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_cash_div_flt2); +PUBLIC_FUNCTION(Datum) pgstrom_cash_div_flt2(PG_FUNCTION_ARGS) { Cash c = PG_GETARG_CASH(0); @@ -1105,7 +1086,8 @@ pgstrom_cash_div_flt2(PG_FUNCTION_ARGS) PG_RETURN_CASH(result); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2_accum); +PUBLIC_FUNCTION(Datum) pgstrom_float2_accum(PG_FUNCTION_ARGS) { ArrayType *transarray = PG_GETARG_ARRAYTYPE_P(0); @@ -1162,7 +1144,8 @@ pgstrom_float2_accum(PG_FUNCTION_ARGS) } } -Datum +PG_FUNCTION_INFO_V1(pgstrom_float2_sum); +PUBLIC_FUNCTION(Datum) pgstrom_float2_sum(PG_FUNCTION_ARGS) { float8 newval; diff --git a/src/gpu_cache.c b/src/gpu_cache.c index e1ee12ad4..7e92c9d95 100644 --- a/src/gpu_cache.c +++ b/src/gpu_cache.c @@ -216,11 +216,6 @@ static bool __gpuCacheAppendLog(GpuCacheDesc *gc_desc, static void gpuCacheInvokeDropUnload(const GpuCacheDesc *gc_desc, bool is_async); void gpuCacheStartupPreloader(Datum arg); -PG_FUNCTION_INFO_V1(pgstrom_gpucache_sync_trigger); -PG_FUNCTION_INFO_V1(pgstrom_gpucache_apply_redo); -PG_FUNCTION_INFO_V1(pgstrom_gpucache_compaction); -PG_FUNCTION_INFO_V1(pgstrom_gpucache_recovery); -PG_FUNCTION_INFO_V1(pgstrom_gpucache_info); /* * gpucache_sync_trigger_function_oid @@ -2397,7 +2392,8 @@ __gpuCacheTruncateLog(Oid table_oid) /* * pgstrom_gpucache_sync_trigger */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_gpucache_sync_trigger); +PUBLIC_FUNCTION(Datum) pgstrom_gpucache_sync_trigger(PG_FUNCTION_ARGS) { TriggerData *trigdata = (TriggerData *) fcinfo->context; @@ -2463,7 +2459,8 @@ pgstrom_gpucache_sync_trigger(PG_FUNCTION_ARGS) /* * pgstrom_gpucache_apply_redo */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_gpucache_apply_redo); +PUBLIC_FUNCTION(Datum) pgstrom_gpucache_apply_redo(PG_FUNCTION_ARGS) { Oid table_oid = PG_GETARG_OID(0); @@ -2491,7 +2488,8 @@ pgstrom_gpucache_apply_redo(PG_FUNCTION_ARGS) /* * pgstrom_gpucache_compaction */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_gpucache_compaction); +PUBLIC_FUNCTION(Datum) pgstrom_gpucache_compaction(PG_FUNCTION_ARGS) { Oid table_oid = PG_GETARG_OID(0); @@ -2512,7 +2510,8 @@ pgstrom_gpucache_compaction(PG_FUNCTION_ARGS) /* * pgstrom_gpucache_recovery */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_gpucache_recovery); +PUBLIC_FUNCTION(Datum) pgstrom_gpucache_recovery(PG_FUNCTION_ARGS) { Oid table_oid = PG_GETARG_OID(0); @@ -4064,6 +4063,7 @@ gpuCacheStartupPreloader(Datum arg) * * ------------------------------------------------------------ */ +PG_FUNCTION_INFO_V1(pgstrom_gpucache_info); static List * __pgstrom_gpucache_info(void) { @@ -4126,7 +4126,7 @@ __pgstrom_gpucache_info(void) return results; } -Datum +PUBLIC_FUNCTION(Datum) pgstrom_gpucache_info(PG_FUNCTION_ARGS) { GpuCacheSharedState *gc_sstate; diff --git a/src/gpu_device.c b/src/gpu_device.c index 50b4413cf..cfbc2158f 100644 --- a/src/gpu_device.c +++ b/src/gpu_device.c @@ -44,9 +44,6 @@ static struct { #undef DEV_ATTR }; -/* declaration */ -Datum pgstrom_gpu_device_info(PG_FUNCTION_ARGS); - /* * collectGpuDevAttrs */ @@ -575,7 +572,7 @@ gpuOptimalBlockSize(int *p_grid_sz, * pgstrom_gpu_device_info - SQL function to dump device info */ PG_FUNCTION_INFO_V1(pgstrom_gpu_device_info); -Datum +PUBLIC_FUNCTION(Datum) pgstrom_gpu_device_info(PG_FUNCTION_ARGS) { FuncCallContext *fncxt; diff --git a/src/gpu_join.c b/src/gpu_join.c index 0d97d5e34..e3b972946 100644 --- a/src/gpu_join.c +++ b/src/gpu_join.c @@ -1038,9 +1038,9 @@ pgstrom_build_groupby_tlist_dev(codegen_context *context, if (!tlist_member(arg, context->tlist_dev)) { - TargetEntry *tle = makeTargetEntry(arg, resno, NULL, true); + TargetEntry *__tle = makeTargetEntry(arg, resno, NULL, true); - context->tlist_dev = lappend(context->tlist_dev, tle); + context->tlist_dev = lappend(context->tlist_dev, __tle); } } } diff --git a/src/gpu_service.c b/src/gpu_service.c index 52d613c6c..fcae78353 100644 --- a/src/gpu_service.c +++ b/src/gpu_service.c @@ -2684,7 +2684,7 @@ __gpuContextAdjustWorkersOne(gpuContext *gcontext, uint32_t nworkers) __FATAL("failed on pthread_attr_init"); if (pthread_attr_setdetachstate(&th_attr, PTHREAD_CREATE_DETACHED) != 0) __FATAL("failed on pthread_attr_setdetachstate"); - elog(LOG, "count = %d nworkers = %d", count, nworkers); + while (count < nworkers) { gpuWorker *gworker = calloc(1, sizeof(gpuWorker)); @@ -2742,7 +2742,7 @@ __gpuContextAdjustWorkersOne(gpuContext *gcontext, uint32_t nworkers) elog(LOG, "GPU%d workers - %d startup%s, %d terminate", gcontext->cuda_dindex, nr_startup >> 1, - (nr_startup & 1) ? " (incl. GpuCacheManager)" : "", + (nr_startup & 1) ? " (with GpuCacheManager)" : "", nr_terminate); } } @@ -2976,7 +2976,7 @@ gpuservCleanupOnProcExit(int code, Datum arg) /* * gpuservBgWorkerMain */ -void +PUBLIC_FUNCTION(void) gpuservBgWorkerMain(Datum arg) { CUresult rc; diff --git a/src/main.c b/src/main.c index 2d982f6fc..b7b1d41dd 100644 --- a/src/main.c +++ b/src/main.c @@ -15,9 +15,9 @@ PG_MODULE_MAGIC; /* misc variables */ static Oid __pgstrom_namespace_oid = UINT_MAX; -static bool __pgstrom_enabled_guc; /* GUC */ -int pgstrom_cpu_fallback_elevel; /* GUC */ -bool pgstrom_regression_test_mode; /* GUC */ +static bool __pgstrom_enabled_guc = true; /* GUC */ +int pgstrom_cpu_fallback_elevel = NOTICE; /* GUC */ +bool pgstrom_regression_test_mode = false; /* GUC */ long PAGE_SIZE; long PAGE_MASK; int PAGE_SHIFT; @@ -30,7 +30,7 @@ static CustomScanMethods pgstrom_dummy_plan_methods; /* pg_strom.githash() */ PG_FUNCTION_INFO_V1(pgstrom_githash); -Datum +PUBLIC_FUNCTION(Datum) pgstrom_githash(PG_FUNCTION_ARGS) { PG_RETURN_TEXT_P(cstring_to_text(pgstrom_githash_cstring)); diff --git a/src/misc.c b/src/misc.c index e91c2a236..ce5545acb 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1083,45 +1083,6 @@ pgstrom_copy_pathnode(const Path *pathnode) return NULL; } -#if 0 -/* - * pgstrom_define_shell_type - A wrapper for TypeShellMake with a particular OID - */ -PG_FUNCTION_INFO_V1(pgstrom_define_shell_type); -Datum -pgstrom_define_shell_type(PG_FUNCTION_ARGS) -{ - char *type_name = text_to_cstring(PG_GETARG_TEXT_PP(0)); - Oid type_oid = PG_GETARG_OID(1); - Oid type_namespace = PG_GETARG_OID(2); - bool __IsBinaryUpgrade = IsBinaryUpgrade; - Oid __binary_upgrade_next_pg_type_oid = binary_upgrade_next_pg_type_oid; - - if (!superuser()) - ereport(ERROR, - (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("must be superuser to create a shell type"))); - PG_TRY(); - { - IsBinaryUpgrade = true; - binary_upgrade_next_pg_type_oid = type_oid; - - TypeShellMake(type_name, type_namespace, GetUserId()); - } - PG_CATCH(); - { - IsBinaryUpgrade = __IsBinaryUpgrade; - binary_upgrade_next_pg_type_oid = __binary_upgrade_next_pg_type_oid; - PG_RE_THROW(); - } - PG_END_TRY(); - IsBinaryUpgrade = __IsBinaryUpgrade; - binary_upgrade_next_pg_type_oid = __binary_upgrade_next_pg_type_oid; - - PG_RETURN_OID(type_oid); -} -#endif - /* * ---------------------------------------------------------------- * @@ -1129,30 +1090,11 @@ pgstrom_define_shell_type(PG_FUNCTION_ARGS) * * ---------------------------------------------------------------- */ -Datum pgstrom_random_setseed(PG_FUNCTION_ARGS); -Datum pgstrom_random_int(PG_FUNCTION_ARGS); -Datum pgstrom_random_float(PG_FUNCTION_ARGS); -Datum pgstrom_random_date(PG_FUNCTION_ARGS); -Datum pgstrom_random_time(PG_FUNCTION_ARGS); -Datum pgstrom_random_timetz(PG_FUNCTION_ARGS); -Datum pgstrom_random_timestamp(PG_FUNCTION_ARGS); -Datum pgstrom_random_timestamptz(PG_FUNCTION_ARGS); -Datum pgstrom_random_interval(PG_FUNCTION_ARGS); -Datum pgstrom_random_macaddr(PG_FUNCTION_ARGS); -Datum pgstrom_random_inet(PG_FUNCTION_ARGS); -Datum pgstrom_random_text(PG_FUNCTION_ARGS); -Datum pgstrom_random_text_length(PG_FUNCTION_ARGS); -Datum pgstrom_random_int4range(PG_FUNCTION_ARGS); -Datum pgstrom_random_int8range(PG_FUNCTION_ARGS); -Datum pgstrom_random_tsrange(PG_FUNCTION_ARGS); -Datum pgstrom_random_tstzrange(PG_FUNCTION_ARGS); -Datum pgstrom_random_daterange(PG_FUNCTION_ARGS); -Datum pgstrom_abort_if(PG_FUNCTION_ARGS); - static unsigned int pgstrom_random_seed = 0; static bool pgstrom_random_seed_set = false; -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_setseed); +PUBLIC_FUNCTION(Datum) pgstrom_random_setseed(PG_FUNCTION_ARGS) { unsigned int seed = PG_GETARG_UINT32(0); @@ -1162,7 +1104,6 @@ pgstrom_random_setseed(PG_FUNCTION_ARGS) PG_RETURN_VOID(); } -PG_FUNCTION_INFO_V1(pgstrom_random_setseed); static int64_t __random(void) @@ -1191,7 +1132,8 @@ generate_null(double ratio) return false; } -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_int); +PUBLIC_FUNCTION(Datum) pgstrom_random_int(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1209,9 +1151,9 @@ pgstrom_random_int(PG_FUNCTION_ARGS) PG_RETURN_INT64(lower + v % (upper - lower)); } -PG_FUNCTION_INFO_V1(pgstrom_random_int); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_float); +PUBLIC_FUNCTION(Datum) pgstrom_random_float(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1227,9 +1169,9 @@ pgstrom_random_float(PG_FUNCTION_ARGS) PG_RETURN_FLOAT8((upper - lower) * __drand48() + lower); } -PG_FUNCTION_INFO_V1(pgstrom_random_float); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_date); +PUBLIC_FUNCTION(Datum) pgstrom_random_date(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1256,9 +1198,9 @@ pgstrom_random_date(PG_FUNCTION_ARGS) PG_RETURN_DATEADT(lower + v % (upper - lower)); } -PG_FUNCTION_INFO_V1(pgstrom_random_date); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_time); +PUBLIC_FUNCTION(Datum) pgstrom_random_time(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1280,9 +1222,9 @@ pgstrom_random_time(PG_FUNCTION_ARGS) PG_RETURN_TIMEADT(lower + v % (upper - lower)); } -PG_FUNCTION_INFO_V1(pgstrom_random_time); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_timetz); +PUBLIC_FUNCTION(Datum) pgstrom_random_timetz(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1310,9 +1252,9 @@ pgstrom_random_timetz(PG_FUNCTION_ARGS) } PG_RETURN_TIMETZADT_P(temp); } -PG_FUNCTION_INFO_V1(pgstrom_random_timetz); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_timestamp); +PUBLIC_FUNCTION(Datum) pgstrom_random_timestamp(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1350,9 +1292,9 @@ pgstrom_random_timestamp(PG_FUNCTION_ARGS) PG_RETURN_TIMESTAMP(lower + v % (upper - lower)); } -PG_FUNCTION_INFO_V1(pgstrom_random_timestamp); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_macaddr); +PUBLIC_FUNCTION(Datum) pgstrom_random_macaddr(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1401,9 +1343,9 @@ pgstrom_random_macaddr(PG_FUNCTION_ARGS) temp->f = (x ) & 0x00ff; PG_RETURN_MACADDR_P(temp); } -PG_FUNCTION_INFO_V1(pgstrom_random_macaddr); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_inet); +PUBLIC_FUNCTION(Datum) pgstrom_random_inet(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1454,9 +1396,9 @@ pgstrom_random_inet(PG_FUNCTION_ARGS) ip_bits(temp) = ip_maxbits(temp); PG_RETURN_INET_P(temp); } -PG_FUNCTION_INFO_V1(pgstrom_random_inet); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_text); +PUBLIC_FUNCTION(Datum) pgstrom_random_text(PG_FUNCTION_ARGS) { static const char *base32 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; @@ -1492,9 +1434,9 @@ pgstrom_random_text(PG_FUNCTION_ARGS) } PG_RETURN_TEXT_P(temp); } -PG_FUNCTION_INFO_V1(pgstrom_random_text); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_text_length); +PUBLIC_FUNCTION(Datum) pgstrom_random_text_length(PG_FUNCTION_ARGS) { static const char *base64 = @@ -1531,7 +1473,6 @@ pgstrom_random_text_length(PG_FUNCTION_ARGS) } PG_RETURN_TEXT_P(temp); } -PG_FUNCTION_INFO_V1(pgstrom_random_text_length); static Datum simple_make_range(PG_FUNCTION_ARGS, @@ -1557,7 +1498,8 @@ simple_make_range(PG_FUNCTION_ARGS, return PointerGetDatum(range); } -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_int4range); +PUBLIC_FUNCTION(Datum) pgstrom_random_int4range(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1582,9 +1524,9 @@ pgstrom_random_int4range(PG_FUNCTION_ARGS) Int32GetDatum(Min(x,y)), Int32GetDatum(Max(x,y))); } -PG_FUNCTION_INFO_V1(pgstrom_random_int4range); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_int8range); +PUBLIC_FUNCTION(Datum) pgstrom_random_int8range(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1611,9 +1553,9 @@ pgstrom_random_int8range(PG_FUNCTION_ARGS) Int64GetDatum(Min(x,y)), Int64GetDatum(Max(x,y))); } -PG_FUNCTION_INFO_V1(pgstrom_random_int8range); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_tsrange); +PUBLIC_FUNCTION(Datum) pgstrom_random_tsrange(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1663,9 +1605,9 @@ pgstrom_random_tsrange(PG_FUNCTION_ARGS) TimestampGetDatum(Min(x,y)), TimestampGetDatum(Max(x,y))); } -PG_FUNCTION_INFO_V1(pgstrom_random_tsrange); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_tstzrange); +PUBLIC_FUNCTION(Datum) pgstrom_random_tstzrange(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1715,9 +1657,9 @@ pgstrom_random_tstzrange(PG_FUNCTION_ARGS) TimestampTzGetDatum(Min(x,y)), TimestampTzGetDatum(Max(x,y))); } -PG_FUNCTION_INFO_V1(pgstrom_random_tstzrange); -Datum +PG_FUNCTION_INFO_V1(pgstrom_random_daterange); +PUBLIC_FUNCTION(Datum) pgstrom_random_daterange(PG_FUNCTION_ARGS) { float8 ratio = (!PG_ARGISNULL(0) ? PG_GETARG_FLOAT8(0) : 0.0); @@ -1753,9 +1695,9 @@ pgstrom_random_daterange(PG_FUNCTION_ARGS) DateADTGetDatum(Min(x,y)), DateADTGetDatum(Max(x,y))); } -PG_FUNCTION_INFO_V1(pgstrom_random_daterange); -Datum +PG_FUNCTION_INFO_V1(pgstrom_abort_if); +PUBLIC_FUNCTION(Datum) pgstrom_abort_if(PG_FUNCTION_ARGS) { bool cond = PG_GETARG_BOOL(0); @@ -1765,7 +1707,6 @@ pgstrom_abort_if(PG_FUNCTION_ARGS) PG_RETURN_VOID(); } -PG_FUNCTION_INFO_V1(pgstrom_abort_if); /* * Simple wrapper for read(2) and write(2) to ensure full-buffer read and diff --git a/src/tinyint.c b/src/tinyint.c index 6fcc47211..94594a4de 100644 --- a/src/tinyint.c +++ b/src/tinyint.c @@ -15,153 +15,11 @@ #define PG_GETARG_INT8(x) DatumGetInt8(PG_GETARG_DATUM(x)) #define PG_RETURN_INT8(x) return Int8GetDatum(x) -/* type input/output */ -Datum pgstrom_int1in(PG_FUNCTION_ARGS); -Datum pgstrom_int1out(PG_FUNCTION_ARGS); -Datum pgstrom_int1send(PG_FUNCTION_ARGS); -Datum pgstrom_int1recv(PG_FUNCTION_ARGS); - -/* type cast functions */ -Datum pgstrom_int1_to_int2(PG_FUNCTION_ARGS); -Datum pgstrom_int1_to_int4(PG_FUNCTION_ARGS); -Datum pgstrom_int1_to_int8(PG_FUNCTION_ARGS); -Datum pgstrom_int1_to_float4(PG_FUNCTION_ARGS); -Datum pgstrom_int1_to_float8(PG_FUNCTION_ARGS); -Datum pgstrom_int1_to_numeric(PG_FUNCTION_ARGS); -Datum pgstrom_int2_to_int1(PG_FUNCTION_ARGS); -Datum pgstrom_int4_to_int1(PG_FUNCTION_ARGS); -Datum pgstrom_int8_to_int1(PG_FUNCTION_ARGS); -Datum pgstrom_float4_to_int1(PG_FUNCTION_ARGS); -Datum pgstrom_float8_to_int1(PG_FUNCTION_ARGS); -Datum pgstrom_numeric_to_int1(PG_FUNCTION_ARGS); - -/* comparison */ -Datum pgstrom_int1eq(PG_FUNCTION_ARGS); -Datum pgstrom_int1ne(PG_FUNCTION_ARGS); -Datum pgstrom_int1lt(PG_FUNCTION_ARGS); -Datum pgstrom_int1le(PG_FUNCTION_ARGS); -Datum pgstrom_int1gt(PG_FUNCTION_ARGS); -Datum pgstrom_int1ge(PG_FUNCTION_ARGS); -Datum pgstrom_int1larger(PG_FUNCTION_ARGS); -Datum pgstrom_int1smaller(PG_FUNCTION_ARGS); - -Datum pgstrom_int12eq(PG_FUNCTION_ARGS); -Datum pgstrom_int12ne(PG_FUNCTION_ARGS); -Datum pgstrom_int12lt(PG_FUNCTION_ARGS); -Datum pgstrom_int12le(PG_FUNCTION_ARGS); -Datum pgstrom_int12gt(PG_FUNCTION_ARGS); -Datum pgstrom_int12ge(PG_FUNCTION_ARGS); - -Datum pgstrom_int14eq(PG_FUNCTION_ARGS); -Datum pgstrom_int14ne(PG_FUNCTION_ARGS); -Datum pgstrom_int14lt(PG_FUNCTION_ARGS); -Datum pgstrom_int14le(PG_FUNCTION_ARGS); -Datum pgstrom_int14gt(PG_FUNCTION_ARGS); -Datum pgstrom_int14ge(PG_FUNCTION_ARGS); - -Datum pgstrom_int18eq(PG_FUNCTION_ARGS); -Datum pgstrom_int18ne(PG_FUNCTION_ARGS); -Datum pgstrom_int18lt(PG_FUNCTION_ARGS); -Datum pgstrom_int18le(PG_FUNCTION_ARGS); -Datum pgstrom_int18gt(PG_FUNCTION_ARGS); -Datum pgstrom_int18ge(PG_FUNCTION_ARGS); - -Datum pgstrom_int21eq(PG_FUNCTION_ARGS); -Datum pgstrom_int21ne(PG_FUNCTION_ARGS); -Datum pgstrom_int21lt(PG_FUNCTION_ARGS); -Datum pgstrom_int21le(PG_FUNCTION_ARGS); -Datum pgstrom_int21gt(PG_FUNCTION_ARGS); -Datum pgstrom_int21ge(PG_FUNCTION_ARGS); - -Datum pgstrom_int41eq(PG_FUNCTION_ARGS); -Datum pgstrom_int41ne(PG_FUNCTION_ARGS); -Datum pgstrom_int41lt(PG_FUNCTION_ARGS); -Datum pgstrom_int41le(PG_FUNCTION_ARGS); -Datum pgstrom_int41gt(PG_FUNCTION_ARGS); -Datum pgstrom_int41ge(PG_FUNCTION_ARGS); - -Datum pgstrom_int81eq(PG_FUNCTION_ARGS); -Datum pgstrom_int81ne(PG_FUNCTION_ARGS); -Datum pgstrom_int81lt(PG_FUNCTION_ARGS); -Datum pgstrom_int81le(PG_FUNCTION_ARGS); -Datum pgstrom_int81gt(PG_FUNCTION_ARGS); -Datum pgstrom_int81ge(PG_FUNCTION_ARGS); - -Datum pgstrom_int1hash(PG_FUNCTION_ARGS); -Datum pgstrom_btint1cmp(PG_FUNCTION_ARGS); -Datum pgstrom_btint12cmp(PG_FUNCTION_ARGS); -Datum pgstrom_btint14cmp(PG_FUNCTION_ARGS); -Datum pgstrom_btint18cmp(PG_FUNCTION_ARGS); -Datum pgstrom_btint21cmp(PG_FUNCTION_ARGS); -Datum pgstrom_btint41cmp(PG_FUNCTION_ARGS); -Datum pgstrom_btint81cmp(PG_FUNCTION_ARGS); - -/* unary operators */ -Datum pgstrom_int1up(PG_FUNCTION_ARGS); -Datum pgstrom_int1um(PG_FUNCTION_ARGS); -Datum pgstrom_int1abs(PG_FUNCTION_ARGS); - -/* arithmetic operators */ -Datum pgstrom_int1pl(PG_FUNCTION_ARGS); -Datum pgstrom_int1mi(PG_FUNCTION_ARGS); -Datum pgstrom_int1mul(PG_FUNCTION_ARGS); -Datum pgstrom_int1div(PG_FUNCTION_ARGS); -Datum pgstrom_int1mod(PG_FUNCTION_ARGS); - -Datum pgstrom_int12pl(PG_FUNCTION_ARGS); -Datum pgstrom_int12mi(PG_FUNCTION_ARGS); -Datum pgstrom_int12mul(PG_FUNCTION_ARGS); -Datum pgstrom_int12div(PG_FUNCTION_ARGS); - -Datum pgstrom_int14pl(PG_FUNCTION_ARGS); -Datum pgstrom_int14mi(PG_FUNCTION_ARGS); -Datum pgstrom_int14mul(PG_FUNCTION_ARGS); -Datum pgstrom_int14div(PG_FUNCTION_ARGS); - -Datum pgstrom_int18pl(PG_FUNCTION_ARGS); -Datum pgstrom_int18mi(PG_FUNCTION_ARGS); -Datum pgstrom_int18mul(PG_FUNCTION_ARGS); -Datum pgstrom_int18div(PG_FUNCTION_ARGS); - -Datum pgstrom_int21pl(PG_FUNCTION_ARGS); -Datum pgstrom_int21mi(PG_FUNCTION_ARGS); -Datum pgstrom_int21mul(PG_FUNCTION_ARGS); -Datum pgstrom_int21div(PG_FUNCTION_ARGS); - -Datum pgstrom_int41pl(PG_FUNCTION_ARGS); -Datum pgstrom_int41mi(PG_FUNCTION_ARGS); -Datum pgstrom_int41mul(PG_FUNCTION_ARGS); -Datum pgstrom_int41div(PG_FUNCTION_ARGS); - -Datum pgstrom_int81pl(PG_FUNCTION_ARGS); -Datum pgstrom_int81mi(PG_FUNCTION_ARGS); -Datum pgstrom_int81mul(PG_FUNCTION_ARGS); -Datum pgstrom_int81div(PG_FUNCTION_ARGS); - -/* bit operations */ -Datum pgstrom_int1and(PG_FUNCTION_ARGS); -Datum pgstrom_int1or(PG_FUNCTION_ARGS); -Datum pgstrom_int1xor(PG_FUNCTION_ARGS); -Datum pgstrom_int1not(PG_FUNCTION_ARGS); -Datum pgstrom_int1shl(PG_FUNCTION_ARGS); -Datum pgstrom_int1shr(PG_FUNCTION_ARGS); - -/* misc functions */ -Datum pgstrom_cash_mul_int1(PG_FUNCTION_ARGS); -Datum pgstrom_int1_mul_cash(PG_FUNCTION_ARGS); -Datum pgstrom_cash_div_int1(PG_FUNCTION_ARGS); - -/* aggregate functions */ -Datum pgstrom_int1_sum(PG_FUNCTION_ARGS); -Datum pgstrom_int1_avg_accum(PG_FUNCTION_ARGS); -Datum pgstrom_int1_avg_accum_inv(PG_FUNCTION_ARGS); -Datum pgstrom_int1_var_accum(PG_FUNCTION_ARGS); -Datum pgstrom_int1_var_accum_inv(PG_FUNCTION_ARGS); - /* * Type input / output functions */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1in); +PUBLIC_FUNCTION(Datum) pgstrom_int1in(PG_FUNCTION_ARGS) { char *num = PG_GETARG_CSTRING(0); @@ -182,8 +40,8 @@ pgstrom_int1in(PG_FUNCTION_ARGS) num, "tinyint"))); PG_RETURN_INT8(ival); } -PG_FUNCTION_INFO_V1(pgstrom_int1in); +PG_FUNCTION_INFO_V1(pgstrom_int1out); Datum pgstrom_int1out(PG_FUNCTION_ARGS) { @@ -191,9 +49,9 @@ pgstrom_int1out(PG_FUNCTION_ARGS) PG_RETURN_CSTRING(psprintf("%d", (int)ival)); } -PG_FUNCTION_INFO_V1(pgstrom_int1out); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1send); +PUBLIC_FUNCTION(Datum) pgstrom_int1send(PG_FUNCTION_ARGS) { int8 ival = PG_GETARG_INT8(0); @@ -203,75 +61,75 @@ pgstrom_int1send(PG_FUNCTION_ARGS) pq_sendint8(&buf, ival); PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); } -PG_FUNCTION_INFO_V1(pgstrom_int1send); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1recv); +PUBLIC_FUNCTION(Datum) pgstrom_int1recv(PG_FUNCTION_ARGS) { StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); PG_RETURN_INT8((int8) pq_getmsgint(buf, sizeof(int8))); } -PG_FUNCTION_INFO_V1(pgstrom_int1recv); /* * Type cast functions */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_to_int2); +PUBLIC_FUNCTION(Datum) pgstrom_int1_to_int2(PG_FUNCTION_ARGS) { int8 ival = PG_GETARG_INT8(0); PG_RETURN_INT16(ival); } -PG_FUNCTION_INFO_V1(pgstrom_int1_to_int2); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_to_int4); +PUBLIC_FUNCTION(Datum) pgstrom_int1_to_int4(PG_FUNCTION_ARGS) { int8 ival = PG_GETARG_INT8(0); PG_RETURN_INT32(ival); } -PG_FUNCTION_INFO_V1(pgstrom_int1_to_int4); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_to_int8); +PUBLIC_FUNCTION(Datum) pgstrom_int1_to_int8(PG_FUNCTION_ARGS) { int8 ival = PG_GETARG_INT8(0); PG_RETURN_INT64(ival); } -PG_FUNCTION_INFO_V1(pgstrom_int1_to_int8); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_to_float4); +PUBLIC_FUNCTION(Datum) pgstrom_int1_to_float4(PG_FUNCTION_ARGS) { int8 ival = PG_GETARG_INT8(0); PG_RETURN_FLOAT4((float4) ival); } -PG_FUNCTION_INFO_V1(pgstrom_int1_to_float4); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_to_float8); +PUBLIC_FUNCTION(Datum) pgstrom_int1_to_float8(PG_FUNCTION_ARGS) { int8 ival = PG_GETARG_INT8(0); PG_RETURN_FLOAT8((float8) ival); } -PG_FUNCTION_INFO_V1(pgstrom_int1_to_float8); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_to_numeric); +PUBLIC_FUNCTION(Datum) pgstrom_int1_to_numeric(PG_FUNCTION_ARGS) { int32 ival = (int32)PG_GETARG_INT8(0); return DirectFunctionCall1(int4_numeric, Int32GetDatum(ival)); } -PG_FUNCTION_INFO_V1(pgstrom_int1_to_numeric); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int2_to_int1); +PUBLIC_FUNCTION(Datum) pgstrom_int2_to_int1(PG_FUNCTION_ARGS) { int16 ival = PG_GETARG_INT16(0); @@ -282,9 +140,9 @@ pgstrom_int2_to_int1(PG_FUNCTION_ARGS) errmsg("tinyint out of range"))); PG_RETURN_INT8(ival); } -PG_FUNCTION_INFO_V1(pgstrom_int2_to_int1); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int4_to_int1); +PUBLIC_FUNCTION(Datum) pgstrom_int4_to_int1(PG_FUNCTION_ARGS) { int32 ival = PG_GETARG_INT32(0); @@ -295,9 +153,9 @@ pgstrom_int4_to_int1(PG_FUNCTION_ARGS) errmsg("tinyint out of range"))); PG_RETURN_INT8(ival); } -PG_FUNCTION_INFO_V1(pgstrom_int4_to_int1); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int8_to_int1); +PUBLIC_FUNCTION(Datum) pgstrom_int8_to_int1(PG_FUNCTION_ARGS) { int64 ival = PG_GETARG_INT64(0); @@ -308,9 +166,9 @@ pgstrom_int8_to_int1(PG_FUNCTION_ARGS) errmsg("tinyint out of range"))); PG_RETURN_INT8(ival); } -PG_FUNCTION_INFO_V1(pgstrom_int8_to_int1); -Datum +PG_FUNCTION_INFO_V1(pgstrom_float4_to_int1); +PUBLIC_FUNCTION(Datum) pgstrom_float4_to_int1(PG_FUNCTION_ARGS) { float4 fval = PG_GETARG_FLOAT4(0); @@ -321,9 +179,9 @@ pgstrom_float4_to_int1(PG_FUNCTION_ARGS) errmsg("tinyint out of range"))); PG_RETURN_INT8(fval); } -PG_FUNCTION_INFO_V1(pgstrom_float4_to_int1); -Datum +PG_FUNCTION_INFO_V1(pgstrom_float8_to_int1); +PUBLIC_FUNCTION(Datum) pgstrom_float8_to_int1(PG_FUNCTION_ARGS) { float8 fval = PG_GETARG_FLOAT8(0); @@ -334,9 +192,9 @@ pgstrom_float8_to_int1(PG_FUNCTION_ARGS) errmsg("tinyint out of range"))); PG_RETURN_INT8((int8)fval); } -PG_FUNCTION_INFO_V1(pgstrom_float8_to_int1); -Datum +PG_FUNCTION_INFO_V1(pgstrom_numeric_to_int1); +PUBLIC_FUNCTION(Datum) pgstrom_numeric_to_int1(PG_FUNCTION_ARGS) { int32 ival = DatumGetInt32(numeric_int4(fcinfo)); @@ -347,12 +205,12 @@ pgstrom_numeric_to_int1(PG_FUNCTION_ARGS) errmsg("tinyint out of range"))); PG_RETURN_INT8((int8)ival); } -PG_FUNCTION_INFO_V1(pgstrom_numeric_to_int1); /* * Comparison functions */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1eq); +PUBLIC_FUNCTION(Datum) pgstrom_int1eq(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -360,9 +218,9 @@ pgstrom_int1eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 == arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1eq); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1ne); +PUBLIC_FUNCTION(Datum) pgstrom_int1ne(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -370,9 +228,9 @@ pgstrom_int1ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 != arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1ne); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1lt); +PUBLIC_FUNCTION(Datum) pgstrom_int1lt(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -380,9 +238,9 @@ pgstrom_int1lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 < arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1lt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1le); +PUBLIC_FUNCTION(Datum) pgstrom_int1le(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -390,9 +248,9 @@ pgstrom_int1le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 <= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1le); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1gt); +PUBLIC_FUNCTION(Datum) pgstrom_int1gt(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -400,9 +258,9 @@ pgstrom_int1gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 > arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1gt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1ge); +PUBLIC_FUNCTION(Datum) pgstrom_int1ge(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -410,9 +268,9 @@ pgstrom_int1ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 >= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1ge); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1larger); +PUBLIC_FUNCTION(Datum) pgstrom_int1larger(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -420,9 +278,9 @@ pgstrom_int1larger(PG_FUNCTION_ARGS) PG_RETURN_INT8(arg1 > arg2 ? arg1 : arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1larger); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1smaller); +PUBLIC_FUNCTION(Datum) pgstrom_int1smaller(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -430,9 +288,9 @@ pgstrom_int1smaller(PG_FUNCTION_ARGS) PG_RETURN_INT8(arg1 < arg2 ? arg1 : arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1smaller); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12eq); +PUBLIC_FUNCTION(Datum) pgstrom_int12eq(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -440,9 +298,9 @@ pgstrom_int12eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 == arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int12eq); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12ne); +PUBLIC_FUNCTION(Datum) pgstrom_int12ne(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -450,9 +308,9 @@ pgstrom_int12ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 != arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int12ne); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12lt); +PUBLIC_FUNCTION(Datum) pgstrom_int12lt(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -460,9 +318,9 @@ pgstrom_int12lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 < arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int12lt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12le); +PUBLIC_FUNCTION(Datum) pgstrom_int12le(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -470,9 +328,9 @@ pgstrom_int12le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 <= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int12le); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12gt); +PUBLIC_FUNCTION(Datum) pgstrom_int12gt(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -480,9 +338,9 @@ pgstrom_int12gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 > arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int12gt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12ge); +PUBLIC_FUNCTION(Datum) pgstrom_int12ge(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -490,9 +348,9 @@ pgstrom_int12ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 >= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int12ge); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14eq); +PUBLIC_FUNCTION(Datum) pgstrom_int14eq(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -500,9 +358,9 @@ pgstrom_int14eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 == arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int14eq); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14ne); +PUBLIC_FUNCTION(Datum) pgstrom_int14ne(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -510,9 +368,9 @@ pgstrom_int14ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 != arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int14ne); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14lt); +PUBLIC_FUNCTION(Datum) pgstrom_int14lt(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -520,9 +378,9 @@ pgstrom_int14lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 < arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int14lt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14le); +PUBLIC_FUNCTION(Datum) pgstrom_int14le(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -530,9 +388,9 @@ pgstrom_int14le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 <= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int14le); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14gt); +PUBLIC_FUNCTION(Datum) pgstrom_int14gt(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -540,9 +398,9 @@ pgstrom_int14gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 > arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int14gt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14ge); +PUBLIC_FUNCTION(Datum) pgstrom_int14ge(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -550,9 +408,9 @@ pgstrom_int14ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 >= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int14ge); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18eq); +PUBLIC_FUNCTION(Datum) pgstrom_int18eq(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -560,9 +418,9 @@ pgstrom_int18eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 == arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int18eq); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18ne); +PUBLIC_FUNCTION(Datum) pgstrom_int18ne(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -570,9 +428,9 @@ pgstrom_int18ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 != arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int18ne); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18lt); +PUBLIC_FUNCTION(Datum) pgstrom_int18lt(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -580,9 +438,9 @@ pgstrom_int18lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 < arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int18lt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18le); +PUBLIC_FUNCTION(Datum) pgstrom_int18le(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -590,9 +448,9 @@ pgstrom_int18le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 <= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int18le); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18gt); +PUBLIC_FUNCTION(Datum) pgstrom_int18gt(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -600,9 +458,9 @@ pgstrom_int18gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 > arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int18gt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18ge); +PUBLIC_FUNCTION(Datum) pgstrom_int18ge(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -610,9 +468,9 @@ pgstrom_int18ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 >= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int18ge); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21eq); +PUBLIC_FUNCTION(Datum) pgstrom_int21eq(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -620,9 +478,9 @@ pgstrom_int21eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 == arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int21eq); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21ne); +PUBLIC_FUNCTION(Datum) pgstrom_int21ne(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -630,9 +488,9 @@ pgstrom_int21ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 != arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int21ne); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21lt); +PUBLIC_FUNCTION(Datum) pgstrom_int21lt(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -640,9 +498,9 @@ pgstrom_int21lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 < arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int21lt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21le); +PUBLIC_FUNCTION(Datum) pgstrom_int21le(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -650,9 +508,9 @@ pgstrom_int21le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 <= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int21le); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21gt); +PUBLIC_FUNCTION(Datum) pgstrom_int21gt(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -660,9 +518,9 @@ pgstrom_int21gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 > arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int21gt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21ge); +PUBLIC_FUNCTION(Datum) pgstrom_int21ge(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -670,9 +528,9 @@ pgstrom_int21ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 >= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int21ge); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41eq); +PUBLIC_FUNCTION(Datum) pgstrom_int41eq(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -680,9 +538,9 @@ pgstrom_int41eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 == arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int41eq); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41ne); +PUBLIC_FUNCTION(Datum) pgstrom_int41ne(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -690,9 +548,9 @@ pgstrom_int41ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 != arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int41ne); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41lt); +PUBLIC_FUNCTION(Datum) pgstrom_int41lt(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -700,9 +558,9 @@ pgstrom_int41lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 < arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int41lt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41le); +PUBLIC_FUNCTION(Datum) pgstrom_int41le(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -710,9 +568,9 @@ pgstrom_int41le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 <= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int41le); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41gt); +PUBLIC_FUNCTION(Datum) pgstrom_int41gt(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -720,9 +578,9 @@ pgstrom_int41gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 > arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int41gt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41ge); +PUBLIC_FUNCTION(Datum) pgstrom_int41ge(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -730,9 +588,9 @@ pgstrom_int41ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 >= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int41ge); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81eq); +PUBLIC_FUNCTION(Datum) pgstrom_int81eq(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -740,9 +598,9 @@ pgstrom_int81eq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 == arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int81eq); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81ne); +PUBLIC_FUNCTION(Datum) pgstrom_int81ne(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -750,9 +608,9 @@ pgstrom_int81ne(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 != arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int81ne); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81lt); +PUBLIC_FUNCTION(Datum) pgstrom_int81lt(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -760,9 +618,9 @@ pgstrom_int81lt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 < arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int81lt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81le); +PUBLIC_FUNCTION(Datum) pgstrom_int81le(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -770,9 +628,9 @@ pgstrom_int81le(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 <= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int81le); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81gt); +PUBLIC_FUNCTION(Datum) pgstrom_int81gt(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -780,9 +638,9 @@ pgstrom_int81gt(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 > arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int81gt); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81ge); +PUBLIC_FUNCTION(Datum) pgstrom_int81ge(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -790,9 +648,9 @@ pgstrom_int81ge(PG_FUNCTION_ARGS) PG_RETURN_BOOL(arg1 >= arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int81ge); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1hash); +PUBLIC_FUNCTION(Datum) pgstrom_int1hash(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -800,9 +658,9 @@ pgstrom_int1hash(PG_FUNCTION_ARGS) /* Does it really make sense? */ return hash_any((unsigned char *)&arg1, sizeof(int8)); } -PG_FUNCTION_INFO_V1(pgstrom_int1hash); -Datum +PG_FUNCTION_INFO_V1(pgstrom_btint1cmp); +PUBLIC_FUNCTION(Datum) pgstrom_btint1cmp(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -815,9 +673,9 @@ pgstrom_btint1cmp(PG_FUNCTION_ARGS) else PG_RETURN_INT32(0); } -PG_FUNCTION_INFO_V1(pgstrom_btint1cmp); -Datum +PG_FUNCTION_INFO_V1(pgstrom_btint12cmp); +PUBLIC_FUNCTION(Datum) pgstrom_btint12cmp(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -830,9 +688,9 @@ pgstrom_btint12cmp(PG_FUNCTION_ARGS) else PG_RETURN_INT32(0); } -PG_FUNCTION_INFO_V1(pgstrom_btint12cmp); -Datum +PG_FUNCTION_INFO_V1(pgstrom_btint14cmp); +PUBLIC_FUNCTION(Datum) pgstrom_btint14cmp(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -845,9 +703,9 @@ pgstrom_btint14cmp(PG_FUNCTION_ARGS) else PG_RETURN_INT32(0); } -PG_FUNCTION_INFO_V1(pgstrom_btint14cmp); -Datum +PG_FUNCTION_INFO_V1(pgstrom_btint18cmp); +PUBLIC_FUNCTION(Datum) pgstrom_btint18cmp(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -860,9 +718,9 @@ pgstrom_btint18cmp(PG_FUNCTION_ARGS) else PG_RETURN_INT32(0); } -PG_FUNCTION_INFO_V1(pgstrom_btint18cmp); -Datum +PG_FUNCTION_INFO_V1(pgstrom_btint21cmp); +PUBLIC_FUNCTION(Datum) pgstrom_btint21cmp(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -875,9 +733,9 @@ pgstrom_btint21cmp(PG_FUNCTION_ARGS) else PG_RETURN_INT32(0); } -PG_FUNCTION_INFO_V1(pgstrom_btint21cmp); -Datum +PG_FUNCTION_INFO_V1(pgstrom_btint41cmp); +PUBLIC_FUNCTION(Datum) pgstrom_btint41cmp(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -890,9 +748,9 @@ pgstrom_btint41cmp(PG_FUNCTION_ARGS) else PG_RETURN_INT32(0); } -PG_FUNCTION_INFO_V1(pgstrom_btint41cmp); -Datum +PG_FUNCTION_INFO_V1(pgstrom_btint81cmp); +PUBLIC_FUNCTION(Datum) pgstrom_btint81cmp(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -905,40 +763,40 @@ pgstrom_btint81cmp(PG_FUNCTION_ARGS) else PG_RETURN_INT32(0); } -PG_FUNCTION_INFO_V1(pgstrom_btint81cmp); /* unary operators */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1up); +PUBLIC_FUNCTION(Datum) pgstrom_int1up(PG_FUNCTION_ARGS) { int8 arg = PG_GETARG_INT8(0); PG_RETURN_INT8(arg); } -PG_FUNCTION_INFO_V1(pgstrom_int1up); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1um); +PUBLIC_FUNCTION(Datum) pgstrom_int1um(PG_FUNCTION_ARGS) { int8 arg = PG_GETARG_INT8(0); PG_RETURN_INT8(-arg); } -PG_FUNCTION_INFO_V1(pgstrom_int1um); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1abs); +PUBLIC_FUNCTION(Datum) pgstrom_int1abs(PG_FUNCTION_ARGS) { int8 arg = PG_GETARG_INT8(0); PG_RETURN_INT8(arg < 0 ? -arg : arg); } -PG_FUNCTION_INFO_V1(pgstrom_int1abs); /* * Arithmetic operators */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1pl); +PUBLIC_FUNCTION(Datum) pgstrom_int1pl(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -951,9 +809,9 @@ pgstrom_int1pl(PG_FUNCTION_ARGS) errmsg("tinyint out of range"))); PG_RETURN_INT8(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int1pl); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1mi); +PUBLIC_FUNCTION(Datum) pgstrom_int1mi(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -966,9 +824,9 @@ pgstrom_int1mi(PG_FUNCTION_ARGS) errmsg("tinyint out of range"))); PG_RETURN_INT8(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int1mi); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1mul); +PUBLIC_FUNCTION(Datum) pgstrom_int1mul(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -981,9 +839,9 @@ pgstrom_int1mul(PG_FUNCTION_ARGS) errmsg("tinyint out of range"))); PG_RETURN_INT8(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int1mul); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1div); +PUBLIC_FUNCTION(Datum) pgstrom_int1div(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1008,9 +866,9 @@ pgstrom_int1div(PG_FUNCTION_ARGS) } PG_RETURN_INT8(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int1div); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1mod); +PUBLIC_FUNCTION(Datum) pgstrom_int1mod(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1025,9 +883,9 @@ pgstrom_int1mod(PG_FUNCTION_ARGS) /* no overflow is possible */ PG_RETURN_INT8(arg1 % arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1mod); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12pl); +PUBLIC_FUNCTION(Datum) pgstrom_int12pl(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1040,9 +898,9 @@ pgstrom_int12pl(PG_FUNCTION_ARGS) errmsg("smallint out of range"))); PG_RETURN_INT16(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int12pl); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12mi); +PUBLIC_FUNCTION(Datum) pgstrom_int12mi(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1055,9 +913,9 @@ pgstrom_int12mi(PG_FUNCTION_ARGS) errmsg("smallint out of range"))); PG_RETURN_INT16(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int12mi); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12mul); +PUBLIC_FUNCTION(Datum) pgstrom_int12mul(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1070,9 +928,9 @@ pgstrom_int12mul(PG_FUNCTION_ARGS) errmsg("smallint out of range"))); PG_RETURN_INT16(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int12mul); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int12div); +PUBLIC_FUNCTION(Datum) pgstrom_int12div(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1085,9 +943,9 @@ pgstrom_int12div(PG_FUNCTION_ARGS) /* no overflow is possible */ PG_RETURN_INT16((int16)arg1 / arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int12div); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14pl); +PUBLIC_FUNCTION(Datum) pgstrom_int14pl(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1100,9 +958,9 @@ pgstrom_int14pl(PG_FUNCTION_ARGS) errmsg("integer out of range"))); PG_RETURN_INT32(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int14pl); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14mi); +PUBLIC_FUNCTION(Datum) pgstrom_int14mi(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1115,9 +973,9 @@ pgstrom_int14mi(PG_FUNCTION_ARGS) errmsg("integer out of range"))); PG_RETURN_INT32(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int14mi); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14mul); +PUBLIC_FUNCTION(Datum) pgstrom_int14mul(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1130,9 +988,9 @@ pgstrom_int14mul(PG_FUNCTION_ARGS) errmsg("integer out of range"))); PG_RETURN_INT32(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int14mul); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int14div); +PUBLIC_FUNCTION(Datum) pgstrom_int14div(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1145,9 +1003,9 @@ pgstrom_int14div(PG_FUNCTION_ARGS) /* no overflow is possible */ PG_RETURN_INT32((int32)arg1 / arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int14div); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18pl); +PUBLIC_FUNCTION(Datum) pgstrom_int18pl(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1160,9 +1018,9 @@ pgstrom_int18pl(PG_FUNCTION_ARGS) errmsg("bigint out of range"))); PG_RETURN_INT64(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int18pl); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18mi); +PUBLIC_FUNCTION(Datum) pgstrom_int18mi(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1175,9 +1033,9 @@ pgstrom_int18mi(PG_FUNCTION_ARGS) errmsg("bigint out of range"))); PG_RETURN_INT64(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int18mi); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18mul); +PUBLIC_FUNCTION(Datum) pgstrom_int18mul(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1190,9 +1048,9 @@ pgstrom_int18mul(PG_FUNCTION_ARGS) errmsg("bigint out of range"))); PG_RETURN_INT64(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int18mul); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int18div); +PUBLIC_FUNCTION(Datum) pgstrom_int18div(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1205,9 +1063,9 @@ pgstrom_int18div(PG_FUNCTION_ARGS) /* no overflow is possible */ PG_RETURN_INT64((int64)arg1 / arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int18div); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21pl); +PUBLIC_FUNCTION(Datum) pgstrom_int21pl(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -1220,9 +1078,9 @@ pgstrom_int21pl(PG_FUNCTION_ARGS) errmsg("smallint out of range"))); PG_RETURN_INT16(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int21pl); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21mi); +PUBLIC_FUNCTION(Datum) pgstrom_int21mi(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -1235,9 +1093,9 @@ pgstrom_int21mi(PG_FUNCTION_ARGS) errmsg("smallint out of range"))); PG_RETURN_INT16(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int21mi); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21mul); +PUBLIC_FUNCTION(Datum) pgstrom_int21mul(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -1250,9 +1108,9 @@ pgstrom_int21mul(PG_FUNCTION_ARGS) errmsg("smallint out of range"))); PG_RETURN_INT16(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int21mul); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int21div); +PUBLIC_FUNCTION(Datum) pgstrom_int21div(PG_FUNCTION_ARGS) { int16 arg1 = PG_GETARG_INT16(0); @@ -1278,9 +1136,9 @@ pgstrom_int21div(PG_FUNCTION_ARGS) } PG_RETURN_INT16(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int21div); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41pl); +PUBLIC_FUNCTION(Datum) pgstrom_int41pl(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -1293,9 +1151,9 @@ pgstrom_int41pl(PG_FUNCTION_ARGS) errmsg("integer out of range"))); PG_RETURN_INT32(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int41pl); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41mi); +PUBLIC_FUNCTION(Datum) pgstrom_int41mi(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -1308,9 +1166,9 @@ pgstrom_int41mi(PG_FUNCTION_ARGS) errmsg("integer out of range"))); PG_RETURN_INT32(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int41mi); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41mul); +PUBLIC_FUNCTION(Datum) pgstrom_int41mul(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -1323,9 +1181,9 @@ pgstrom_int41mul(PG_FUNCTION_ARGS) errmsg("integer out of range"))); PG_RETURN_INT32(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int41mul); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int41div); +PUBLIC_FUNCTION(Datum) pgstrom_int41div(PG_FUNCTION_ARGS) { int32 arg1 = PG_GETARG_INT32(0); @@ -1350,9 +1208,9 @@ pgstrom_int41div(PG_FUNCTION_ARGS) } PG_RETURN_INT32(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int41div); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81pl); +PUBLIC_FUNCTION(Datum) pgstrom_int81pl(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -1365,9 +1223,9 @@ pgstrom_int81pl(PG_FUNCTION_ARGS) errmsg("bigint out of range"))); PG_RETURN_INT64(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int81pl); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81mi); +PUBLIC_FUNCTION(Datum) pgstrom_int81mi(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -1380,9 +1238,9 @@ pgstrom_int81mi(PG_FUNCTION_ARGS) errmsg("bigint out of range"))); PG_RETURN_INT64(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int81mi); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81mul); +PUBLIC_FUNCTION(Datum) pgstrom_int81mul(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -1395,9 +1253,9 @@ pgstrom_int81mul(PG_FUNCTION_ARGS) errmsg("bigint out of range"))); PG_RETURN_INT64(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int81mul); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int81div); +PUBLIC_FUNCTION(Datum) pgstrom_int81div(PG_FUNCTION_ARGS) { int64 arg1 = PG_GETARG_INT64(0); @@ -1422,12 +1280,12 @@ pgstrom_int81div(PG_FUNCTION_ARGS) } PG_RETURN_INT64(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int81div); /* * Bit operations */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1and); +PUBLIC_FUNCTION(Datum) pgstrom_int1and(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1435,9 +1293,9 @@ pgstrom_int1and(PG_FUNCTION_ARGS) PG_RETURN_INT8(arg1 & arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1and); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1or); +PUBLIC_FUNCTION(Datum) pgstrom_int1or(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1445,9 +1303,9 @@ pgstrom_int1or(PG_FUNCTION_ARGS) PG_RETURN_INT8(arg1 | arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1or); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1xor); +PUBLIC_FUNCTION(Datum) pgstrom_int1xor(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1455,18 +1313,18 @@ pgstrom_int1xor(PG_FUNCTION_ARGS) PG_RETURN_INT8(arg1 ^ arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1xor); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1not); +PUBLIC_FUNCTION(Datum) pgstrom_int1not(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); PG_RETURN_INT8(~arg1); } -PG_FUNCTION_INFO_V1(pgstrom_int1not); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1shl); +PUBLIC_FUNCTION(Datum) pgstrom_int1shl(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1474,9 +1332,9 @@ pgstrom_int1shl(PG_FUNCTION_ARGS) PG_RETURN_INT8(arg1 << arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1shl); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1shr); +PUBLIC_FUNCTION(Datum) pgstrom_int1shr(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1484,12 +1342,12 @@ pgstrom_int1shr(PG_FUNCTION_ARGS) PG_RETURN_INT8(arg1 >> arg2); } -PG_FUNCTION_INFO_V1(pgstrom_int1shr); /* * misc functions */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_cash_mul_int1); +PUBLIC_FUNCTION(Datum) pgstrom_cash_mul_int1(PG_FUNCTION_ARGS) { Cash arg1 = PG_GETARG_CASH(0); @@ -1502,9 +1360,9 @@ pgstrom_cash_mul_int1(PG_FUNCTION_ARGS) errmsg("money out of range"))); PG_RETURN_CASH(retval); } -PG_FUNCTION_INFO_V1(pgstrom_cash_mul_int1); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_mul_cash); +PUBLIC_FUNCTION(Datum) pgstrom_int1_mul_cash(PG_FUNCTION_ARGS) { int8 arg1 = PG_GETARG_INT8(0); @@ -1517,9 +1375,9 @@ pgstrom_int1_mul_cash(PG_FUNCTION_ARGS) errmsg("money out of range"))); PG_RETURN_CASH(retval); } -PG_FUNCTION_INFO_V1(pgstrom_int1_mul_cash); -Datum +PG_FUNCTION_INFO_V1(pgstrom_cash_div_int1); +PUBLIC_FUNCTION(Datum) pgstrom_cash_div_int1(PG_FUNCTION_ARGS) { Cash arg1 = PG_GETARG_CASH(0); @@ -1544,10 +1402,10 @@ pgstrom_cash_div_int1(PG_FUNCTION_ARGS) } PG_RETURN_CASH(retval); } -PG_FUNCTION_INFO_V1(pgstrom_cash_div_int1); /* aggregate functions */ -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_sum); +PUBLIC_FUNCTION(Datum) pgstrom_int1_sum(PG_FUNCTION_ARGS) { int64 newval; @@ -1566,9 +1424,9 @@ pgstrom_int1_sum(PG_FUNCTION_ARGS) } PG_RETURN_INT64(newval); } -PG_FUNCTION_INFO_V1(pgstrom_int1_sum); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_avg_accum); +PUBLIC_FUNCTION(Datum) pgstrom_int1_avg_accum(PG_FUNCTION_ARGS) { ArrayType *transarray = PG_GETARG_ARRAYTYPE_P(0); @@ -1608,9 +1466,9 @@ pgstrom_int1_avg_accum(PG_FUNCTION_ARGS) PG_RETURN_ARRAYTYPE_P(result); } } -PG_FUNCTION_INFO_V1(pgstrom_int1_avg_accum); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_avg_accum_inv); +PUBLIC_FUNCTION(Datum) pgstrom_int1_avg_accum_inv(PG_FUNCTION_ARGS) { ArrayType *transarray; @@ -1638,9 +1496,9 @@ pgstrom_int1_avg_accum_inv(PG_FUNCTION_ARGS) transvalues[1] -= ival; PG_RETURN_ARRAYTYPE_P(transarray); } -PG_FUNCTION_INFO_V1(pgstrom_int1_avg_accum_inv); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_var_accum); +PUBLIC_FUNCTION(Datum) pgstrom_int1_var_accum(PG_FUNCTION_ARGS) { int32 ival = (int32)PG_GETARG_INT8(1); @@ -1648,9 +1506,9 @@ pgstrom_int1_var_accum(PG_FUNCTION_ARGS) PG_GETARG_DATUM(1) = Int32GetDatum(ival); return int4_accum(fcinfo); } -PG_FUNCTION_INFO_V1(pgstrom_int1_var_accum); -Datum +PG_FUNCTION_INFO_V1(pgstrom_int1_var_accum_inv); +PUBLIC_FUNCTION(Datum) pgstrom_int1_var_accum_inv(PG_FUNCTION_ARGS) { int32 ival = (int32)PG_GETARG_INT8(1); @@ -1658,4 +1516,3 @@ pgstrom_int1_var_accum_inv(PG_FUNCTION_ARGS) PG_GETARG_DATUM(1) = Int32GetDatum(ival); return int4_accum_inv(fcinfo); } -PG_FUNCTION_INFO_V1(pgstrom_int1_var_accum_inv); diff --git a/src/xpu_common.h b/src/xpu_common.h index b46d0c3a5..f729e28cd 100644 --- a/src/xpu_common.h +++ b/src/xpu_common.h @@ -39,7 +39,7 @@ /* C++ */ #define INLINE_FUNCTION(RET_TYPE) static inline RET_TYPE #define STATIC_FUNCTION(RET_TYPE) static RET_TYPE -#define PUBLIC_FUNCTION(RET_TYPE) RET_TYPE +#define PUBLIC_FUNCTION(RET_TYPE) PGDLLEXPORT RET_TYPE #define KERNEL_FUNCTION(RET_TYPE) extern "C" RET_TYPE #define EXTERN_FUNCTION(RET_TYPE) extern "C" RET_TYPE #define EXTERN_DATA extern "C" @@ -49,7 +49,7 @@ /* C */ #define INLINE_FUNCTION(RET_TYPE) static inline RET_TYPE #define STATIC_FUNCTION(RET_TYPE) static RET_TYPE -#define PUBLIC_FUNCTION(RET_TYPE) RET_TYPE +#define PUBLIC_FUNCTION(RET_TYPE) PGDLLEXPORT RET_TYPE #define KERNEL_FUNCTION(RET_TYPE) RET_TYPE #define EXTERN_FUNCTION(RET_TYPE) extern RET_TYPE #define EXTERN_DATA extern