--- /dev/null
+#if __ARM_PCS_VFP
+
+.syntax unified
+.fpu vfp
+
+.global fegetround
+.type fegetround,%function
+fegetround:
+ fmrx r0, fpscr
+ and r0, r0, #0xc00000
+ bx lr
+
+.global __fesetround
+.type __fesetround,%function
+__fesetround:
+ fmrx r3, fpscr
+ bic r3, r3, #0xc00000
+ orr r3, r3, r0
+ fmxr fpscr, r3
+ mov r0, #0
+ bx lr
+
+.global fetestexcept
+.type fetestexcept,%function
+fetestexcept:
+ and r0, r0, #0x1f
+ fmrx r3, fpscr
+ and r0, r0, r3
+ bx lr
+
+.global feclearexcept
+.type feclearexcept,%function
+feclearexcept:
+ and r0, r0, #0x1f
+ fmrx r3, fpscr
+ bic r3, r3, r0
+ fmxr fpscr, r3
+ mov r0, #0
+ bx lr
+
+.global feraiseexcept
+.type feraiseexcept,%function
+feraiseexcept:
+ and r0, r0, #0x1f
+ fmrx r3, fpscr
+ orr r3, r3, r0
+ fmxr fpscr, r3
+ mov r0, #0
+ bx lr
+
+.global fegetenv
+.type fegetenv,%function
+fegetenv:
+ fmrx r3, fpscr
+ str r3, [r0]
+ mov r0, #0
+ bx lr
+
+.global fesetenv
+.type fesetenv,%function
+fesetenv:
+ cmn r0, #1
+ moveq r3, #0
+ ldrne r3, [r0]
+ fmxr fpscr, r3
+ mov r0, #0
+ bx lr
+
+#endif
--- /dev/null
+#if !__ARM_PCS_VFP
+#include "../fenv.c"
+#endif
+++ /dev/null
-../armhf/fenv.s
+++ /dev/null
-.syntax unified
-.fpu vfp
-
-.global fegetround
-.type fegetround,%function
-fegetround:
- fmrx r0, fpscr
- and r0, r0, #0xc00000
- bx lr
-
-.global __fesetround
-.type __fesetround,%function
-__fesetround:
- fmrx r3, fpscr
- bic r3, r3, #0xc00000
- orr r3, r3, r0
- fmxr fpscr, r3
- mov r0, #0
- bx lr
-
-.global fetestexcept
-.type fetestexcept,%function
-fetestexcept:
- and r0, r0, #0x1f
- fmrx r3, fpscr
- and r0, r0, r3
- bx lr
-
-.global feclearexcept
-.type feclearexcept,%function
-feclearexcept:
- and r0, r0, #0x1f
- fmrx r3, fpscr
- bic r3, r3, r0
- fmxr fpscr, r3
- mov r0, #0
- bx lr
-
-.global feraiseexcept
-.type feraiseexcept,%function
-feraiseexcept:
- and r0, r0, #0x1f
- fmrx r3, fpscr
- orr r3, r3, r0
- fmxr fpscr, r3
- mov r0, #0
- bx lr
-
-.global fegetenv
-.type fegetenv,%function
-fegetenv:
- fmrx r3, fpscr
- str r3, [r0]
- mov r0, #0
- bx lr
-
-.global fesetenv
-.type fesetenv,%function
-fesetenv:
- cmn r0, #1
- moveq r3, #0
- ldrne r3, [r0]
- fmxr fpscr, r3
- mov r0, #0
- bx lr
--- /dev/null
+#ifdef __mips_soft_float
+#include "../fenv.c"
+#endif
--- /dev/null
+#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:
+ addiu $5, $4, 1
+ beq $5, $0, 1f
+ nop
+ lw $5, 0($4)
+1: ctc1 $5, $31
+ jr $ra
+ li $2, 0
+
+#endif
+++ /dev/null
-.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:
- addiu $5, $4, 1
- beq $5, $0, 1f
- nop
- lw $5, 0($4)
-1: ctc1 $5, $31
- jr $ra
- li $2, 0
--- /dev/null
+#if !__SH_FPU_ANY__ && !__SH4__
+#include "../fenv.c"
+#endif
--- /dev/null
+#if __SH_FPU_ANY__ || __SH4__
+
+.global fegetround
+.type fegetround, @function
+fegetround:
+ sts fpscr, r0
+ rts
+ and #3, r0
+
+.global __fesetround
+.type __fesetround, @function
+__fesetround:
+ sts fpscr, r0
+ or r4, r0
+ lds r0, fpscr
+ rts
+ mov #0, r0
+
+.global fetestexcept
+.type fetestexcept, @function
+fetestexcept:
+ sts fpscr, r0
+ and r4, r0
+ rts
+ and #0x7c, r0
+
+.global feclearexcept
+.type feclearexcept, @function
+feclearexcept:
+ mov r4, r0
+ and #0x7c, r0
+ not r0, r4
+ sts fpscr, r0
+ and r4, r0
+ lds r0, fpscr
+ rts
+ mov #0, r0
+
+.global feraiseexcept
+.type feraiseexcept, @function
+feraiseexcept:
+ mov r4, r0
+ and #0x7c, r0
+ sts fpscr, r4
+ or r4, r0
+ lds r0, fpscr
+ rts
+ mov #0, r0
+
+.global fegetenv
+.type fegetenv, @function
+fegetenv:
+ sts fpscr, r0
+ mov.l r0, @r4
+ rts
+ mov #0, r0
+
+.global fesetenv
+.type fesetenv, @function
+fesetenv:
+ mov r4, r0
+ cmp/eq #-1, r0
+ bf 1f
+
+ ! the default environment is complicated by the fact that we need to
+ ! preserve the current precision bit, which we do not know a priori
+ sts fpscr, r0
+ mov #8, r1
+ swap.w r1, r1
+ bra 2f
+ and r1, r0
+
+1: mov.l @r4, r0 ! non-default environment
+2: lds r0, fpscr
+ rts
+ mov #0, r0
+
+#endif
+++ /dev/null
-.global fegetround
-.type fegetround, @function
-fegetround:
- sts fpscr, r0
- rts
- and #3, r0
-
-.global __fesetround
-.type __fesetround, @function
-__fesetround:
- sts fpscr, r0
- or r4, r0
- lds r0, fpscr
- rts
- mov #0, r0
-
-.global fetestexcept
-.type fetestexcept, @function
-fetestexcept:
- sts fpscr, r0
- and r4, r0
- rts
- and #0x7c, r0
-
-.global feclearexcept
-.type feclearexcept, @function
-feclearexcept:
- mov r4, r0
- and #0x7c, r0
- not r0, r4
- sts fpscr, r0
- and r4, r0
- lds r0, fpscr
- rts
- mov #0, r0
-
-.global feraiseexcept
-.type feraiseexcept, @function
-feraiseexcept:
- mov r4, r0
- and #0x7c, r0
- sts fpscr, r4
- or r4, r0
- lds r0, fpscr
- rts
- mov #0, r0
-
-.global fegetenv
-.type fegetenv, @function
-fegetenv:
- sts fpscr, r0
- mov.l r0, @r4
- rts
- mov #0, r0
-
-.global fesetenv
-.type fesetenv, @function
-fesetenv:
- mov r4, r0
- cmp/eq #-1, r0
- bf 1f
-
- ! the default environment is complicated by the fact that we need to
- ! preserve the current precision bit, which we do not know a priori
- sts fpscr, r0
- mov #8, r1
- swap.w r1, r1
- bra 2f
- and r1, r0
-
-1: mov.l @r4, r0 ! non-default environment
-2: lds r0, fpscr
- rts
- mov #0, r0