diff --git a/AUTHORS.rst b/AUTHORS.rst index 6aecaea6..c5bffeb8 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -75,6 +75,7 @@ and agreed to irrevocably license their contributions under the Duktape * tinywrkb (https://github.com/tinywrkb) * Christoph Kaser (https://github.com/ChristophKaser) * Jonne Ransijn +* Liu Xiang Other contributions =================== diff --git a/config/architectures.yaml b/config/architectures.yaml index 94f044a7..042ec478 100644 --- a/config/architectures.yaml +++ b/config/architectures.yaml @@ -53,6 +53,10 @@ autodetect: name: RISC-V 64-bit check: DUK_F_RISCV64 include: architecture_riscv64.h.in + - + name: LOONGARCH 64-bit + check: DUK_F_LOONGARCH64 + include: architecture_loongarch64.h.in - name: SuperH check: DUK_F_SUPERH diff --git a/config/architectures/architecture_loongarch64.h.in b/config/architectures/architecture_loongarch64.h.in new file mode 100644 index 00000000..fadc4100 --- /dev/null +++ b/config/architectures/architecture_loongarch64.h.in @@ -0,0 +1,3 @@ +#define DUK_USE_ARCH_STRING "loongarch64" +#define DUK_USE_BYTEORDER 1 +#undef DUK_USE_PACKED_TVAL diff --git a/config/helper-snippets/DUK_F_LOONGARCH.h.in b/config/helper-snippets/DUK_F_LOONGARCH.h.in new file mode 100644 index 00000000..7d9775d9 --- /dev/null +++ b/config/helper-snippets/DUK_F_LOONGARCH.h.in @@ -0,0 +1,4 @@ +/* LOONGARCH64, https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html */ +#if defined(__loongarch64) +#define DUK_F_LOONGARCH64 +#endif