github.com/matrixorigin/matrixone@v1.2.0/cgo/mo.h (about) 1 /* 2 * Copyright 2021 Matrix Origin 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef _MO_H_ 18 #define _MO_H_ 19 20 #include <stdint.h> 21 #include <stdbool.h> 22 23 /* Bitmap ops */ 24 void Bitmap_Add(uint64_t *p, uint64_t pos); 25 void Bitmap_Remove(uint64_t *p, uint64_t pos); 26 bool Bitmap_Contains(uint64_t *p, uint64_t pos); 27 bool Bitmap_IsEmpty(uint64_t *p, uint64_t nbits); 28 uint64_t Bitmap_Count(uint64_t *p, uint64_t nbits); 29 void Bitmap_And(uint64_t *dst, uint64_t *a, uint64_t *b, uint64_t nbits); 30 void Bitmap_Or(uint64_t *dst, uint64_t *a, uint64_t *b, uint64_t nbits); 31 void Bitmap_Not(uint64_t *dst, uint64_t *a, uint64_t nbits); 32 33 /* vector arithmatics */ 34 int32_t SignedInt_VecAdd(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 35 int32_t UnsignedInt_VecAdd(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 36 int32_t Float_VecAdd(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 37 38 int32_t SignedInt_VecSub(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 39 int32_t UnsignedInt_VecSub(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 40 int32_t Float_VecSub(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 41 42 int32_t SignedInt_VecMul(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 43 int32_t UnsignedInt_VecMul(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 44 int32_t Float_VecMul(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 45 46 int32_t Float_VecDiv(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 47 int32_t Float_VecIntegerDiv(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 48 49 int32_t SignedInt_VecMod(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 50 int32_t UnsignedInt_VecMod(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 51 int32_t Float_VecMod(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t szof); 52 53 /* compare operator */ 54 int32_t Numeric_VecEq(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t type); 55 56 int32_t Numeric_VecNe(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t type); 57 58 int32_t Numeric_VecGt(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t type); 59 60 int32_t Numeric_VecGe(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t type); 61 62 int32_t Numeric_VecLt(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t type); 63 64 int32_t Numeric_VecLe(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag, int32_t type); 65 66 /* vector logical operation */ 67 int32_t Logic_VecAnd(void *r, void *a, void *b, uint64_t n, uint64_t *anulls, uint64_t *bnulls, uint64_t *rnulls, int32_t flag); 68 int32_t Logic_VecOr(void *r, void *a, void *b, uint64_t n, uint64_t *anulls, uint64_t *bnulls, uint64_t *rnulls, int32_t flag); 69 int32_t Logic_VecXor(void *r, void *a, void *b, uint64_t n, uint64_t *nulls, int32_t flag); 70 int32_t Logic_VecNot(void *r, void *a, uint64_t n, uint64_t *nulls, int32_t flag); 71 72 #endif /* _MO_H_ */