Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LoongArch64 support #192

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ if [ -z "$os" ]; then
Linux*riscv64*)
os=Linux64-nonx86-gcc-dynamic
;;
Linux*loongarch64*)
os=Linux64-nonx86-gcc-dynamic
;;
Darwin*)
os=Darwin-clang-dynamic
;;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/geogram/basic/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ namespace GEO {
# error "Unsupported compiler"
#endif

#if defined(__x86_64) || defined(__ppc64__) || defined(__arm64__) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64)
#if defined(__x86_64) || defined(__ppc64__) || defined(__arm64__) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64) || defined(__loongarch_lp64)
# define GEO_ARCH_64
#else
# define GEO_ARCH_32
Expand Down
9 changes: 8 additions & 1 deletion src/lib/third_party/numerics/LIBF2C/libf2c_uninit.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,14 @@ which we want*/
__fpu_control |= (1 << 2); // OF
__fpu_control |= (1 << 3); // UF
_FPU_SETCW(__fpu_control);
#else /* !(mc68000||powerpc||riscv) */

#elif (defined (__loongarch__)) /* !(mc68000||powerpc||riscv) */
__fpu_control = _FPU_DEFAULT;
__fpu_control |= _FPU_MASK_V; // NV
__fpu_control |= _FPU_MASK_O; // OF
__fpu_control |= _FPU_MASK_U; // UF
_FPU_SETCW(__fpu_control);
#else /* !(mc68000||powerpc||riscv||loongarch) */

#ifdef _FPU_IEEE
#ifndef _FPU_EXTENDED /* e.g., ARM processor under Linux */
Expand Down