From: "Wesley W. Terpstra" Date: Tue, 20 May 2025 12:14:31 -0400 Subject: Add a mips64el port Forwarded: no Reviewed-by: Ryan Kavanagh Last-Update: 2025-05-20 --- basis-library/mlton/platform.sig | 2 +- basis-library/mlton/platform.sml | 3 +++ bin/platform | 3 +++ doc/guide/src/MLtonPlatform.adoc | 2 +- mlton/main/main.fun | 1 + runtime/cenv.h | 2 ++ runtime/platform/mips64.h | 1 + 7 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 runtime/platform/mips64.h diff --git a/basis-library/mlton/platform.sig b/basis-library/mlton/platform.sig index 3eea82c..44d0967 100644 --- a/basis-library/mlton/platform.sig +++ b/basis-library/mlton/platform.sig @@ -10,7 +10,7 @@ signature MLTON_PLATFORM = structure Arch: sig datatype t = Alpha | AMD64 | ARM | ARM64 | HPPA | IA64 | LoongArch64 | m68k | - MIPS | PowerPC | PowerPC64 | RISCV | S390 | Sparc | Wasm32 | X86 + MIPS | MIPS64 | PowerPC | PowerPC64 | RISCV | S390 | Sparc | Wasm32 | X86 val fromString: string -> t option val host: t diff --git a/basis-library/mlton/platform.sml b/basis-library/mlton/platform.sml index 287284b..650fb91 100644 --- a/basis-library/mlton/platform.sml +++ b/basis-library/mlton/platform.sml @@ -39,6 +39,7 @@ structure MLtonPlatform: MLTON_PLATFORM = | LoongArch64 | m68k | MIPS + | MIPS64 | PowerPC | PowerPC64 | RISCV @@ -57,6 +58,7 @@ structure MLtonPlatform: MLTON_PLATFORM = (LoongArch64,"LoongArch64"):: (m68k, "m68k"):: (MIPS, "MIPS"):: + (MIPS64, "MIPS64"):: (PowerPC, "PowerPC"):: (PowerPC64, "PowerPC64"):: (RISCV, "RISCV"):: @@ -80,6 +82,7 @@ structure MLtonPlatform: MLTON_PLATFORM = | "loongarch64" => LoongArch64 | "m68k" => m68k | "mips" => MIPS + | "mips64" => MIPS64 | "powerpc" => PowerPC | "powerpc64" => PowerPC64 | "riscv" => RISCV diff --git a/bin/platform b/bin/platform index 8e38726..eb8a9af 100755 --- a/bin/platform +++ b/bin/platform @@ -115,6 +115,9 @@ loongarch64*) m68k*) HOST_ARCH=m68k ;; +mips64*) + HOST_ARCH=mips64 +;; mips*) # big-endian and little-endian detect via headers HOST_ARCH=mips diff --git a/doc/guide/src/MLtonPlatform.adoc b/doc/guide/src/MLtonPlatform.adoc index 1e29169..8220fd7 100644 --- a/doc/guide/src/MLtonPlatform.adoc +++ b/doc/guide/src/MLtonPlatform.adoc @@ -7,7 +7,7 @@ signature MLTON_PLATFORM = structure Arch: sig datatype t = Alpha | AMD64 | ARM | ARM64 | HPPA | IA64 | m68k - | MIPS | PowerPC | PowerPC64 | S390 | Sparc | X86 + | MIPS | MIPS64 | PowerPC | PowerPC64 | S390 | Sparc | X86 val fromString: string -> t option val host: t diff --git a/mlton/main/main.fun b/mlton/main/main.fun index 3d61eef..c69892b 100644 --- a/mlton/main/main.fun +++ b/mlton/main/main.fun @@ -199,6 +199,7 @@ fun defaultAlignIs8 () = | HPPA => true | IA64 => true | MIPS => true + | MIPS64 => true | PowerPC64 => true | Sparc => true | S390 => true diff --git a/runtime/cenv.h b/runtime/cenv.h index 7e40347..c805f00 100644 --- a/runtime/cenv.h +++ b/runtime/cenv.h @@ -103,6 +103,8 @@ COMPILE_TIME_ASSERT(sizeof_double__is_eight, sizeof(double) == 8); #include "platform/ia64.h" #elif (defined (__m68k__)) #include "platform/m68k.h" +#elif (defined (__mips64)) +#include "platform/mips64.h" #elif (defined (__mips__)) #include "platform/mips.h" #elif (defined (__powerpc64__)) diff --git a/runtime/platform/mips64.h b/runtime/platform/mips64.h new file mode 100644 index 0000000..02271de --- /dev/null +++ b/runtime/platform/mips64.h @@ -0,0 +1 @@ +#define MLton_Platform_Arch_host "mips64"