1
2
3
4
5
6
7
8
9
10#ifndef __FPA11_H__
11#define __FPA11_H__
12
13#define GET_FPA11() ((FPA11 *)(¤t_thread_info()->fpstate))
14
15
16
17
18
19
20#define GET_USERREG() ((struct pt_regs *)(THREAD_START_SP + (unsigned long)current_thread_info()) - 1)
21
22#include <linux/thread_info.h>
23
24
25#include "fpsr.h"
26#include "milieu.h"
27
28struct roundingData {
29 int8 mode;
30 int8 precision;
31 signed char exception;
32};
33
34#include "softfloat.h"
35
36#define typeNone 0x00
37#define typeSingle 0x01
38#define typeDouble 0x02
39#define typeExtended 0x03
40
41
42
43
44typedef union tagFPREG {
45 float32 fSingle;
46 float64 fDouble;
47#ifdef CONFIG_FPE_NWFPE_XP
48 floatx80 fExtended;
49#else
50 u32 padding[3];
51#endif
52} __attribute__ ((packed,aligned(4))) FPREG;
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67typedef struct tagFPA11 {
68 FPREG fpreg[8];
69 FPSR fpsr;
70 FPCR fpcr;
71 unsigned char fType[8];
72
73
74 int initflag;
75
76
77
78
79} __attribute__ ((packed,aligned(4))) FPA11;
80
81extern int8 SetRoundingMode(const unsigned int);
82extern int8 SetRoundingPrecision(const unsigned int);
83extern void nwfpe_init_fpa(union fp_state *fp);
84
85extern unsigned int EmulateAll(unsigned int opcode);
86
87extern unsigned int EmulateCPDT(const unsigned int opcode);
88extern unsigned int EmulateCPDO(const unsigned int opcode);
89extern unsigned int EmulateCPRT(const unsigned int opcode);
90
91
92extern unsigned int PerformLDF(const unsigned int opcode);
93extern unsigned int PerformSTF(const unsigned int opcode);
94extern unsigned int PerformLFM(const unsigned int opcode);
95extern unsigned int PerformSFM(const unsigned int opcode);
96
97
98
99extern unsigned int SingleCPDO(struct roundingData *roundData,
100 const unsigned int opcode, FPREG * rFd);
101
102extern unsigned int DoubleCPDO(struct roundingData *roundData,
103 const unsigned int opcode, FPREG * rFd);
104
105
106extern unsigned int ExtendedCPDO(struct roundingData *roundData,
107 const unsigned int opcode, FPREG * rFd);
108
109#endif
110