Changeset: 6d7549b05c69 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d7549b05c69 Modified Files: clients/Tests/exports.stable.out monetdb5/modules/atoms/blob.c monetdb5/modules/atoms/mtime.c Branch: mbedded Log Message:
merged diffs (truncated from 619 to 300 lines): diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -1575,18 +1575,18 @@ str MTIMEcurrent_time(daytime *ret); str MTIMEcurrent_timestamp(timestamp *ret); str MTIMEdate_add_msec_interval(date *ret, const date *v1, const lng *v2); str MTIMEdate_add_msec_interval_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEdate_add_msec_interval_bulk_p1(bat *ret, const date *src1, const bat *bid2); -str MTIMEdate_add_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *src2); +str MTIMEdate_add_msec_interval_bulk_p1(bat *ret, const date *restrict src1, const bat *bid2); +str MTIMEdate_add_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *restrict src2); str MTIMEdate_addmonths(date *ret, const date *v1, const int *v2); str MTIMEdate_addmonths_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEdate_addmonths_bulk_p1(bat *ret, const date *src1, const bat *bid2); -str MTIMEdate_addmonths_bulk_p2(bat *ret, const bat *bid1, const int *src2); +str MTIMEdate_addmonths_bulk_p1(bat *ret, const date *restrict src1, const bat *bid2); +str MTIMEdate_addmonths_bulk_p2(bat *ret, const bat *bid1, const int *restrict src2); str MTIMEdate_date(date *ret, const date *src); str MTIMEdate_date_bulk(bat *ret, const bat *bid); str MTIMEdate_diff(int *ret, const date *v1, const date *v2); str MTIMEdate_diff_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEdate_diff_bulk_p1(bat *ret, const date *src1, const bat *bid2); -str MTIMEdate_diff_bulk_p2(bat *ret, const bat *bid1, const date *src2); +str MTIMEdate_diff_bulk_p1(bat *ret, const date *restrict src1, const bat *bid2); +str MTIMEdate_diff_bulk_p2(bat *ret, const bat *bid1, const date *restrict src2); str MTIMEdate_extract_century(int *ret, const date *src); str MTIMEdate_extract_century_bulk(bat *ret, const bat *bid); str MTIMEdate_extract_day(int *ret, const date *src); @@ -1609,22 +1609,22 @@ str MTIMEdate_fromstr(date *ret, const s str MTIMEdate_fromstr_bulk(bat *ret, const bat *bid); str MTIMEdate_sub_msec_interval(date *ret, const date *v1, const lng *v2); str MTIMEdate_sub_msec_interval_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEdate_sub_msec_interval_bulk_p1(bat *ret, const date *src1, const bat *bid2); -str MTIMEdate_sub_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *src2); +str MTIMEdate_sub_msec_interval_bulk_p1(bat *ret, const date *restrict src1, const bat *bid2); +str MTIMEdate_sub_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *restrict src2); str MTIMEdate_submonths(date *ret, const date *v1, const int *v2); str MTIMEdate_submonths_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEdate_submonths_bulk_p1(bat *ret, const date *src1, const bat *bid2); -str MTIMEdate_submonths_bulk_p2(bat *ret, const bat *bid1, const int *src2); +str MTIMEdate_submonths_bulk_p1(bat *ret, const date *restrict src1, const bat *bid2); +str MTIMEdate_submonths_bulk_p2(bat *ret, const bat *bid1, const int *restrict src2); str MTIMEdate_to_str(str *ret, const date *v1, const str *v2); str MTIMEdate_to_str_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEdate_to_str_bulk_p1(bat *ret, const date *src1, const bat *bid2); +str MTIMEdate_to_str_bulk_p1(bat *ret, const date *restrict src1, const bat *bid2); str MTIMEdate_to_str_bulk_p2(bat *ret, const bat *bid1, const str *src2); str MTIMEdaytime_daytime(daytime *ret, const daytime *src); str MTIMEdaytime_daytime_bulk(bat *ret, const bat *bid); str MTIMEdaytime_diff_msec(lng *ret, const daytime *v1, const daytime *v2); str MTIMEdaytime_diff_msec_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEdaytime_diff_msec_bulk_p1(bat *ret, const daytime *src1, const bat *bid2); -str MTIMEdaytime_diff_msec_bulk_p2(bat *ret, const bat *bid1, const daytime *src2); +str MTIMEdaytime_diff_msec_bulk_p1(bat *ret, const daytime *restrict src1, const bat *bid2); +str MTIMEdaytime_diff_msec_bulk_p2(bat *ret, const bat *bid1, const daytime *restrict src2); str MTIMEdaytime_extract_hours(int *ret, const daytime *src); str MTIMEdaytime_extract_hours_bulk(bat *ret, const bat *bid); str MTIMEdaytime_extract_minutes(int *ret, const daytime *src); @@ -1664,24 +1664,24 @@ str MTIMEstr_to_timestamp_bulk_p1(bat *r str MTIMEstr_to_timestamp_bulk_p2(bat *ret, const bat *bid1, const str *src2); str MTIMEtime_add_msec_interval(daytime *ret, const daytime *v1, const lng *v2); str MTIMEtime_add_msec_interval_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEtime_add_msec_interval_bulk_p1(bat *ret, const daytime *src1, const bat *bid2); -str MTIMEtime_add_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *src2); +str MTIMEtime_add_msec_interval_bulk_p1(bat *ret, const daytime *restrict src1, const bat *bid2); +str MTIMEtime_add_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *restrict src2); str MTIMEtime_sub_msec_interval(daytime *ret, const daytime *v1, const lng *v2); str MTIMEtime_sub_msec_interval_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEtime_sub_msec_interval_bulk_p1(bat *ret, const daytime *src1, const bat *bid2); -str MTIMEtime_sub_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *src2); +str MTIMEtime_sub_msec_interval_bulk_p1(bat *ret, const daytime *restrict src1, const bat *bid2); +str MTIMEtime_sub_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *restrict src2); str MTIMEtime_to_str(str *ret, const daytime *v1, const str *v2); str MTIMEtime_to_str_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEtime_to_str_bulk_p1(bat *ret, const daytime *src1, const bat *bid2); +str MTIMEtime_to_str_bulk_p1(bat *ret, const daytime *restrict src1, const bat *bid2); str MTIMEtime_to_str_bulk_p2(bat *ret, const bat *bid1, const str *src2); str MTIMEtimestamp_add_month_interval(timestamp *ret, const timestamp *v1, const int *v2); str MTIMEtimestamp_add_month_interval_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEtimestamp_add_month_interval_bulk_p1(bat *ret, const timestamp *src1, const bat *bid2); -str MTIMEtimestamp_add_month_interval_bulk_p2(bat *ret, const bat *bid1, const int *src2); +str MTIMEtimestamp_add_month_interval_bulk_p1(bat *ret, const timestamp *restrict src1, const bat *bid2); +str MTIMEtimestamp_add_month_interval_bulk_p2(bat *ret, const bat *bid1, const int *restrict src2); str MTIMEtimestamp_add_msec_interval(timestamp *ret, const timestamp *v1, const lng *v2); str MTIMEtimestamp_add_msec_interval_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEtimestamp_add_msec_interval_bulk_p1(bat *ret, const timestamp *src1, const bat *bid2); -str MTIMEtimestamp_add_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *src2); +str MTIMEtimestamp_add_msec_interval_bulk_p1(bat *ret, const timestamp *restrict src1, const bat *bid2); +str MTIMEtimestamp_add_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *restrict src2); str MTIMEtimestamp_century(int *ret, const timestamp *src); str MTIMEtimestamp_century_bulk(bat *ret, const bat *bid); str MTIMEtimestamp_day(int *ret, const timestamp *src); @@ -1716,17 +1716,17 @@ str MTIMEtimestamp_sql_seconds(int *ret, str MTIMEtimestamp_sql_seconds_bulk(bat *ret, const bat *bid); str MTIMEtimestamp_sub_month_interval(timestamp *ret, const timestamp *v1, const int *v2); str MTIMEtimestamp_sub_month_interval_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEtimestamp_sub_month_interval_bulk_p1(bat *ret, const timestamp *src1, const bat *bid2); -str MTIMEtimestamp_sub_month_interval_bulk_p2(bat *ret, const bat *bid1, const int *src2); +str MTIMEtimestamp_sub_month_interval_bulk_p1(bat *ret, const timestamp *restrict src1, const bat *bid2); +str MTIMEtimestamp_sub_month_interval_bulk_p2(bat *ret, const bat *bid1, const int *restrict src2); str MTIMEtimestamp_sub_msec_interval(timestamp *ret, const timestamp *v1, const lng *v2); str MTIMEtimestamp_sub_msec_interval_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEtimestamp_sub_msec_interval_bulk_p1(bat *ret, const timestamp *src1, const bat *bid2); -str MTIMEtimestamp_sub_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *src2); +str MTIMEtimestamp_sub_msec_interval_bulk_p1(bat *ret, const timestamp *restrict src1, const bat *bid2); +str MTIMEtimestamp_sub_msec_interval_bulk_p2(bat *ret, const bat *bid1, const lng *restrict src2); str MTIMEtimestamp_timestamp(timestamp *ret, const timestamp *src); str MTIMEtimestamp_timestamp_bulk(bat *ret, const bat *bid); str MTIMEtimestamp_to_str(str *ret, const timestamp *v1, const str *v2); str MTIMEtimestamp_to_str_bulk(bat *ret, const bat *bid1, const bat *bid2); -str MTIMEtimestamp_to_str_bulk_p1(bat *ret, const timestamp *src1, const bat *bid2); +str MTIMEtimestamp_to_str_bulk_p1(bat *ret, const timestamp *restrict src1, const bat *bid2); str MTIMEtimestamp_to_str_bulk_p2(bat *ret, const bat *bid1, const str *src2); str MTIMEtimestamp_year(int *ret, const timestamp *src); str MTIMEtimestamp_year_bulk(bat *ret, const bat *bid); diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c --- a/monetdb5/modules/atoms/blob.c +++ b/monetdb5/modules/atoms/blob.c @@ -202,7 +202,7 @@ BLOBnitems_bulk(bat *ret, const bat *bid { BAT *b = NULL, *bn = NULL; BUN n, p, q; - int *dst; + int *restrict dst; str msg = MAL_SUCCEED; BATiter bi; @@ -218,7 +218,7 @@ BLOBnitems_bulk(bat *ret, const bat *bid dst = Tloc(bn, 0); bi = bat_iterator(b); BATloop(b, p, q) { - blob *next = BUNtvar(bi, p); + blob *restrict next = BUNtvar(bi, p); dst[p] = blob_nitems(next); } bn->tnonil = b->tnonil; diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c --- a/monetdb5/modules/atoms/mtime.c +++ b/monetdb5/modules/atoms/mtime.c @@ -68,18 +68,21 @@ MTIMEcurrent_timestamp(timestamp *ret) #define is_str_nil strNil -#define DEC_INT(INTYPE, VAR) INTYPE * VAR; - -#define INIT_INT(VAR, VAR_BAT) VAR = Tloc(VAR_BAT, 0); +#define DEC_VAR_R(TYPE, VAR) TYPE *restrict VAR -#define APPEND_INT(MALFUNC) dst[i] = res; +#define DEC_VAR(TYPE, VAR) TYPE * VAR -#define GET_NEXT_INT(VAR) VAR[i] +#define DEC_ITER(TYPE, VAR) BATiter VAR -#define DEC_STR(INTYPE, VAR) BATiter VAR; +#define INIT_VAR(VAR, VAR_BAT) VAR = Tloc(VAR_BAT, 0) + +#define APPEND_VAR(MALFUNC) dst[i] = res; -#define INIT_STR(VAR, VAR_BAT) VAR = bat_iterator(VAR_BAT); +#define GET_NEXT_VAR(VAR) VAR[i] + + +#define INIT_ITER(VAR, VAR_BAT) VAR = bat_iterator(VAR_BAT) #define APPEND_STR(MALFUNC) \ if (BUNappend(bn, res, false) != GDK_SUCCEED) { \ @@ -87,15 +90,15 @@ MTIMEcurrent_timestamp(timestamp *ret) break; \ } -#define GET_NEXT_STR(VAR) BUNtvar(VAR, i) +#define GET_NEXT_ITER(VAR) BUNtvar(VAR, i) #define DEC_NOTHING(A, B) ; #define COPYFLAGS do { bn->tsorted = b1->tsorted; bn->trevsorted = b1->trevsorted; } while (0) #define SETFLAGS do { bn->tsorted = bn->trevsorted = n < 2; } while (0) -#define func1(NAME, NAMEBULK, MALFUNC, INTYPE, OUTTYPE, FUNC, SETFLAGS, FUNC_CALL, DEC_INPUT, DEC_OUTPUT, \ - INIT_INPUT, INIT_OUTPUT, GET_NEXT_INPUT) \ +#define func1(NAME, NAMEBULK, MALFUNC, INTYPE, OUTTYPE, FUNC, SETFLAGS, FUNC_CALL, DEC_SRC, DEC_OUTPUT, \ + INIT_SRC, INIT_OUTPUT, GET_NEXT_SRC) \ mal_export str NAME(OUTTYPE *ret, const INTYPE *src); \ mal_export str NAMEBULK(bat *ret, const bat *bid); \ str \ @@ -112,7 +115,7 @@ NAMEBULK(bat *ret, const bat *bid) { \ BAT *b1 = NULL, *bn = NULL; \ BUN n; \ - DEC_INPUT(INTYPE, src1); \ + DEC_SRC(INTYPE, src1); \ DEC_OUTPUT(OUTTYPE, dst); \ str msg = MAL_SUCCEED; \ \ @@ -127,10 +130,10 @@ NAMEBULK(bat *ret, const bat *bid) SQLSTATE(HY013) MAL_MALLOC_FAIL); \ goto bailout; \ } \ - INIT_INPUT(src1, b1); \ + INIT_SRC(src1, b1); \ INIT_OUTPUT(dst, bn); \ for (BUN i = 0; i < n; i++) { \ - FUNC_CALL(FUNC, (dst[i]), (GET_NEXT_INPUT(src1))); \ + FUNC_CALL(FUNC, (dst[i]), (GET_NEXT_SRC(src1))); \ } \ bn->tnonil = b1->tnonil; \ bn->tnil = b1->tnil; \ @@ -150,12 +153,12 @@ bailout: \ #define func1_noexcept(FUNC, RET, PARAM) RET = FUNC(PARAM) #define func1_except(FUNC, RET, PARAM) msg = FUNC(&RET, PARAM); if (msg) break; -#define func2(NAME, NAMEBULK, MALFUNC, INTYPE1, INTYPE2, OUTTYPE, FUNC, FUNC_CALL, DEC_INPUT1, DEC_INPUT2, DEC_OUTPUT, \ - INIT_INPUT1, INIT_INPUT2, INIT_OUTPUT, GET_NEXT_INPUT1, GET_NEXT_INPUT2, APPEND_NEXT) \ +#define func2(NAME, NAMEBULK, MALFUNC, INTYPE1, INTYPE2, OUTTYPE, FUNC, FUNC_CALL, DEC_INPUT1, DEC_INPUT2, DEC_SRC1, DEC_SRC2, DEC_OUTPUT, \ + INIT_SRC1, INIT_SRC2, INIT_OUTPUT, GET_NEXT_SRC1, GET_NEXT_SRC2, APPEND_NEXT) \ mal_export str NAME(OUTTYPE *ret, const INTYPE1 *v1, const INTYPE2 *v2); \ mal_export str NAMEBULK(bat *ret, const bat *bid1, const bat *bid2); \ -mal_export str NAMEBULK##_p1(bat *ret, const INTYPE1 *src1, const bat *bid2); \ -mal_export str NAMEBULK##_p2(bat *ret, const bat *bid1, const INTYPE2 *src2); \ +mal_export str NAMEBULK##_p1(bat *ret, const DEC_INPUT1(INTYPE1, src1), const bat *bid2); \ +mal_export str NAMEBULK##_p2(bat *ret, const bat *bid1, const DEC_INPUT2(INTYPE2, src2)); \ str \ NAME(OUTTYPE *ret, const INTYPE1 *v1, const INTYPE2 *v2) \ { \ @@ -170,8 +173,8 @@ NAMEBULK(bat *ret, const bat *bid1, cons { \ BAT *b1 = NULL, *b2 = NULL, *bn = NULL; \ BUN n; \ - DEC_INPUT1(INTYPE1, src1); \ - DEC_INPUT2(INTYPE2, src2); \ + DEC_SRC1(INTYPE1, src1); \ + DEC_SRC2(INTYPE2, src2); \ DEC_OUTPUT(OUTTYPE, dst); \ str msg = MAL_SUCCEED; \ \ @@ -193,12 +196,12 @@ NAMEBULK(bat *ret, const bat *bid1, cons SQLSTATE(HY013) MAL_MALLOC_FAIL); \ goto bailout; \ } \ - INIT_INPUT1(src1, b1); \ - INIT_INPUT2(src2, b2); \ + INIT_SRC1(src1, b1); \ + INIT_SRC2(src2, b2); \ INIT_OUTPUT(dst, bn); \ for (BUN i = 0; i < n; i++) { \ OUTTYPE res; \ - FUNC_CALL(FUNC, (res), (GET_NEXT_INPUT1(src1)), (GET_NEXT_INPUT2(src2))); \ + FUNC_CALL(FUNC, (res), (GET_NEXT_SRC1(src1)), (GET_NEXT_SRC2(src2))); \ APPEND_NEXT(MALFUNC); \ } \ bn->tnonil = b1->tnonil & b2->tnonil; \ @@ -219,11 +222,11 @@ bailout: \ return msg; \ } \ str \ -NAMEBULK##_p1(bat *ret, const INTYPE1 *src1, const bat *bid2) \ +NAMEBULK##_p1(bat *ret, const DEC_INPUT1(INTYPE1, src1), const bat *bid2) \ { \ BAT *b2 = NULL, *bn = NULL; \ BUN n; \ - DEC_INPUT2(INTYPE2, src2); \ + DEC_SRC2(INTYPE2, src2); \ DEC_OUTPUT(OUTTYPE, dst); \ str msg = MAL_SUCCEED; \ \ @@ -238,11 +241,11 @@ NAMEBULK##_p1(bat *ret, const INTYPE1 *s SQLSTATE(HY013) MAL_MALLOC_FAIL); \ goto bailout; \ } \ - INIT_INPUT2(src2, b2); \ + INIT_SRC2(src2, b2); \ INIT_OUTPUT(dst, bn); \ for (BUN i = 0; i < n; i++) { \ OUTTYPE res; \ - FUNC_CALL(FUNC, (res), *src1, (GET_NEXT_INPUT2(src2))); \ + FUNC_CALL(FUNC, (res), *src1, (GET_NEXT_SRC2(src2))); \ APPEND_NEXT(MALFUNC); \ } \ bn->tnonil = !is_##INTYPE1##_nil(*src1) && b2->tnonil; \ @@ -261,11 +264,11 @@ bailout: \ return msg; \ } \ str \ -NAMEBULK##_p2(bat *ret, const bat *bid1, const INTYPE2 *src2) \ +NAMEBULK##_p2(bat *ret, const bat *bid1, const DEC_INPUT2(INTYPE2, src2)) \ { \ BAT *b1 = NULL, *bn = NULL; \ BUN n; \ - DEC_INPUT1(INTYPE1, src1); \ + DEC_SRC1(INTYPE1, src1); \ DEC_OUTPUT(OUTTYPE, dst); \ str msg = MAL_SUCCEED; \ \ @@ -280,11 +283,11 @@ NAMEBULK##_p2(bat *ret, const bat *bid1, SQLSTATE(HY013) MAL_MALLOC_FAIL); \ goto bailout; \ } \ - INIT_INPUT1(src1, b1); \ _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list