Compare commits

...

6 Commits

Author SHA1 Message Date
yangwenqing
d925e39299 add loongarch crc 2025-01-17 11:24:43 +08:00
yangwenqing
74051758db add lsx
add -mlsx to compile

add loonagrch_sx flag

fix some bugs

fix some bugs

fix some bugs
2025-01-15 18:29:48 +08:00
Xiaotian Wu
d827e9a1ee lsx on loongarch 2025-01-14 09:12:59 +08:00
Xiaotian Wu
338b65240a fix build 2025-01-14 09:12:50 +08:00
Xiaotian Wu
ef90c92c10 fix build 2025-01-14 09:04:06 +08:00
sdlaqz
7088f83a35 add loongarch patch 2025-01-13 17:19:17 +08:00
26 changed files with 284 additions and 30 deletions

View File

@ -367,9 +367,12 @@ if( ${ARCHITECTURE} STREQUAL "x86_64" )
set(ARCH_LDFLAGS "")
set(OCI_DEVEL_INC "${DEP_3RD_DIR}/usr/include/oracle/12.2/client64")
elseif( ${ARCHITECTURE} STREQUAL "loongarch64" )
set(MTUNE_CFLAGS "")
set(ARCH_LDFLAGS "")
set(OCI_DEVEL_INC "${DEP_3RD_DIR}/usr/include/oracle/12.2/client64")
set(MARCHE_CFLAGS "-march=loongarch64")
set(MTUNE_CFLAGS "-mabi=lp64d")
set(ARCH_LDFLAGS "-latomic")
set(ARCH_C_FLAGS "-mlsx")
set(ARCH_CXX_FLAGS "-mlsx")
set(CMAKE_REQUIRED_FLAGS "${ARCH_C_FLAGS}")
else()
if (${OB_DISABLE_LSE})
message(STATUS "build with no-lse")

View File

@ -88,7 +88,7 @@ static __inline__ void easy_spin_lock(easy_atomic_t *lock)
#elif defined(__aarch64__)
__asm__ ("yield"); // for ARM
#elif defined(__loongarch_lp64)
__asm__ ("ibar 0"); // for ARM
__asm__ ("ibar 0"); // for LOONGARCH
#else
#error arch unsupported
#endif
@ -148,6 +148,8 @@ static __inline__ int easy_spinrwlock_rdlock(easy_spinrwlock_t *lock)
asm("pause");
#elif defined(__aarch64__)
asm("yield"); // for ARM
#elif defined(__loongarch_lp64)
__asm__ ("ibar 0"); // for LOONGARCH
#else
#error arch unsupported
#endif
@ -189,6 +191,8 @@ static __inline__ int easy_spinrwlock_wrlock(easy_spinrwlock_t *lock)
asm("pause");
#elif defined(__aarch64__)
asm("yield"); // for ARM
#elif defined(__loongarch_lp64)
__asm__ ("ibar 0"); // for LOONGARCH64
#else
#error arch unsupported
#endif

View File

@ -451,7 +451,6 @@ static int easy_ssl_handshake(easy_connection_t *c)
return EASY_OK;
}
#endif
sslerr = SSL_get_error(c->sc->connection, n);
easy_debug_log("SSL_get_error: %d %s errno=%d", sslerr, easy_connection_str(c), errno);

View File

