Skip to content

Commit 730c195

Browse files
committed
Add s390x CPU support
1 parent 611b8bb commit 730c195

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

compiler/installer.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name: "Nim"
66
Version: "$version"
77
Platforms: """
88
windows: i386;amd64
9-
linux: i386;hppa;ia64;alpha;amd64;powerpc64;arm;sparc;sparc64;m68k;mips;mipsel;mips64;mips64el;powerpc;powerpc64el;arm64;riscv32;riscv64;loongarch64
9+
linux: i386;hppa;ia64;alpha;amd64;powerpc64;arm;sparc;sparc64;s390x;m68k;mips;mipsel;mips64;mips64el;powerpc;powerpc64el;arm64;riscv32;riscv64;loongarch64
1010
macosx: i386;amd64;powerpc64;arm64
1111
solaris: i386;amd64;sparc;sparc64
1212
freebsd: i386;amd64;powerpc64;arm;arm64;riscv64;sparc64;mips;mipsel;mips64;mips64el;powerpc;powerpc64el

compiler/platform.nim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ type
210210
cpuNone, cpuI386, cpuM68k, cpuAlpha, cpuPowerpc, cpuPowerpc64,
211211
cpuPowerpc64el, cpuSparc, cpuVm, cpuHppa, cpuIa64, cpuAmd64, cpuMips,
212212
cpuMipsel, cpuArm, cpuArm64, cpuJS, cpuNimVM, cpuAVR, cpuMSP430,
213-
cpuSparc64, cpuMips64, cpuMips64el, cpuRiscV32, cpuRiscV64, cpuEsp, cpuWasm32,
214-
cpuE2k, cpuLoongArch64
213+
cpuSparc64, cpuS390x, cpuMips64, cpuMips64el, cpuRiscV32, cpuRiscV64,
214+
cpuEsp, cpuWasm32, cpuE2k, cpuLoongArch64
215215

216216
type
217217
TInfoCPU* = tuple[name: string, intSize: int, endian: Endianness,
@@ -241,6 +241,7 @@ const
241241
(name: "avr", intSize: 16, endian: littleEndian, floatSize: 32, bit: 16),
242242
(name: "msp430", intSize: 16, endian: littleEndian, floatSize: 32, bit: 16),
243243
(name: "sparc64", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64),
244+
(name: "s390x", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64),
244245
(name: "mips64", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64),
245246
(name: "mips64el", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64),
246247
(name: "riscv32", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32),

lib/system.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ const
10681068
##
10691069
## Possible values:
10701070
## `"i386"`, `"alpha"`, `"powerpc"`, `"powerpc64"`, `"powerpc64el"`,
1071-
## `"sparc"`, `"amd64"`, `"mips"`, `"mipsel"`, `"arm"`, `"arm64"`,
1071+
## `"sparc"`, `"s390x"`, `"amd64"`, `"mips"`, `"mipsel"`, `"arm"`, `"arm64"`,
10721072
## `"mips64"`, `"mips64el"`, `"riscv32"`, `"riscv64"`, `"loongarch64"`.
10731073

10741074
seqShallowFlag = low(int)

tools/nim.zsh-completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ _nim() {
7878
'--opt\:-[optimization mode]:x:(none speed size)'
7979
'--debugger\:native[use native debugger (gdb)]'
8080
'--app\:-[generate this type of app (lib=dynamic)]:x:(console gui lib staticlib)'
81-
'--cpu\:-[target architecture]:x:(alpha amd64 arm arm64 avr e2k esp hppa i386 ia64 js loongarch64 m68k mips mipsel mips64 mips64el msp430 nimvm powerpc powerpc64 powerpc64el riscv32 riscv64 sparc sparc64 vm wasm32)'
81+
'--cpu\:-[target architecture]:x:(alpha amd64 arm arm64 avr e2k esp hppa i386 ia64 js loongarch64 m68k mips mipsel mips64 mips64el msp430 nimvm powerpc powerpc64 powerpc64el riscv32 riscv64 sparc sparc64 s390x vm wasm32)'
8282
'--gc\:-[memory management algorithm to use (default\: refc)]:x:(refc arc orc markAndSweep boehm go regions none)'
8383
'--os\:-[operating system to compile for]:x:(AIX Amiga Android Any Atari DOS DragonFly FreeBSD FreeRTOS Genode Haiku iOS Irix JS Linux MacOS MacOSX MorphOS NetBSD Netware NimVM NintendoSwitch OS2 OpenBSD PalmOS Standalone QNX SkyOS Solaris VxWorks Windows)'
8484
'--panics\:-[turn panics into process termination (default\: off)]:x:(off on)'

tools/niminst/buildsh.nimf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ case $ucpu in
183183
fi
184184
fi
185185
;;
186+
*s390x* )
187+
mycpu="s390x" ;;
186188
*ppc64le* )
187189
mycpu="powerpc64el" ;;
188190
*ppc64* )

0 commit comments

Comments
 (0)