Add mips64 and mips64el CPU platforms (#5866)

This commit is contained in:
James Cowgill 2017-08-03 17:37:02 +01:00 • committed by Andreas Rumpf
commit fed1b0a077
7 changed files with 27 additions and 8 deletions

View file

@ -6,7 +6,7 @@ Name: "Nim"
Version: "$version" Version: "$version"
Platforms: """ Platforms: """
windows: i386;amd64 windows: i386;amd64
linux: i386;amd64;powerpc64;arm;sparc;mips;mipsel;powerpc;powerpc64el;arm64 linux: i386;amd64;powerpc64;arm;sparc;mips;mipsel;mips64;mips64el;powerpc;powerpc64el;arm64
macosx: i386;amd64;powerpc64 macosx: i386;amd64;powerpc64
solaris: i386;amd64;sparc;sparc64 solaris: i386;amd64;sparc;sparc64
freebsd: i386;amd64 freebsd: i386;amd64

View file

@ -171,7 +171,8 @@ type
# alias conditionals to condsyms (end of module). # alias conditionals to condsyms (end of module).
cpuNone, cpuI386, cpuM68k, cpuAlpha, cpuPowerpc, cpuPowerpc64, cpuNone, cpuI386, cpuM68k, cpuAlpha, cpuPowerpc, cpuPowerpc64,
cpuPowerpc64el, cpuSparc, cpuVm, cpuIa64, cpuAmd64, cpuMips, cpuMipsel, cpuPowerpc64el, cpuSparc, cpuVm, cpuIa64, cpuAmd64, cpuMips, cpuMipsel,
cpuArm, cpuArm64, cpuJS, cpuNimrodVM, cpuAVR, cpuMSP430, cpuSparc64 cpuArm, cpuArm64, cpuJS, cpuNimrodVM, cpuAVR, cpuMSP430, cpuSparc64,
cpuMips64, cpuMips64el
type type
TEndian* = enum TEndian* = enum
@ -200,7 +201,9 @@ const
(name: "nimrodvm", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32), (name: "nimrodvm", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32),
(name: "avr", intSize: 16, endian: littleEndian, floatSize: 32, bit: 16), (name: "avr", intSize: 16, endian: littleEndian, floatSize: 32, bit: 16),
(name: "msp430", intSize: 16, endian: littleEndian, floatSize: 32, bit: 16), (name: "msp430", intSize: 16, endian: littleEndian, floatSize: 32, bit: 16),
(name: "sparc64", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64)] (name: "sparc64", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64),
(name: "mips64", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64),
(name: "mips64el", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64)]
var var
targetCPU*, hostCPU*: TSystemCPU targetCPU*, hostCPU*: TSystemCPU

View file

@ -572,7 +572,8 @@ else:
MAP_POPULATE*: cint = 0 MAP_POPULATE*: cint = 0
when defined(linux) or defined(nimdoc): when defined(linux) or defined(nimdoc):
when defined(alpha) or defined(mips) or defined(parisc) or when defined(alpha) or defined(mips) or defined(mipsel) or
defined(mips64) or defined(mips64el) or defined(parisc) or
defined(sparc) or defined(nimdoc): defined(sparc) or defined(nimdoc):
const SO_REUSEPORT* = cint(0x0200) const SO_REUSEPORT* = cint(0x0200)
## Multiple binding: load balancing on incoming TCP connections ## Multiple binding: load balancing on incoming TCP connections

View file

@ -1313,7 +1313,7 @@ const
hostCPU* {.magic: "HostCPU".}: string = "" hostCPU* {.magic: "HostCPU".}: string = ""
## a string that describes the host CPU. Possible values: ## a string that describes the host CPU. Possible values:
## "i386", "alpha", "powerpc", "powerpc64", "powerpc64el", "sparc", ## "i386", "alpha", "powerpc", "powerpc64", "powerpc64el", "sparc",
## "amd64", "mips", "mipsel", "arm", "arm64". ## "amd64", "mips", "mipsel", "arm", "arm64", "mips64", "mips64el".
seqShallowFlag = low(int) seqShallowFlag = low(int)

View file

@ -24,6 +24,8 @@ type
amd64, ## x86_64 (AMD64); 64 bit x86 compatible CPU amd64, ## x86_64 (AMD64); 64 bit x86 compatible CPU
mips, ## Mips based processor mips, ## Mips based processor
mipsel, ## Little Endian Mips based processor mipsel, ## Little Endian Mips based processor
mips64, ## 64-bit MIPS processor
mips64el, ## Little Endian 64-bit MIPS processor
arm, ## ARM based processor arm, ## ARM based processor
arm64, ## ARM64 based processor arm64, ## ARM64 based processor
vm, ## Some Virtual machine: Nim's VM or JavaScript vm, ## Some Virtual machine: Nim's VM or JavaScript
@ -73,6 +75,8 @@ const
elif defined(amd64): CpuPlatform.amd64 elif defined(amd64): CpuPlatform.amd64
elif defined(mips): CpuPlatform.mips elif defined(mips): CpuPlatform.mips
elif defined(mipsel): CpuPlatform.mipsel elif defined(mipsel): CpuPlatform.mipsel
elif defined(mips64): CpuPlatform.mips64
elif defined(mips64el): CpuPlatform.mips64el
elif defined(arm): CpuPlatform.arm elif defined(arm): CpuPlatform.arm
elif defined(arm64): CpuPlatform.arm64 elif defined(arm64): CpuPlatform.arm64
elif defined(vm): CpuPlatform.vm elif defined(vm): CpuPlatform.vm

View file

@ -123,7 +123,15 @@ case $ucpu in
*power*|*ppc* ) *power*|*ppc* )
mycpu="powerpc" ;; mycpu="powerpc" ;;
*mips* ) *mips* )
mycpu="mips" ;; mycpu="$("$CC" -dumpmachine | sed 's/-.*//')"
case $mycpu in
mips|mipsel|mips64|mips64el)
;;
*)
echo 2>&1 "Error: unknown MIPS target: $mycpu"
exit 1
esac
;;
*arm*|*armv6l* ) *arm*|*armv6l* )
mycpu="arm" ;; mycpu="arm" ;;
*aarch64* ) *aarch64* )

View file

@ -114,8 +114,11 @@ endif
ifeq ($(ucpu),ppc) ifeq ($(ucpu),ppc)
mycpu = ppc mycpu = ppc
endif endif
ifeq ($(ucpu),mips) ifneq (,$(filter $(ucpu), mips mips64))
mycpu = mips mycpu = $(shell /bin/sh -c '"$(CC)" -dumpmachine | sed "s/-.*//"')
ifeq (,$(filter $(mycpu), mips mipsel mips64 mips64el))
$(error unknown MIPS target: $(mycpu))
endif
endif endif
ifeq ($(ucpu),arm) ifeq ($(ucpu),arm)
mycpu = arm mycpu = arm