📄 fpopcode.h
字号:
/* dyadic arithmetic opcodes. */#define ADF_CODE 0x00000000#define MUF_CODE 0x00100000#define SUF_CODE 0x00200000#define RSF_CODE 0x00300000#define DVF_CODE 0x00400000#define RDF_CODE 0x00500000#define POW_CODE 0x00600000#define RPW_CODE 0x00700000#define RMF_CODE 0x00800000#define FML_CODE 0x00900000#define FDV_CODE 0x00a00000#define FRD_CODE 0x00b00000#define POL_CODE 0x00c00000/* 0x00d00000 is an invalid dyadic arithmetic opcode *//* 0x00e00000 is an invalid dyadic arithmetic opcode *//* 0x00f00000 is an invalid dyadic arithmetic opcode *//* monadic arithmetic opcodes. */#define MVF_CODE 0x00008000#define MNF_CODE 0x00108000#define ABS_CODE 0x00208000#define RND_CODE 0x00308000#define SQT_CODE 0x00408000#define LOG_CODE 0x00508000#define LGN_CODE 0x00608000#define EXP_CODE 0x00708000#define SIN_CODE 0x00808000#define COS_CODE 0x00908000#define TAN_CODE 0x00a08000#define ASN_CODE 0x00b08000#define ACS_CODE 0x00c08000#define ATN_CODE 0x00d08000#define URD_CODE 0x00e08000#define NRM_CODE 0x00f08000/*====== Definitions for register transfer and comparison instructions===*/#define MASK_CPRT 0x0e000010 /* register transfer opcode */#define MASK_CPRT_CODE 0x00f00000#define FLT_CODE 0x00000000#define FIX_CODE 0x00100000#define WFS_CODE 0x00200000#define RFS_CODE 0x00300000#define WFC_CODE 0x00400000#define RFC_CODE 0x00500000#define CMF_CODE 0x00900000#define CNF_CODE 0x00b00000#define CMFE_CODE 0x00d00000#define CNFE_CODE 0x00f00000/*====== Common definitions===*//* register masks */#define MASK_Rd 0x0000f000#define MASK_Rn 0x000f0000#define MASK_Fd 0x00007000#define MASK_Fm 0x00000007#define MASK_Fn 0x00070000/* condition code masks */#define CC_MASK 0xf0000000#define CC_NEGATIVE 0x80000000#define CC_ZERO 0x40000000#define CC_CARRY 0x20000000#define CC_OVERFLOW 0x10000000#define CC_EQ 0x00000000#define CC_NE 0x10000000#define CC_CS 0x20000000#define CC_HS CC_CS#define CC_CC 0x30000000#define CC_LO CC_CC#define CC_MI 0x40000000#define CC_PL 0x50000000#define CC_VS 0x60000000#define CC_VC 0x70000000#define CC_HI 0x80000000#define CC_LS 0x90000000#define CC_GE 0xa0000000#define CC_LT 0xb0000000#define CC_GT 0xc0000000#define CC_LE 0xd0000000#define CC_AL 0xe0000000#define CC_NV 0xf0000000/* rounding masks/values */#define MASK_ROUNDING_MODE 0x00000060#define ROUND_TO_NEAREST 0x00000000#define ROUND_TO_PLUS_INFINITY 0x00000020#define ROUND_TO_MINUS_INFINITY 0x00000040#define ROUND_TO_ZERO 0x00000060#define MASK_ROUNDING_PRECISION 0x00080080#define ROUND_SINGLE 0x00000000#define ROUND_DOUBLE 0x00000080#define ROUND_EXTENDED 0x00080000/* Get the condition code from the opcode. */#define getCondition(opcode) (opcode >> 28)/* Get the source register from the opcode. */#define getRn(opcode) ((opcode & MASK_Rn) >> 16)/* Get the destination floating point register from the opcode. */#define getFd(opcode) ((opcode & MASK_Fd) >> 12)/* Get the first source floating point register from the opcode. */#define getFn(opcode) ((opcode & MASK_Fn) >> 16)/* Get the second source floating point register from the opcode. */#define getFm(opcode) (opcode & MASK_Fm)/* Get the destination register from the opcode. */#define getRd(opcode) ((opcode & MASK_Rd) >> 12)/* Get the rounding mode from the opcode. */#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5)#ifdef CONFIG_FPE_NWFPE_XPstatic inline floatx80 __pure getExtendedConstant(const unsigned int nIndex){ extern const floatx80 floatx80Constant[]; return floatx80Constant[nIndex];}#endifstatic inline float64 __pure getDoubleConstant(const unsigned int nIndex){ extern const float64 float64Constant[]; return float64Constant[nIndex];}static inline float32 __pure getSingleConstant(const unsigned int nIndex){ extern const float32 float32Constant[]; return float32Constant[nIndex];}static inline unsigned int getTransferLength(const unsigned int opcode){ unsigned int nRc; switch (opcode & MASK_TRANSFER_LENGTH) { case 0x00000000: nRc = 1; break; /* single precision */ case 0x00008000: nRc = 2; break; /* double precision */ case 0x00400000: nRc = 3; break; /* extended precision */ default: nRc = 0; } return (nRc);}static inline unsigned int getRegisterCount(const unsigned int opcode){ unsigned int nRc; switch (opcode & MASK_REGISTER_COUNT) { case 0x00000000: nRc = 4; break; case 0x00008000: nRc = 1; break; case 0x00400000: nRc = 2; break; case 0x00408000: nRc = 3; break; default: nRc = 0; } return (nRc);}static inline unsigned int getRoundingPrecision(const unsigned int opcode){ unsigned int nRc; switch (opcode & MASK_ROUNDING_PRECISION) { case 0x00000000: nRc = 1; break; case 0x00000080: nRc = 2; break; case 0x00080000: nRc = 3; break; default: nRc = 0; } return (nRc);}static inline unsigned int getDestinationSize(const unsigned int opcode){ unsigned int nRc; switch (opcode & MASK_DESTINATION_SIZE) { case 0x00000000: nRc = typeSingle; break; case 0x00000080: nRc = typeDouble; break; case 0x00080000: nRc = typeExtended; break; default: nRc = typeNone; } return (nRc);}extern unsigned int checkCondition(const unsigned int opcode, const unsigned int ccodes);extern const float64 float64Constant[];extern const float32 float32Constant[];#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -