From d9392bfa032b448839abadb523aff65b8ccb3dba Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Tue, 23 Apr 2019 22:53:12 +0000 Subject: libphobos: Add D support for RISC-V Linux 2019-04-23 Iain Buclaw * configure.tgt: Add riscv*-*-linux* as supported target. * libdruntime/gcc/sections/elf_shared.d (getDependencies): Adjust dlpi_addr on RISCV32 and RISCV64. * src/std/math.d: Add IEEE FPU control support for RISCV. From-SVN: r270522 --- libphobos/src/std/math.d | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'libphobos/src') diff --git a/libphobos/src/std/math.d b/libphobos/src/std/math.d index daee6ec..6dec9ce 100644 --- a/libphobos/src/std/math.d +++ b/libphobos/src/std/math.d @@ -4757,6 +4757,15 @@ private: return result; } } + else version (RISCV_Any) + { + uint result = void; + asm pure nothrow @nogc + { + "frflags %0" : "=r" result; + } + return result; + } else assert(0, "Not yet supported"); } @@ -4831,6 +4840,14 @@ private: } } } + else version (RISCV_Any) + { + uint newValues = 0x0; + asm pure nothrow @nogc + { + "fsflags %0" : : "r" newValues; + } + } else assert(0, "Not yet supported"); } @@ -5423,6 +5440,15 @@ private: } return cont; } + else version (RISCV_Any) + { + ControlState cont; + asm pure nothrow @nogc + { + "frcsr %0" : "=r" cont; + } + return cont; + } else assert(0, "Not yet supported"); } @@ -5508,6 +5534,13 @@ private: } } } + else version (RISCV_Any) + { + asm pure nothrow @nogc + { + "fscsr %0" : : "r" (newState); + } + } else assert(0, "Not yet supported"); } -- cgit v1.1