Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Elbrus 2000 architecture #19024

Merged
merged 3 commits into from Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/installer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name: "Nim"
Version: "$version"
Platforms: """
windows: i386;amd64
linux: i386;hppa;ia64;alpha;amd64;powerpc64;arm;sparc;sparc64;m68k;mips;mipsel;mips64;mips64el;powerpc;powerpc64el;arm64;riscv32;riscv64
linux: i386;hppa;ia64;alpha;amd64;powerpc64;arm;sparc;sparc64;m68k;mips;mipsel;mips64;mips64el;powerpc;powerpc64el;arm64;riscv32;riscv64;e2k
Araq marked this conversation as resolved.
Show resolved Hide resolved
macosx: i386;amd64;powerpc64;arm64
solaris: i386;amd64;sparc;sparc64
freebsd: i386;amd64;powerpc64;arm;arm64;riscv64;sparc64;mips;mipsel;mips64;mips64el;powerpc;powerpc64el
Expand Down
6 changes: 4 additions & 2 deletions compiler/platform.nim
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ type
cpuNone, cpuI386, cpuM68k, cpuAlpha, cpuPowerpc, cpuPowerpc64,
cpuPowerpc64el, cpuSparc, cpuVm, cpuHppa, cpuIa64, cpuAmd64, cpuMips,
cpuMipsel, cpuArm, cpuArm64, cpuJS, cpuNimVM, cpuAVR, cpuMSP430,
cpuSparc64, cpuMips64, cpuMips64el, cpuRiscV32, cpuRiscV64, cpuEsp, cpuWasm32
cpuSparc64, cpuMips64, cpuMips64el, cpuRiscV32, cpuRiscV64, cpuEsp, cpuWasm32,
cpuE2k

type
TInfoCPU* = tuple[name: string, intSize: int, endian: Endianness,
Expand Down Expand Up @@ -232,7 +233,8 @@ const
(name: "riscv32", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32),
(name: "riscv64", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64),
(name: "esp", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32),
(name: "wasm32", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32)]
(name: "wasm32", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32),
(name: "e2k", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64)]

type
Target* = object
Expand Down
4 changes: 3 additions & 1 deletion lib/system/platforms.nim
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ type
msp430, ## TI MSP430 microcontroller
riscv32, ## RISC-V 32-bit processor
riscv64, ## RISC-V 64-bit processor
wasm32 ## WASM, 32-bit
wasm32, ## WASM, 32-bit
e2k ## MCST Elbrus 2000

OsPlatform* {.pure.} = enum ## the OS this program will run on.
none, dos, windows, os2, linux, morphos, skyos, solaris,
Expand Down Expand Up @@ -93,5 +94,6 @@ const
elif defined(riscv32): CpuPlatform.riscv32
elif defined(riscv64): CpuPlatform.riscv64
elif defined(wasm32): CpuPlatform.wasm32
elif defined(e2k): CpuPlatform.e2k
else: CpuPlatform.none
## the CPU this program will run on.
1 change: 1 addition & 0 deletions tools/nim.zsh-completion
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ _nim() {
'*--cpu=arm64[compile for ARM64 architecture]' \
'*--cpu=avr[compile for AVR architecture]' \
'*--cpu=esp[compile for ESP architecture]' \
'*--cpu=e2k[compile for Elbrus 2000 architecture]' \
'*--cpu=hppa[compile for HPPA architecture]' \
'*--cpu=i386[compile for i386 architecture]' \
'*--cpu=ia64[compile for ia64 architecture]' \
Expand Down
2 changes: 2 additions & 0 deletions tools/niminst/buildsh.nimf
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ case $ucpu in
mycpu="arm" ;;
*riscv64|riscv* )
mycpu="riscv64" ;;
*e2k* )
mycpu="e2k" ;;
*)
echo 2>&1 "Error: unknown processor: $ucpu"
exit 1
Expand Down
3 changes: 3 additions & 0 deletions tools/niminst/makefile.nimf
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ endif
ifeq ($(ucpu),riscv64)
mycpu = riscv64
endif
ifeq ($(ucpu),e2k)
mycpu = e2k
endif
ifndef mycpu
$(error unknown CPU architecture: $(ucpu) See makefile.nimf)
endif
Expand Down