about summary refs log tree commit diff
path: root/src/fenv/mips64
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-03-06 17:41:56 +0000
committerRich Felker <dalias@aerifal.cx>2016-03-06 17:41:56 +0000
commit83933573aff71a5d178ab71912f177d2d844e63e (patch)
tree3c7057d0c83c0030b8a6c0405f1b2797fbbcf450 /src/fenv/mips64
parent71392a91c333d47b6b3c8f99c897e3b5a7eb6d58 (diff)
downloadmusl-83933573aff71a5d178ab71912f177d2d844e63e.tar.gz
musl-83933573aff71a5d178ab71912f177d2d844e63e.tar.xz
musl-83933573aff71a5d178ab71912f177d2d844e63e.zip
add mips64 port
patch by Mahesh Bodapati and Jaydeep Patil of Imagination
Technologies.
Diffstat (limited to 'src/fenv/mips64')
-rw-r--r--src/fenv/mips64/fenv-sf.c3
-rw-r--r--src/fenv/mips64/fenv.S71
2 files changed, 74 insertions, 0 deletions
diff --git a/src/fenv/mips64/fenv-sf.c b/src/fenv/mips64/fenv-sf.c
new file mode 100644
index 00000000..4aa3dbf1
--- /dev/null
+++ b/src/fenv/mips64/fenv-sf.c
@@ -0,0 +1,3 @@
+#ifdef __mips_soft_float
+#include "../fenv.c"
+#endif
diff --git a/src/fenv/mips64/fenv.S b/src/fenv/mips64/fenv.S
new file mode 100644
index 00000000..3cba3f0f
--- /dev/null
+++ b/src/fenv/mips64/fenv.S
@@ -0,0 +1,71 @@
+#ifndef __mips_soft_float
+
+.set	noreorder
+
+.global	feclearexcept
+.type	feclearexcept,@function
+feclearexcept:
+	and	$4, $4, 0x7c
+	cfc1	$5, $31
+	or	$5, $5, $4
+	xor	$5, $5, $4
+	ctc1	$5, $31
+	jr	$ra
+	li	$2, 0
+
+.global	feraiseexcept
+.type	feraiseexcept,@function
+feraiseexcept:
+	and	$4, $4, 0x7c
+	cfc1	$5, $31
+	or	$5, $5, $4
+	ctc1	$5, $31
+	jr	$ra
+	li	$2, 0
+
+.global	fetestexcept
+.type	fetestexcept,@function
+fetestexcept:
+	and	$4, $4, 0x7c
+	cfc1	$2, $31
+	jr	$ra
+	and	$2, $2, $4
+
+.global	fegetround
+.type	fegetround,@function
+fegetround:
+	cfc1	$2, $31
+	jr	$ra
+	andi	$2, $2, 3
+
+.global	__fesetround
+.type	__fesetround,@function
+__fesetround:
+	cfc1	$5, $31
+	li	$6, -4
+	and	$5, $5, $6
+	or	$5, $5, $4
+	ctc1	$5, $31
+	jr	$ra
+	li	$2, 0
+
+.global	fegetenv
+.type	fegetenv,@function
+fegetenv:
+	cfc1	$5, $31
+	sw	$5, 0($4)
+	jr	$ra
+	li	$2, 0
+
+.global	fesetenv
+.type	fesetenv,@function
+fesetenv:
+	daddiu	$5, $4, 1
+	beq	$5, $0, 1f
+	nop
+	lw	$5, 0($4)
+1:	ctc1	$5, $31
+	jr	$ra
+	li	$2, 0
+
+#endif