summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2018-04-06 23:40:39 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-04-07 00:40:39 +0200
commit673f5f3534cf0fd4e1316d1b7fede31f10878b46 (patch)
tree6f0cb5143ae0f6b8533f0f6aca635ecbe5e480a8 /lib
parent8ae0ac8637dcb11fe60f365651ecfe8d20e8ced2 (diff)
downloadNim-673f5f3534cf0fd4e1316d1b7fede31f10878b46.tar.gz
Add RISC-V (riscv64) support (#7417)
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim3
-rw-r--r--lib/system/platforms.nim6
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 7eda30276..7733a1b20 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1377,7 +1377,8 @@ const
   hostCPU* {.magic: "HostCPU".}: string = ""
     ## a string that describes the host CPU. Possible values:
     ## "i386", "alpha", "powerpc", "powerpc64", "powerpc64el", "sparc",
-    ## "amd64", "mips", "mipsel", "arm", "arm64", "mips64", "mips64el".
+    ## "amd64", "mips", "mipsel", "arm", "arm64", "mips64", "mips64el",
+    ## "riscv64".
 
   seqShallowFlag = low(int)
   strlitFlag = 1 shl (sizeof(int)*8 - 2) # later versions of the codegen \
diff --git a/lib/system/platforms.nim b/lib/system/platforms.nim
index 8939615cd..97f97e8ae 100644
--- a/lib/system/platforms.nim
+++ b/lib/system/platforms.nim
@@ -29,8 +29,9 @@ type
     arm,                       ## ARM based processor
     arm64,                     ## ARM64 based processor
     vm,                        ## Some Virtual machine: Nim's VM or JavaScript
-    avr                        ## AVR based processor
-    msp430                     ## TI MSP430 microcontroller
+    avr,                       ## AVR based processor
+    msp430,                    ## TI MSP430 microcontroller
+    riscv64                    ## RISC-V 64-bit processor
 
   OsPlatform* {.pure.} = enum ## the OS this program will run on.
     none, dos, windows, os2, linux, morphos, skyos, solaris,
@@ -84,5 +85,6 @@ const
                elif defined(vm): CpuPlatform.vm
                elif defined(avr): CpuPlatform.avr
                elif defined(msp430): CpuPlatform.msp430
+               elif defined(riscv64): CpuPlatform.riscv64
                else: CpuPlatform.none
     ## the CPU this program will run on.