Skip to content

Commit

Permalink
Merge pull request #541 from loongson-zjl/master
Browse files Browse the repository at this point in the history
Add LoongArch64 support
  • Loading branch information
MatthewFluet authored Jan 19, 2024
2 parents fd6d870 + b613b60 commit 2637b22
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion basis-library/mlton/platform.sig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ signature MLTON_PLATFORM =
sig
structure Arch:
sig
datatype t = Alpha | AMD64 | ARM | ARM64 | HPPA | IA64 | m68k |
datatype t = Alpha | AMD64 | ARM | ARM64 | HPPA | IA64 | LoongArch64 | m68k |
MIPS | PowerPC | PowerPC64 | RISCV | S390 | Sparc | X86

val fromString: string -> t option
Expand Down
3 changes: 3 additions & 0 deletions basis-library/mlton/platform.sml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ structure MLtonPlatform: MLTON_PLATFORM =
| ARM64
| HPPA
| IA64
| LoongArch64
| m68k
| MIPS
| PowerPC
Expand All @@ -52,6 +53,7 @@ structure MLtonPlatform: MLTON_PLATFORM =
(ARM64, "ARM64")::
(HPPA, "HPPA")::
(IA64, "IA64")::
(LoongArch64,"LoongArch64")::
(m68k, "m68k")::
(MIPS, "MIPS")::
(PowerPC, "PowerPC")::
Expand All @@ -73,6 +75,7 @@ structure MLtonPlatform: MLTON_PLATFORM =
| "arm64" => ARM64
| "hppa" => HPPA
| "ia64" => IA64
| "loongarch64" => LoongArch64
| "m68k" => m68k
| "mips" => MIPS
| "powerpc" => PowerPC
Expand Down
3 changes: 3 additions & 0 deletions bin/platform
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ parisc*)
ia64*)
HOST_ARCH=ia64
;;
loongarch64*)
HOST_ARCH=loongarch64
;;
m68k*)
HOST_ARCH=m68k
;;
Expand Down
2 changes: 2 additions & 0 deletions runtime/cenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ COMPILE_TIME_ASSERT(sizeof_double__is_eight, sizeof(double) == 8);
#include "platform/sparc.h"
#elif (defined (__i386__))
#include "platform/x86.h"
#elif (defined (__loongarch64))
#include "platform/loongarch64.h"
#else
#error unknown platform arch
#endif
Expand Down
1 change: 1 addition & 0 deletions runtime/platform/loongarch64.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define MLton_Platform_Arch_host "loongarch64"

0 comments on commit 2637b22

Please sign in to comment.