0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __FPA11_H__
0011 #define __FPA11_H__
0012
0013 #define GET_FPA11() ((FPA11 *)(¤t_thread_info()->fpstate))
0014
0015
0016
0017
0018
0019
0020 #define GET_USERREG() ((struct pt_regs *)(THREAD_START_SP + (unsigned long)current_thread_info()) - 1)
0021
0022 #include <linux/thread_info.h>
0023
0024
0025 #include "fpsr.h" /* FP control and status register definitions */
0026 #include "milieu.h"
0027
0028 struct roundingData {
0029 int8 mode;
0030 int8 precision;
0031 signed char exception;
0032 };
0033
0034 #include "softfloat.h"
0035
0036 #define typeNone 0x00
0037 #define typeSingle 0x01
0038 #define typeDouble 0x02
0039 #define typeExtended 0x03
0040
0041
0042
0043
0044 typedef union tagFPREG {
0045 float32 fSingle;
0046 float64 fDouble;
0047 #ifdef CONFIG_FPE_NWFPE_XP
0048 floatx80 fExtended;
0049 #else
0050 u32 padding[3];
0051 #endif
0052 } __attribute__ ((packed,aligned(4))) FPREG;
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 typedef struct tagFPA11 {
0068 FPREG fpreg[8];
0069 FPSR fpsr;
0070 FPCR fpcr;
0071 unsigned char fType[8];
0072
0073
0074 int initflag;
0075
0076
0077
0078
0079 } __attribute__ ((packed,aligned(4))) FPA11;
0080
0081 extern int8 SetRoundingMode(const unsigned int);
0082 extern int8 SetRoundingPrecision(const unsigned int);
0083 extern void nwfpe_init_fpa(union fp_state *fp);
0084
0085 extern unsigned int EmulateAll(unsigned int opcode);
0086
0087 extern unsigned int EmulateCPDT(const unsigned int opcode);
0088 extern unsigned int EmulateCPDO(const unsigned int opcode);
0089 extern unsigned int EmulateCPRT(const unsigned int opcode);
0090
0091
0092 extern unsigned int PerformLDF(const unsigned int opcode);
0093 extern unsigned int PerformSTF(const unsigned int opcode);
0094 extern unsigned int PerformLFM(const unsigned int opcode);
0095 extern unsigned int PerformSFM(const unsigned int opcode);
0096
0097
0098
0099 extern unsigned int SingleCPDO(struct roundingData *roundData,
0100 const unsigned int opcode, FPREG * rFd);
0101
0102 extern unsigned int DoubleCPDO(struct roundingData *roundData,
0103 const unsigned int opcode, FPREG * rFd);
0104
0105
0106 extern unsigned int ExtendedCPDO(struct roundingData *roundData,
0107 const unsigned int opcode, FPREG * rFd);
0108
0109 #endif