@ -531,6 +531,8 @@ EV_CPP(extern "C" {
#define ev_mb() __asm__ __volatile ("mfence" ::: "memory")
#elif defined(__aarch64__)
#define ev_mb() __asm__ __volatile ("dsb sy" ::: "memory") //for ARM
#elif defined(__loongarch_lp64)
#define ev_mb() __asm__ __volatile ("dbar 0" ::: "memory") //for LOONGARCH
#else
#error arch unsupported
#endif

View File

@ -135,6 +135,25 @@ static __inline__ uint64_t rdtscp()
__asm__ __volatile__("rdtscp" : "=a"(rax), "=d"(rdx) :: "%rcx");
return (rdx << 32) + rax;
}
#endif
#if defined(__loongarch_lp64)
static __inline__ uint64_t rdtsc()
{
int rID;
uint64_t val;
__asm__ __volatile__(
"rdtime.d %0, %1 \n\t"
: "=r"(val), "=r"(rID)
:
);
return val;
}
static __inline__ uint64_t rdtscp()
{
return rdtscp();
}
#else
static __inline__ uint64_t rdtscp()
{
@ -149,7 +168,7 @@ static __inline__ uint64_t rdtsc()
#endif
#if defined(__x86_64__)
#if defined(__x86_64__) || defined(__loongarch_lp64)
// 读取cpu频率
uint64_t get_cpufreq_khz()
{

View File

@ -19,8 +19,20 @@ static inline cycles_t easy_get_cycles()
return val;
}
#else
#elif defined(__loongarch_lp64)
static inline cycles_t easy_get_cycles()
{
int rID;
unsigned long long val;
__asm__ __volatile__(
"rdtime.d %0, %1 \n\t"
: "=r"(val), "=r"(rID)
:
);
return val;
}
#else
static inline uint64_t easy_rdtscp()
{
int64_t virtual_timer_value;

View File

@ -40,6 +40,11 @@ function compat_alinux3() {
OS_RELEASE=8
}
function compat_loongnix8() {
echo_log "[NOTICE] '$PNAME' is compatible with LoongnixServer 8, use lns8 dependencies list"
OS_RELEASE=8
}
function not_supported() {
echo_log "[ERROR] '$PNAME' is not supported yet."
}
@ -158,9 +163,21 @@ function get_os_release() {
esac
elif [[ "${OS_ARCH}x" == "loongarch64x" ]]; then
case "$ID" in
arch)
compat_centos8 && return
;;
loongnix-server)
version_ge "23" && compat_loongnix8 && return
;;
loongnix-server)
version_ge "8.0" && compat_loongnix8 && return
;;
anolis)
version_ge "8.0" && compat_loongnix8 && return
;;
kylin)
version_ge "V10" && compat_loongnix8 && return
;;
uos)
version_ge "20" && compat_loongnix8 && return
;;
esac
fi
not_supported && return 1
@ -174,6 +191,11 @@ else
OS_TAG="el$OS_RELEASE.$OS_ARCH"
fi
if [[ "${OS_ARCH}x" == "loongarch64x" ]]; then
OS_TAG="lns$OS_RELEASE.$OS_ARCH"
else
OS_TAG="el$OS_RELEASE.$OS_ARCH"
fi
DEP_FILE="oceanbase.${OS_TAG}.deps"
MD5=`md5sum ${DEP_FILE} | cut -d" " -f1`
@ -235,7 +257,7 @@ if [ $NEED_SHARE_CACHE == "OFF" ]; then
fi
# 删除本地依赖文件
rm -rf ${WORKSPACE_DEPS_3RD}
#rm -rf ${WORKSPACE_DEPS_3RD}
if [ ${NEED_SHARE_CACHE} == "ON" ]; then
# 判断共享目录是否存在

View File

