aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-elf/riscv
diff options
context:
space:
mode:
authorRuslan Bukin <br@FreeBSD.org>2018-08-02 12:21:39 +0000
committerRuslan Bukin <br@FreeBSD.org>2018-08-02 12:21:39 +0000
commitf00ebc42b5a9be4a17611290c422c15bac10641c (patch)
tree1e66864326593abb46cd369054f4aa1db0d8e9de /libexec/rtld-elf/riscv
parent385a185b43b4dea21c84aba6014ffe82449f577a (diff)
downloadsrc-f00ebc42b5a9be4a17611290c422c15bac10641c.tar.gz
src-f00ebc42b5a9be4a17611290c422c15bac10641c.zip
Save and restore floating-point arguments.
Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=337128
Diffstat (limited to 'libexec/rtld-elf/riscv')
-rw-r--r--libexec/rtld-elf/riscv/rtld_start.S46
1 files changed, 23 insertions, 23 deletions
diff --git a/libexec/rtld-elf/riscv/rtld_start.S b/libexec/rtld-elf/riscv/rtld_start.S
index 76b6dfcaf3bc..c37cd62e49ec 100644
--- a/libexec/rtld-elf/riscv/rtld_start.S
+++ b/libexec/rtld-elf/riscv/rtld_start.S
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com>
+ * Copyright (c) 2015-2018 Ruslan Bukin <br@bsdpad.com>
* All rights reserved.
*
* This software was developed by SRI International and the University of
@@ -64,7 +64,7 @@ END(.rtld_start)
*/
ENTRY(_rtld_bind_start)
/* Save the arguments and ra */
- addi sp, sp, -(8 * 25)
+ addi sp, sp, -(8 * 17)
sd a0, (8 * 0)(sp)
sd a1, (8 * 1)(sp)
sd a2, (8 * 2)(sp)
@@ -74,17 +74,17 @@ ENTRY(_rtld_bind_start)
sd a6, (8 * 6)(sp)
sd a7, (8 * 7)(sp)
sd ra, (8 * 8)(sp)
-#if 0
- /* RISCVTODO VFP */
+
+#ifdef __riscv_float_abi_double
/* Save any floating-point arguments */
- fsq fa0, (8 * 9)(sp)
- fsq fa1, (8 * 11)(sp)
- fsq fa2, (8 * 13)(sp)
- fsq fa3, (8 * 15)(sp)
- fsq fa4, (8 * 17)(sp)
- fsq fa5, (8 * 19)(sp)
- fsq fa6, (8 * 21)(sp)
- fsq fa7, (8 * 23)(sp)
+ fsd fa0, (8 * 9)(sp)
+ fsd fa1, (8 * 10)(sp)
+ fsd fa2, (8 * 11)(sp)
+ fsd fa3, (8 * 12)(sp)
+ fsd fa4, (8 * 13)(sp)
+ fsd fa5, (8 * 14)(sp)
+ fsd fa6, (8 * 15)(sp)
+ fsd fa7, (8 * 16)(sp)
#endif
/* Reloc offset is 3x of the .got.plt offset */
@@ -110,19 +110,19 @@ ENTRY(_rtld_bind_start)
ld a6, (8 * 6)(sp)
ld a7, (8 * 7)(sp)
ld ra, (8 * 8)(sp)
-#if 0
- /* RISCVTODO VFP */
+
+#ifdef __riscv_float_abi_double
/* Restore floating-point arguments */
- flq fa0, (8 * 9)(sp)
- flq fa1, (8 * 11)(sp)
- flq fa2, (8 * 13)(sp)
- flq fa3, (8 * 15)(sp)
- flq fa4, (8 * 17)(sp)
- flq fa5, (8 * 19)(sp)
- flq fa6, (8 * 21)(sp)
- flq fa7, (8 * 23)(sp)
+ fld fa0, (8 * 9)(sp)
+ fld fa1, (8 * 10)(sp)
+ fld fa2, (8 * 11)(sp)
+ fld fa3, (8 * 12)(sp)
+ fld fa4, (8 * 13)(sp)
+ fld fa5, (8 * 14)(sp)
+ fld fa6, (8 * 15)(sp)
+ fld fa7, (8 * 16)(sp)
#endif
- addi sp, sp, (8 * 25)
+ addi sp, sp, (8 * 17)
/* Call into the correct function */
jr t0