xref: /third_party/musl/src/fenv/arm/fenv-hf.S (revision 570af302)
1570af302Sopenharmony_ci#if __ARM_PCS_VFP
2570af302Sopenharmony_ci
3570af302Sopenharmony_ci.syntax unified
4570af302Sopenharmony_ci.fpu vfp
5570af302Sopenharmony_ci
6570af302Sopenharmony_ci.global fegetround
7570af302Sopenharmony_ci.type fegetround,%function
8570af302Sopenharmony_cifegetround:
9570af302Sopenharmony_ci	fmrx r0, fpscr
10570af302Sopenharmony_ci	and r0, r0, #0xc00000
11570af302Sopenharmony_ci	bx lr
12570af302Sopenharmony_ci
13570af302Sopenharmony_ci.global __fesetround
14570af302Sopenharmony_ci.hidden __fesetround
15570af302Sopenharmony_ci.type __fesetround,%function
16570af302Sopenharmony_ci__fesetround:
17570af302Sopenharmony_ci	fmrx r3, fpscr
18570af302Sopenharmony_ci	bic r3, r3, #0xc00000
19570af302Sopenharmony_ci	orr r3, r3, r0
20570af302Sopenharmony_ci	fmxr fpscr, r3
21570af302Sopenharmony_ci	mov r0, #0
22570af302Sopenharmony_ci	bx lr
23570af302Sopenharmony_ci
24570af302Sopenharmony_ci.global fetestexcept
25570af302Sopenharmony_ci.type fetestexcept,%function
26570af302Sopenharmony_cifetestexcept:
27570af302Sopenharmony_ci	and r0, r0, #0x1f
28570af302Sopenharmony_ci	fmrx r3, fpscr
29570af302Sopenharmony_ci	and r0, r0, r3
30570af302Sopenharmony_ci	bx lr
31570af302Sopenharmony_ci
32570af302Sopenharmony_ci.global feclearexcept
33570af302Sopenharmony_ci.type feclearexcept,%function
34570af302Sopenharmony_cifeclearexcept:
35570af302Sopenharmony_ci	and r0, r0, #0x1f
36570af302Sopenharmony_ci	fmrx r3, fpscr
37570af302Sopenharmony_ci	bic r3, r3, r0
38570af302Sopenharmony_ci	fmxr fpscr, r3
39570af302Sopenharmony_ci	mov r0, #0
40570af302Sopenharmony_ci	bx lr
41570af302Sopenharmony_ci
42570af302Sopenharmony_ci.global feraiseexcept
43570af302Sopenharmony_ci.type feraiseexcept,%function
44570af302Sopenharmony_ciferaiseexcept:
45570af302Sopenharmony_ci	and r0, r0, #0x1f
46570af302Sopenharmony_ci	fmrx r3, fpscr
47570af302Sopenharmony_ci	orr r3, r3, r0
48570af302Sopenharmony_ci	fmxr fpscr, r3
49570af302Sopenharmony_ci	mov r0, #0
50570af302Sopenharmony_ci	bx lr
51570af302Sopenharmony_ci
52570af302Sopenharmony_ci.global fegetenv
53570af302Sopenharmony_ci.type fegetenv,%function
54570af302Sopenharmony_cifegetenv:
55570af302Sopenharmony_ci	fmrx r3, fpscr
56570af302Sopenharmony_ci	str r3, [r0]
57570af302Sopenharmony_ci	mov r0, #0
58570af302Sopenharmony_ci	bx lr
59570af302Sopenharmony_ci
60570af302Sopenharmony_ci.global fesetenv
61570af302Sopenharmony_ci.type fesetenv,%function
62570af302Sopenharmony_cifesetenv:
63570af302Sopenharmony_ci	cmn r0, #1
64570af302Sopenharmony_ci	moveq r3, #0
65570af302Sopenharmony_ci	ldrne r3, [r0]
66570af302Sopenharmony_ci	fmxr fpscr, r3
67570af302Sopenharmony_ci	mov r0, #0
68570af302Sopenharmony_ci	bx lr
69570af302Sopenharmony_ci
70570af302Sopenharmony_ci#endif
71