1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#include <asm/asmmacro.h>
18
19#ifdef MODULO
20# define OP mod
21#else
22# define OP div
23#endif
24
25#ifdef UNSIGNED
26# define SGN u
27# define INT_TO_FP(a,b) fcvt.xuf.s1 a=b
28# define FP_TO_INT(a,b) fcvt.fxu.trunc.s1 a=b
29#else
30# define SGN
31# define INT_TO_FP(a,b) fcvt.xf a=b
32# define FP_TO_INT(a,b) fcvt.fx.trunc.s1 a=b
33#endif
34
35#define PASTE1(a,b) a
36#define PASTE(a,b) PASTE1(a,b)
37#define NAME PASTE(PASTE(__,SGN),PASTE(OP,di3))
38
39GLOBAL_ENTRY(NAME)
40 .regstk 2,0,0,0
41
42 setf.sig f8 = in0
43 setf.sig f9 = in1
44 ;;
45
46 INT_TO_FP(f8, f8)
47 INT_TO_FP(f9, f9)
48 ;;
49 frcpa.s1 f11, p6 = f8, f9
50 ;;
51(p6) fmpy.s1 f7 = f8, f11
52(p6) fnma.s1 f6 = f9, f11, f1
53 ;;
54(p6) fma.s1 f10 = f7, f6, f7
55(p6) fmpy.s1 f7 = f6, f6
56 ;;
57#ifdef MODULO
58 sub in1 = r0, in1
59#endif
60(p6) fma.s1 f10 = f10, f7, f10
61(p6) fma.s1 f6 = f11, f6, f11
62 ;;
63(p6) fma.s1 f6 = f6, f7, f6
64(p6) fnma.s1 f7 = f9, f10, f8
65 ;;
66#ifdef MODULO
67 setf.sig f8 = in0
68 setf.sig f9 = in1
69#endif
70(p6) fma.s1 f11 = f7, f6, f10
71 ;;
72 FP_TO_INT(f11, f11)
73 ;;
74#ifdef MODULO
75 xma.l f11 = f11, f9, f8
76 ;;
77#endif
78 getf.sig r8 = f11
79 br.ret.sptk.many rp
80END(NAME)
81