riscv64 gdtoa support
authordrahn <drahn@openbsd.org>
Wed, 28 Apr 2021 04:38:01 +0000 (04:38 +0000)
committerdrahn <drahn@openbsd.org>
Wed, 28 Apr 2021 04:38:01 +0000 (04:38 +0000)
direct copy from aarch64
constants were rechecked using the qnan.c program.

lib/libc/arch/riscv64/gdtoa/Makefile.inc [new file with mode: 0644]
lib/libc/arch/riscv64/gdtoa/arith.h [new file with mode: 0644]
lib/libc/arch/riscv64/gdtoa/gd_qnan.h [new file with mode: 0644]

diff --git a/lib/libc/arch/riscv64/gdtoa/Makefile.inc b/lib/libc/arch/riscv64/gdtoa/Makefile.inc
new file mode 100644 (file)
index 0000000..f2215dd
--- /dev/null
@@ -0,0 +1,3 @@
+#      $OpenBSD: Makefile.inc,v 1.1 2021/04/28 04:38:01 drahn Exp $
+
+SRCS+= strtord.c strtorQ.c
diff --git a/lib/libc/arch/riscv64/gdtoa/arith.h b/lib/libc/arch/riscv64/gdtoa/arith.h
new file mode 100644 (file)
index 0000000..32513b9
--- /dev/null
@@ -0,0 +1,6 @@
+#define IEEE_8087
+#define Arith_Kind_ASL 1
+#define Long int
+#define Intcast (int)(long)
+#define Double_Align
+#define X64_bit_pointers
diff --git a/lib/libc/arch/riscv64/gdtoa/gd_qnan.h b/lib/libc/arch/riscv64/gdtoa/gd_qnan.h
new file mode 100644 (file)
index 0000000..9593d5c
--- /dev/null
@@ -0,0 +1,12 @@
+#define f_QNAN 0x7fc00000
+#define d_QNAN0 0x0
+#define d_QNAN1 0x7ff80000
+#define ld_QNAN0 0x0
+#define ld_QNAN1 0x0
+#define ld_QNAN2 0x0
+#define ld_QNAN3 0x7fff8000
+#define ldus_QNAN0 0x0
+#define ldus_QNAN1 0x0
+#define ldus_QNAN2 0x0
+#define ldus_QNAN3 0x0
+#define ldus_QNAN4 0x0