@ -0,0 +1,64 @@
[target-default]
os=8
arch=x86_64
repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/8/x86_64/
[target-community]
os=8
arch=x86_64
repo=http://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/
[deps]
devdeps-gtest-1.8.0-132022101316.el8.x86_64.rpm
devdeps-isa-l-static-2.22.0-22022092915.el8.x86_64.rpm
devdeps-libcurl-static-8.2.1-172023092015.el8.x86_64.rpm
devdeps-libunwind-static-1.6.2-222022100410.el8.x86_64.rpm
devdeps-mariadb-connector-c-3.1.12-12022100422.el8.x86_64.rpm
devdeps-libaio-0.3.112-12022092915.el8.x86_64.rpm
devdeps-relaxed-rapidjson-1.0.0-52023011719.el8.x86_64.rpm
devdeps-openssl-static-1.1.1u-22023100710.el8.x86_64.rpm
devdeps-libxml2-2.10.4-42023082915.el8.x86_64.rpm
devdeps-mxml-2.12.0-12022090616.el8.x86_64.rpm
devdeps-apr-1.6.5-32022090616.el8.x86_64.rpm
devdeps-xz-5.2.2-42022090615.el8.x86_64.rpm
devdeps-lua-5.4.6-22023082916.el8.x86_64.rpm
devdeps-oss-c-sdk-3.11.2-42024100915.el8.x86_64.rpm
devdeps-zlib-static-1.2.13-82024102414.el8.x86_64.rpm
devdeps-ncurses-static-6.2-72022100815.el8.x86_64.rpm
devdeps-boost-1.74.0-22022110914.el8.x86_64.rpm
devdeps-abseil-cpp-20211102.0-62024122014.el8.x86_64.rpm
devdeps-s2geometry-0.10.0-122024122617.el8.x86_64.rpm
devdeps-icu-69.1-72022112416.el8.x86_64.rpm
devdeps-cos-c-sdk-5.0.21-202024080916.el8.x86_64.rpm
devdeps-s3-cpp-sdk-1.11.156-102023122011.el8.x86_64.rpm
devdeps-protobuf-c-1.4.1-100000062023102016.el8.x86_64.rpm
devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.x86_64.rpm
devdeps-apache-arrow-9.0.0-172024052218.el8.x86_64.rpm
devdeps-hyperscan-5.4.2-242024090219.el8.x86_64.rpm
devdeps-apache-orc-1.8.3-392024091317.el8.x86_64.rpm
devdeps-vsag-1.0.0-392024120610.el8.x86_64.rpm
devdeps-cloud-qpl-1.1.0-272023061419.el8.x86_64.rpm
devdeps-fast-float-6.1.3-42024112122.el8.x86_64.rpm
[tools]
obdevtools-binutils-2.30-12022100413.el8.x86_64.rpm
obdevtools-bison-2.4.1-12022100413.el8.x86_64.rpm
obdevtools-ccache-3.7.12-12022100417.el8.x86_64.rpm
obdevtools-cmake-3.30.3-52024111819.el8.x86_64.rpm
obdevtools-flex-2.5.35-12022100417.el8.x86_64.rpm
obdevtools-gcc9-9.3.0-52022092914.el8.x86_64.rpm cpp_standard=11
obdevtools-gcc-12.3.0-32024122017.el8.x86_64.rpm cpp_standard=20
obdevtools-llvm-11.0.1-312022092921.el8.x86_64.rpm cpp_standard=11
obdevtools-llvm-17.0.3-232024111415.el8.x86_64.rpm cpp_standard=20
[tools-deps]
devdeps-oblogmsg-1.1-52024052811.el8.x86_64.rpm
devdeps-rocksdb-6.22.1-32024123015.el8.x86_64.rpm
obstack-2.0.4-172024070513.el8.x86_64.rpm
obshell-4.2.5.0-12024121011.el8.x86_64.rpm target=community
[test-utils]
ob-deploy-3.0.1-1.el8.x86_64.rpm target=community
obclient-2.2.2-1.el8.x86_64.rpm target=community
libobclient-2.2.2-3.el8.x86_64.rpm target=community

View File

