Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

390 lines
10 KiB

  1. // ******************************
  2. // Intel Confidential
  3. // ******************************
  4. #ifndef _EM_INSTR_H
  5. #define _EM_INSTR_H
  6. #include "fepublic.h"
  7. static EM_fp_reg_type
  8. fp_ieee_recip(
  9. EM_fp_reg_type den);
  10. static EM_fp_reg_type
  11. fp_ieee_recip_sqrt(
  12. EM_fp_reg_type root);
  13. // ********************************
  14. // Instruction Pages Prototypes
  15. // ********************************
  16. // Floating-point Multiply Add
  17. static INLINE void
  18. _fma(EM_state_type *ps,
  19. EM_opcode_pc_type pc,
  20. EM_opcode_sf_type sf,
  21. EM_uint_t qp,
  22. EM_uint_t f1,
  23. EM_uint_t f3,
  24. EM_uint_t f4,
  25. EM_uint_t f2);
  26. // Floating-point Parallel Multiply Add
  27. static INLINE void
  28. _fpma(EM_state_type *ps,
  29. EM_opcode_sf_type sf,
  30. EM_uint_t qp,
  31. EM_uint_t f1,
  32. EM_uint_t f3,
  33. EM_uint_t f4,
  34. EM_uint_t f2);
  35. // Floating-point Multiply Subtract
  36. static INLINE void
  37. _fms(EM_state_type *ps,
  38. EM_opcode_pc_type pc,
  39. EM_opcode_sf_type sf,
  40. EM_uint_t qp,
  41. EM_uint_t f1,
  42. EM_uint_t f3,
  43. EM_uint_t f4,
  44. EM_uint_t f2);
  45. // Floating-point Parallel Multiply Subtract
  46. static INLINE void
  47. _fpms(EM_state_type *ps,
  48. EM_opcode_sf_type sf,
  49. EM_uint_t qp,
  50. EM_uint_t f1,
  51. EM_uint_t f3,
  52. EM_uint_t f4,
  53. EM_uint_t f2);
  54. // Floating-point Negative Multiply Add
  55. static INLINE void
  56. _fnma(EM_state_type *ps,
  57. EM_opcode_pc_type pc,
  58. EM_opcode_sf_type sf,
  59. EM_uint_t qp,
  60. EM_uint_t f1,
  61. EM_uint_t f3,
  62. EM_uint_t f4,
  63. EM_uint_t f2);
  64. // Floating-point Parallel Negative Multiply Add
  65. static INLINE void
  66. _fpnma(EM_state_type *ps,
  67. EM_opcode_sf_type sf,
  68. EM_uint_t qp,
  69. EM_uint_t f1,
  70. EM_uint_t f3,
  71. EM_uint_t f4,
  72. EM_uint_t f2);
  73. // Floating-point Compare
  74. static INLINE void
  75. _fcmp(EM_state_type *ps,
  76. EM_opcode_frel_type frel,
  77. EM_opcode_ctype_type ctype,
  78. EM_opcode_sf_type sf,
  79. EM_uint_t qp,
  80. EM_uint_t p1,
  81. EM_uint_t p2,
  82. EM_uint_t f2,
  83. EM_uint_t f3);
  84. // Floating-point Reciprocal Approximation
  85. static INLINE void
  86. _frcpa(EM_state_type *ps,
  87. EM_opcode_sf_type sf,
  88. EM_uint_t qp,
  89. EM_uint_t f1,
  90. EM_uint_t p2,
  91. EM_uint_t f2,
  92. EM_uint_t f3);
  93. // Floating-point Parallel Reciprocal Approximation
  94. static INLINE void
  95. _fprcpa(EM_state_type *ps,
  96. EM_opcode_sf_type sf,
  97. EM_uint_t qp,
  98. EM_uint_t f1,
  99. EM_uint_t p2,
  100. EM_uint_t f2,
  101. EM_uint_t f3);
  102. // Floating-point Reciprocal Square Root Approximation
  103. static INLINE void
  104. _frsqrta(EM_state_type *ps,
  105. EM_opcode_sf_type sf,
  106. EM_uint_t qp,
  107. EM_uint_t f1,
  108. EM_uint_t p2,
  109. EM_uint_t f3);
  110. // Floating-point Parallel Reciprocal Square Root Approximation
  111. static INLINE void
  112. _fprsqrta(EM_state_type *ps,
  113. EM_opcode_sf_type sf,
  114. EM_uint_t qp,
  115. EM_uint_t f1,
  116. EM_uint_t p2,
  117. EM_uint_t f3);
  118. // Floating-point Minimum
  119. static INLINE void
  120. _fmin(EM_state_type *ps,
  121. EM_opcode_sf_type sf,
  122. EM_uint_t qp,
  123. EM_uint_t f1,
  124. EM_uint_t f2,
  125. EM_uint_t f3);
  126. static INLINE void
  127. _fmax(EM_state_type *ps,
  128. EM_opcode_sf_type sf,
  129. EM_uint_t qp,
  130. EM_uint_t f1,
  131. EM_uint_t f2,
  132. EM_uint_t f3);
  133. // Floating-point Absolute Minimum
  134. static INLINE void
  135. _famin(EM_state_type *ps,
  136. EM_opcode_sf_type sf,
  137. EM_uint_t qp,
  138. EM_uint_t f1,
  139. EM_uint_t f2,
  140. EM_uint_t f3);
  141. // Floating-point Absolute Maximum
  142. static INLINE void
  143. _famax(EM_state_type *ps,
  144. EM_opcode_sf_type sf,
  145. EM_uint_t qp,
  146. EM_uint_t f1,
  147. EM_uint_t f2,
  148. EM_uint_t f3);
  149. // Floating-point Parallel Minimum
  150. static INLINE void
  151. _fpmin(EM_state_type *ps,
  152. EM_opcode_sf_type sf,
  153. EM_uint_t qp,
  154. EM_uint_t f1,
  155. EM_uint_t f2,
  156. EM_uint_t f3);
  157. // Floating-point Parallel Minimum
  158. static INLINE void
  159. _fpmax(EM_state_type *ps,
  160. EM_opcode_sf_type sf,
  161. EM_uint_t qp,
  162. EM_uint_t f1,
  163. EM_uint_t f2,
  164. EM_uint_t f3);
  165. // Floating-point Parallel Absolute Minimum
  166. static INLINE void
  167. _fpamin(EM_state_type *ps,
  168. EM_opcode_sf_type sf,
  169. EM_uint_t qp,
  170. EM_uint_t f1,
  171. EM_uint_t f2,
  172. EM_uint_t f3);
  173. // Floating-point Parallel Absolute Maximum
  174. static INLINE void
  175. _fpamax(EM_state_type *ps,
  176. EM_opcode_sf_type sf,
  177. EM_uint_t qp,
  178. EM_uint_t f1,
  179. EM_uint_t f2,
  180. EM_uint_t f3);
  181. // Floating-point Parallel Compare
  182. static INLINE void
  183. _fpcmp(EM_state_type *ps,
  184. EM_opcode_frel_type frel,
  185. EM_opcode_sf_type sf,
  186. EM_uint_t qp,
  187. EM_uint_t f1,
  188. EM_uint_t f2,
  189. EM_uint_t f3);
  190. // Convert Floating-point to Integer
  191. static INLINE void
  192. _fcvt_fx(EM_state_type *ps,
  193. EM_opcode_sf_type sf,
  194. EM_uint_t qp,
  195. EM_uint_t f1,
  196. EM_uint_t f2);
  197. // Parallel Convert Floating-point to Integer
  198. static INLINE void
  199. _fpcvt_fx(EM_state_type *ps,
  200. EM_opcode_sf_type sf,
  201. EM_uint_t qp,
  202. EM_uint_t f1,
  203. EM_uint_t f2);
  204. #endif
  205. #undef GETSTATE_F1
  206. #undef PUTSTATE_F1
  207. #undef GETSTATE_F4
  208. #undef PUTSTATE_F4
  209. #undef GETSTATE_F6
  210. #undef PUTSTATE_F6
  211. #undef GETSTATE_F7
  212. #undef PUTSTATE_F7
  213. #undef GETSTATE_F8
  214. #undef PUTSTATE_F8
  215. #undef GETSTATE_F10
  216. #undef PUTSTATE_F10
  217. #define GETSTATE_F1(qp,f1,f3,f4,f2) _GETSTATE_F1(ps, qp,f1,f3,f4,f2)
  218. #define PUTSTATE_F1(f1) _PUTSTATE_F1(ps, f1)
  219. #define GETSTATE_F4(qp,p1,p2,f2,f3) _GETSTATE_F4(ps, qp,p1,p2,f2,f3)
  220. #define PUTSTATE_F4(p1,p2) _PUTSTATE_F4(ps, p1,p2)
  221. #define GETSTATE_F6(qp,f1,p2,f2,f3) _GETSTATE_F6(ps,qp,f1,p2,f2,f3)
  222. #define PUTSTATE_F6(f1,p2) _PUTSTATE_F6(ps,f1,p2)
  223. #define GETSTATE_F7(qp,f1,p2,f3) _GETSTATE_F7(ps, qp,f1,p2,f3)
  224. #define PUTSTATE_F7(f1,p2) _PUTSTATE_F7(ps, f1,p2)
  225. #define GETSTATE_F8(qp,f1,f2,f3) _GETSTATE_F8(ps, qp,f1,f2,f3)
  226. #define PUTSTATE_F8(f1) _PUTSTATE_F8(ps, f1)
  227. #define GETSTATE_F10(qp,f1,f2) _GETSTATE_F10(ps, qp,f1,f2)
  228. #define PUTSTATE_F10(f1) _PUTSTATE_F10(ps, f1)
  229. /***********************************************************
  230. undefs
  231. ************************************************************/
  232. #undef fp_reg_disabled
  233. #undef fp_reg_read_hi
  234. #undef fp_reg_read_lo
  235. #undef fp_ieee_rnd_to_int
  236. #undef fp_ieee_rnd_to_int_sp
  237. #undef fp_ieee_round_sp
  238. #undef fp_ieee_round
  239. #undef fminmax_exception_fault_check
  240. #undef fpminmax_exception_fault_check
  241. #undef fcmp_exception_fault_check
  242. #undef fpcmp_exception_fault_check
  243. #undef fcvt_exception_fault_check
  244. #undef fpcvt_exception_fault_check
  245. #undef fma_exception_fault_check
  246. #undef fpma_exception_fault_check
  247. #undef fms_fnma_exception_fault_check
  248. #undef fpms_fpnma_exception_fault_check
  249. #undef frcpa_exception_fault_check
  250. #undef fprcpa_exception_fault_check
  251. #undef frsqrta_exception_fault_check
  252. #undef fprsqrta_exception_fault_check
  253. #undef illegal_operation_fault
  254. #undef fp_check_target_register
  255. #undef fp_exception_fault
  256. #undef fp_exception_trap
  257. #undef disabled_fp_register_fault
  258. #undef fp_update_fpsr
  259. #undef fp_update_psr
  260. /***********************************************************
  261. redefinitions
  262. ************************************************************/
  263. #define fp_reg_disabled(f1,f2,f3,f4) fp82_fp_reg_disabled(ps, f1,f2,f3,f4)
  264. #define fp_reg_read_hi(f2) fp82_reg_read_hi(ps,f2)
  265. #define fp_reg_read_lo(f3) fp82_reg_read_lo(ps,f3)
  266. #define fp_ieee_rnd_to_int(arg1,arg2) \
  267. fp82_fp_ieee_rnd_to_int(ps, arg1, arg2)
  268. #define fp_ieee_rnd_to_int_sp(arg1,arg2, arg3) \
  269. fp82_fp_ieee_rnd_to_int_sp(ps, arg1, arg2, arg3)
  270. #define fp_ieee_round_sp(arg1, arg2, arg3) \
  271. fp82_fp_ieee_round_sp(ps, arg1, arg2, arg3)
  272. #define fp_ieee_round(arg1, arg2) \
  273. fp82_fp_ieee_round(ps, arg1, arg2)
  274. #define fminmax_exception_fault_check(arg1, arg2, arg3, arg4) \
  275. fp82_fminmax_exception_fault_check(ps, arg1, arg2, arg3, arg4)
  276. #define fpminmax_exception_fault_check(arg1, arg2, arg3, arg4) \
  277. fp82_fpminmax_exception_fault_check(ps, arg1, arg2, arg3, arg4)
  278. #define fcmp_exception_fault_check(arg1, arg2, arg3, arg4, arg5) \
  279. fp82_fcmp_exception_fault_check(ps, arg1, arg2, arg3, arg4, arg5)
  280. #define fpcmp_exception_fault_check(arg1, arg2, arg3, arg4, arg5) \
  281. fp82_fpcmp_exception_fault_check(ps, arg1, arg2, arg3, arg4, arg5)
  282. #define fcvt_exception_fault_check(arg1, arg2, arg3, arg4, arg5) \
  283. fp82_fcvt_exception_fault_check(ps, arg1, arg2, arg3, arg4, arg5)
  284. #define fpcvt_exception_fault_check(arg1, arg2, arg3, arg4, arg5) \
  285. fp82_fpcvt_exception_fault_check(ps, arg1, arg2, arg3, arg4, arg5)
  286. #define fma_exception_fault_check(arg1, arg2, arg3, arg4, arg5, arg6) \
  287. fp82_fma_exception_fault_check(ps, arg1, arg2, arg3, arg4, arg5, arg6)
  288. #define fpma_exception_fault_check(arg1, arg2, arg3, arg4, arg5) \
  289. fp82_fpma_exception_fault_check(ps, arg1, arg2, arg3, arg4, arg5)
  290. #define fms_fnma_exception_fault_check(arg1, arg2, arg3, arg4, arg5, arg6) \
  291. fp82_fms_fnma_exception_fault_check(ps, arg1, arg2, arg3, arg4, arg5, arg6)
  292. #define fpms_fpnma_exception_fault_check(arg1, arg2, arg3, arg4, arg5) \
  293. fp82_fpms_fpnma_exception_fault_check(ps, arg1, arg2, arg3, arg4, arg5)
  294. #define frcpa_exception_fault_check(arg1, arg2, arg3, arg4) \
  295. fp82_frcpa_exception_fault_check(ps, arg1, arg2, arg3, arg4)
  296. #define fprcpa_exception_fault_check(arg1, arg2, arg3, arg4, arg5) \
  297. fp82_fprcpa_exception_fault_check(ps, arg1, arg2, arg3, arg4, arg5)
  298. #define frsqrta_exception_fault_check(arg1, arg2, arg3) \
  299. fp82_frsqrta_exception_fault_check(ps, arg1, arg2, arg3)
  300. #define fprsqrta_exception_fault_check(arg1, arg2, arg3, arg4) \
  301. fp82_fprsqrta_exception_fault_check(ps, arg1, arg2, arg3, arg4)
  302. #define illegal_operation_fault( NON_RS) \
  303. fp82_illegal_operation_fault(ps, NON_RS)
  304. #define fp_check_target_register( reg_specifier) \
  305. fp82_fp_check_target_register(ps, reg_specifier)
  306. #define fp_exception_fault( tmp) \
  307. fp82_fp_exception_fault(ps, tmp)
  308. #define fp_exception_trap( tmp) \
  309. fp82_fp_exception_trap(ps, tmp)
  310. #define disabled_fp_register_fault(isr_code, itype) \
  311. fp82_disabled_fp_register_fault(ps, isr_code, itype)
  312. #define fp_update_fpsr(sf, tmp_env) fp82_fp_update_fpsr(ps,sf, tmp_env)
  313. #define fp_update_psr(dest_freg) fp82_fp_update_psr(ps,dest_freg)