@ -119,13 +119,15 @@ if (OB_USE_CLANG)
set(OBLIB_COMPILE_DEFINITIONS -fno-strict-aliasing -fno-omit-frame-pointer ${MARCH_CFLAGS} ${MTUNE_CFLAGS}
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_NO_EXCEPTION -DTSI_STATIC_SUM
-DOCI_LINK_RUNTIME
-Wall -Wextra -Wformat -Werror
-Wall -Wextra -Wformat -Werror -mlsx
-Wno-deprecated -Wno-address-of-packed-member -Wno-sign-compare -Wno-tautological-compare
-Wno-psabi -Wno-c99-designator -Wno-int-in-bool-context -Wno-sizeof-array-div
-Wno-implicit-const-int-float-conversion -Wno-fortify-source -Wno-non-c-typedef-for-linkage
-Wno-uninitialized-const-reference -Wno-unused-function -Wno-atomic-alignment
# -Wno-psabi -Wno-c99-designator -Wno-int-in-bool-context -Wno-sizeof-array-div
# -Wno-implicit-const-int-float-conversion -Wno-fortify-source -Wno-non-c-typedef-for-linkage
# -Wno-uninitialized-const-reference -Wno-unused-function -Wno-atomic-alignment
-Wno-unused-function -Wno-atomic-alignment #loongarch?
-Wno-tautological-constant-out-of-range-compare -Wno-unused-parameter
-Wno-string-plus-int -Wno-misleading-indentation -Wno-unused-private-field
# -Wno-string-plus-int -Wno-misleading-indentation -Wno-unused-private-field
-Wno-string-plus-int -Wno-unused-private-field #loongarch?
$<$<COMPILE_LANGUAGE:CXX>:-Wno-overloaded-virtual -Wno-reserved-user-defined-literal
-Wno-self-assign -Wno-inconsistent-missing-override -Wno-mismatched-tags -Wno-unused-variable
-Wno-invalid-offsetof -Wno-unevaluated-expression -Wno-constant-logical-operand>
@ -171,7 +173,8 @@ else()
-fno-strict-aliasing -fno-omit-frame-pointer ${MARCH_CFLAGS} ${MTUNE_CFLAGS}
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_NO_EXCEPTION
-DOCI_LINK_RUNTIME
-Wall -Wextra -Wformat -Werror
-Wall -Wextra -Wformat -Werror #loongarch?
-mlsx
-Wno-deprecated
-Wno-sign-compare
-Wno-psabi

View File

@ -711,6 +711,8 @@ struct signalfd_siginfo
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("")
#elif defined __ia64__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mf" : : : "memory")
#elif defined __loongarch_lp64
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dbar 0" : : : "memory")
#elif defined __m68k__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory")
#elif defined __m88k__

View File

@ -110,6 +110,41 @@ inline bool cas128_lf(types::uint128_t *dst, types::uint128_t & expected, types
#define CAS128(src, cmp, with) cas128_lf(((types::uint128_t*)(src)), *((types::uint128_t*)&(cmp)), *((types::uint128_t*)&(with)))
#define LOAD128(dest, src) load128_lf((types::uint128_t&)(dest), (types::uint128_t*)(src))
#elif defined(__loongarch_lp64)
inline bool cas128(volatile types::uint128_t* target, types::uint128_t* cmp, types::uint128_t with)
{
int ret = 0;
types::uint128_t tmp;
tmp.lo = cmp->lo;
tmp.hi = cmp->hi;
ret = __atomic_compare_exchange((types::uint128_t*)(target),
((types::uint128_t*)&(tmp)),
((types::uint128_t*)&(with)),
false,
__ATOMIC_SEQ_CST,
__ATOMIC_SEQ_CST);
return ret;
}
inline void load128(__uint128_t& target, types::uint128_t* source)
{
__uint128_t* ptr = reinterpret_cast<__uint128_t*>(&target);
__uint128_t* desired = reinterpret_cast<__uint128_t*>(source);
__atomic_load((__uint128_t*)desired, ptr, __ATOMIC_SEQ_CST);
}
#define CAS128_tmp(src, cmp, with) \
cas128((types::uint128_t*)(src), ((types::uint128_t*)(&(cmp))), *((types::uint128_t*)(&(with))))
#define LOAD128_asm(dest, src) load128((__uint128_t&)(dest), ((types::uint128_t*)(src)))
#define CAS128(src, cmp, with) \
__atomic_compare_exchange(((types::uint128_t*)(src)), \
((types::uint128_t*)(&(cmp))), \
((types::uint128_t*)&(with)), \
false, \
__ATOMIC_SEQ_CST, \
__ATOMIC_SEQ_CST)
#define LOAD128(dest, src) __atomic_load(((types::uint128_t*)(src)), ((types::uint128_t*)(&(dest))), __ATOMIC_SEQ_CST)
#else
#error arch unsupported
#endif

View File

@ -32,7 +32,7 @@ namespace common
#define PAUSE() ({OB_ATOMIC_EVENT(atomic_pause); asm("yield\n");}) // for ARM
#elif defined(__loongarch_lp64)
#define WEAK_BARRIER() __sync_synchronize()
#define PAUSE() ({OB_ATOMIC_EVENT(atomic_pause); asm("dbar 0\n");}) // for ARM
#define PAUSE() ({OB_ATOMIC_EVENT(atomic_pause); asm("dbar 0\n");}) // for LOONGARCH
#else
#error arch unsupported
#endif

View File

@ -421,6 +421,10 @@ for RHEL4 support (GCC 3 doesn't support this instruction) */
#define crc32_sse42_quadword crc = __crc32cd(crc, *(int64_t*)buf); len -= 8, buf += 8
#define crc32_sse42_byte crc = __crc32cb(crc, (uint8_t)*buf); len--, buf++
#endif /* defined(__GNUC__) && defined(__x86_64__) */
#elif defined(__loongarch64) //loongarch?
#include "larchintrin.h"
#define crc32_sse42_byte crc = __crcc_w_b_w((uint8_t)*buf, crc); len--, buf++
#define crc32_sse42_quadword crc = __crcc_w_d_w(*(int64_t)buf, crc); len -= 8, buf += 8
uint64_t crc64_sse42(uint64_t uCRC64, const char* buf, int64_t len)
{
@ -1147,6 +1151,9 @@ uint64_t crc64_sse42_dispatch(uint64_t crc, const char *buf, int64_t len)
ob_crc64_sse42_func = &fast_crc64_sse42_manually;
_OB_LOG(INFO, "Use manual crc32 table lookup for crc64 calculate");
#endif
#elif defined(__loongarch64)
ob_crc64_sse42_func = &fast_crc64_sse42_manually;
_OB_LOG(INFO, "Use manual crc32 table lookup for crc64 calculate");
#else
#error arch unsupported
#endif

View File

@ -5,7 +5,6 @@
#include "ob_fast_delta.h"
#include "ob_sse_to_neon.h"
namespace oceanbase
{
namespace common

View File

@ -20,6 +20,68 @@
#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
/* GCC-compatible compiler, targeting x86/x86-64 */
#include <x86intrin.h>
#elif defined(__GNUC__) && defined(__loongarch_lp64)
#include <lsxintrin.h>
// sse instruct to loongarch lsx instruct mapping
#define __m128i v4u32
// arithmetic
#define _mm_sub_epi32(a, b) __lsx_vsub_w((a), (b))
#define _mm_add_epi32(a, b) __lsx_vadd_w((a), (b))
//store
#define _mm_storeu_si128(p, a) __lsx_vst(a, (uint32_t *)(p), 0)
//load
#define _mm_loadu_si128(p) __lsx_vld((const uint32_t *)(p),0)
#define _mm_load_si128(p) __lsx_vld((const uint32_t *)(p),0)
#define _mm_lddqu_si128(p) __lsx_vld((const uint32_t *)(p),0)
// others
// emits the Supplemental Streaming SIMD Extensions 3 (SSSE3) instruction palignr to extract a 128-bit byte aligned value.1
static __attribute__((always_inline)) __m128i case_alignr_vectors(v16u8 a, v16u8 b, int ralign) {
uint8_t index_shuf[16];
for(int i = 0; i < 16; i++) {
index_shuf[i] = (uint8_t)ralign;
ralign += 1;
}
v16u8 index = __lsx_vld((uint8_t *)index_shuf, 0);
return __lsx_vshuf_b(b, a, index);
}
#define _mm_alignr_epi8(a, b, ralign) case_alignr_vectors(b, a, ralign)
// insert or extract
// emits the Streaming SIMD Extensions 4 (SSE4) instruction pextrd. This instruction extracts a 32-bit value from a 128 bit parameter.
#define _mm_extract_epi32(a, ndx) __lsx_vpickve2gr_wu(a, ndx)
// set
#define _mm_set1_epi32(u) __lsx_vreplgr2vr_w(u)
#define _mm_set1_epi16(w) (__m128i)__lsx_vreplgr2vr_h(w)
// shift
#define _mm_slli_si128(a, imm) (__m128i)((imm)<1?(a):((imm)>15?__lsx_vreplgr2vr_b(0):case_alignr_vectors(__lsx_vreplgr2vr_b(0), (v16u8)(a), 16-(imm)))) // vextq_u8: __constrange(0-15)
#define _mm_slli_epi16(a, count) (__m128i)__lsx_vsll_h((v8u16)(a), __lsx_vreplgr2vr_h((count)))
#define _mm_srli_epi16(a, count) (__m128i)__lsx_vsrl_h((v8u16)(a), __lsx_vreplgr2vr_h((count)))
#define _mm_slli_epi32(a, count) (__m128i)__lsx_vsll_w((v4u32)(a), __lsx_vreplgr2vr_w((count)))
#define _mm_srli_epi32(a, count) (__m128i)__lsx_vsrl_w((v4u32)(a), __lsx_vreplgr2vr_b((count)))
// logical
#define _mm_or_si128(a, b) (__m128i)__lsx_vor_v((a), (b))
#define _mm_and_si128(a, b) (__m128i)__lsx_vand_v((a), (b))
// Shuffles the 4 signed or unsigned 32-bit integers in a as specified by imm.
#define _mm_shuffle_epi32(a, imm) ({ const __m128i _av =a;\
__m128i _v = __lsx_vinsgr2vr_w(__lsx_vreplgr2vr_b(0), __lsx_vpickve2gr_wu(_av, (imm) & 0x3), 0);\
_v = __lsx_vinsgr2vr_w(_v, __lsx_vpickve2gr_wu(_av, ((imm) >> 2) & 0x3), 1);\
_v = __lsx_vinsgr2vr_w(_v, __lsx_vpickve2gr_wu(_av, ((imm) >> 4) & 0x3), 2);\
_v = __lsx_vinsgr2vr_w(_v, __lsx_vpickve2gr_wu(_av, ((imm) >> 6) & 0x3), 3); _v;\
})
#elif defined(__GNUC__) && defined(__ARM_NEON)
/* GCC-compatible compiler, targeting ARM with NEON */

View File

@ -102,6 +102,12 @@ union ObHeadNode
#define FREELIST_VERSION(x) ((static_cast<intptr_t>((x).data_)) >> 48)
#define SET_FREELIST_POINTER_VERSION(x,p,v) \
(x).data_ = (((reinterpret_cast<intptr_t>(p))&0x0000FFFFFFFFFFFFULL) | (((v)&0xFFFFULL) << 48))
#elif defined(__loongarch_lp64)
#define FREELIST_POINTER(x) (reinterpret_cast<void*>((((static_cast<intptr_t>((x).data_)) << 16) >> 16) | \
(((~(((static_cast<intptr_t>((x).data_)) << 16 >> 63) - 1)) >> 48) << 48))) // sign extend
#define FREELIST_VERSION(x) ((static_cast<intptr_t>((x).data_)) >> 48)
#define SET_FREELIST_POINTER_VERSION(x, p, v) \
(x).data_ = (((reinterpret_cast<intptr_t>(p)) & 0x0000FFFFFFFFFFFFULL) | (((v)&0xFFFFULL) << 48))
#else
#error "unsupported processor"
#endif

View File

@ -1921,6 +1921,8 @@ const int32_t OB_MAX_SYS_BKGD_THREAD_NUM = 64;
const int64_t OB_MAX_CPU_NUM = 64;
#elif __aarch64__
const int64_t OB_MAX_CPU_NUM = 128;
#elif __loongarch_lp64
const int64_t OB_MAX_CPU_NUM = 128;
#endif
const int64_t OB_MAX_STATICS_PER_TABLE = 128;

View File

@ -613,7 +613,7 @@ for (__typeof__((c).at(0)) *it = ((extra_condition) && (c).count() > 0 ? &(c).at
#elif __aarch64__
#define CACHE_ALIGN_SIZE 128
#elif __loongarch_lp64
#define CACHE_ALIGN_SIZE 64
#define CACHE_ALIGN_SIZE 128
#endif
#define CACHE_ALIGNED __attribute__((aligned(CACHE_ALIGN_SIZE)))

View File

@ -570,6 +570,8 @@ inline bool is_cpu_support_sse42()
return 0 != (data & CPUID_STD_SSE4_2);
#elif defined(__aarch64__)
return 0;
#elif defined(__loongarch_lp64)
return 0;
#else
#error arch unsupported
#endif

View File

@ -18,6 +18,9 @@
#define SPIN_PAUSE() asm("pause\n")
#elif defined(__aarch64__)
#define SPIN_PAUSE() asm("yield\n")
#elif defined(__loongarch_lp64)
#define SPIN_PAUSE() asm ("dbar 0");
//#define SPIN_PAUSE() do {__asm__ __volatile__ ("dbar 0" ::: "memory");} while (1);
#endif
#define LOAD(x) __atomic_load_n((x), __ATOMIC_ACQUIRE)

View File

@ -152,6 +152,7 @@ if (OB_STRICT_COMPILE_FLAGS)
target_compile_options(obcdc_objects PRIVATE)
else()
target_compile_options(obcdc_objects PRIVATE -Werror)
#target_compile_options(obcdc_objects PRIVATE -Werror) loongarch?
endif()
if (OB_SO_CACHE)
add_library(obcdc SHARED IMPORTED GLOBAL)

View File

@ -9,7 +9,7 @@ project(objit
message(FATAL_ERROR "DEP_3RD_DIR not set")
endif()
set(LLVM_DIR "${DEP_3RD_DIR}/usr/local/oceanbase/devtools/lib/cmake/llvm")
set(LLVM_DIR "/usr/lib/llvm-18/lib/cmake/llvm")
find_package(LLVM REQUIRED CONFIG)
include(cmake/libutils.cmake)
@ -29,6 +29,8 @@ add_definitions(-g -O2 -frtti)
# that we wish to use
if( ${ARCHITECTURE} STREQUAL "x86_64" )
LLVM_MAP_COMPONENTS_TO_LIBNAMES(llvm_libs Support Core IRReader ExecutionEngine OrcJit McJit X86CodeGen X86AsmParser runtimedyld bitreader bitwriter object objectyaml target DebugInfoDWARF Symbolize)
elseif( ${ARCHITECTURE} STREQUAL "loongarch64" )
LLVM_MAP_COMPONENTS_TO_LIBNAMES(llvm_libs Support Core IRReader ExecutionEngine OrcJit McJit LoongArchCodeGen LoongArchAsmParser runtimedyld bitreader bitwriter object objectyaml target DebugInfoDWARF Symbolize)
else()
LLVM_MAP_COMPONENTS_TO_LIBNAMES(llvm_libs Support Core IRReader ExecutionEngine OrcJit McJit AArch64CodeGen AArch64AsmParser runtimedyld bitreader bitwriter object objectyaml target DebugInfoDWARF Symbolize)
endif()

View File

@ -543,6 +543,7 @@ else()
${ob_close_modules_static_name}
-Wl,--no-whole-archive
-static-libgcc -static-libstdc++
# -lgcc -lstdc++ loongarch?
objit)
endif()
@ -581,7 +582,7 @@ target_link_libraries(observer_without_bolt
ob_storage_static
ob_share_static
${ob_close_modules_static_name}
# -lgcc
# -lgcc loongarch?
# -lstdc++
# ${link_malloc_hook}
# ${LGPL_DEPS}

View File

@ -15,7 +15,8 @@
#include "ob_pl_stmt.h"
#ifdef CPP_STANDARD_20
// loongarch?
#ifdef CPP_STANDARD_20
#include "lib/clang/17/include/unwind.h"
#else
#include "lib/clang/11.0.1/include/unwind.h"

View File

@ -888,7 +888,9 @@
#define ER_AES_INVALID_IV 1882
#define ER_PLUGIN_CANNOT_BE_UNINSTALLED 1883
#define ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP 1884
#if !defined(ER_ERROR_LAST)
#define ER_ERROR_LAST 1884
#endif
#define ER_TOO_SMALL_SCALE 1885
#define ER_TOO_SMALL_PRECISION 1886
#define ER_OVERSIZE_NEED_RETRY 1887
@ -925,9 +927,6 @@
#define ER_INCORRECT_TYPE 3064
#define ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION 3122
#define ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED 3134
#if !defined(ER_ACCOUNT_HAS_BEEN_LOCKED)
# define ER_ACCOUNT_HAS_BEEN_LOCKED 3118
#endif
#define ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN 3105
#define ER_DEPENDENT_BY_GENERATED_COLUMN 3108
@ -956,9 +955,13 @@
#define ER_UNSUPPORTED_FK_SET_NULL_ON_GENERATED_COLUMN 3104
#define ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN 3105
#if !defined(ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN)
#define ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN 3106
#endif
#define ER_DEPENDENT_BY_GENERATED_COLUMN 3108
#if !defined(ER_ACCOUNT_HAS_BEEN_LOCKED)
#define ER_ACCOUNT_HAS_BEEN_LOCKED 3118
#endif
#define ER_USER_ALREADY_EXISTS 3163
#define ER_TOO_BIG_ENUM 3504
#define ER_TOO_LONG_SET_ENUM_VALUE 3505

View File

@ -56,7 +56,7 @@ extern int easy_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
%}
%destructor {destroy_tree($$);}<node>
%destructor {oceanbase::common::ob_free($$);}<str_value_>
//%destructor {oceanbase::common::ob_free($$);}<str_value_>
%token <node> NAME_OB
%token <node> STRING_VALUE
@ -124,7 +124,7 @@ extern int easy_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
%left AND AND_OP
%left BETWEEN CASE WHEN THEN ELSE
%nonassoc LOWER_THAN_COMP
%left COMP_EQ COM P_NSEQ COMP_GE COMP_GT COMP_LE COMP_LT COMP_NE IS LIKE IN REGEXP SOUNDS
%left COMP_EQ COMP_NSEQ COMP_GE COMP_GT COMP_LE COMP_LT COMP_NE IS LIKE IN REGEXP SOUNDS
%nonassoc STRING_VALUE
%right ESCAPE /*for conflict for escape*/
%left '|'
@ -11271,11 +11271,11 @@ NAME_OB
{
$$ = $1;
}
| name_list NAME_OB %prec COMMA
| name_list NAME_OB %prec LOWER_COMMA
{
malloc_non_terminal_node($$, result->malloc_pool_, T_LINK_NODE, 2, $1, $2);
}
| name_list ',' NAME_OB %prec COMMA
| name_list ',' NAME_OB %prec LOWER_COMMA
{
malloc_non_terminal_node($$, result->malloc_pool_, T_LINK_NODE, 2, $1, $3);
}