Leaked source code of windows server 2003
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.

1193 lines
36 KiB

  1. /*****************************************************************/
  2. /* Copyright (c) 1998 Intel Corporation */
  3. /* */
  4. /* All rights reserved. No part of this program or publication */
  5. /* may be reproduced, transmitted, transcribed, stored in a */
  6. /* retrieval system, or translated into any language or computer */
  7. /* language, in any form or by any means, electronic, mechanical */
  8. /* magnetic, optical, chemical, manual, or otherwise, without */
  9. /* the prior written permission of Intel Corporation. */
  10. /* */
  11. /*****************************************************************/
  12. /* INTEL CORPORATION PROPRIETARY INFORMATION */
  13. /* */
  14. /* */
  15. /*****************************************************************/
  16. /*++
  17. Module Name:
  18. debug.c
  19. Abstract:
  20. This module provides handy routines for debugging
  21. Author:
  22. Revision History:
  23. --*/
  24. #include <wtypes.h>
  25. #include <stdio.h>
  26. #include <conio.h>
  27. #include "fpieee.h"
  28. #include "xmmi_types.h"
  29. #include "temp_context.h"
  30. #include "filter.h"
  31. #include "debug.h"
  32. ULONG DebugFlag = 0;
  33. ULONG Console = 0;
  34. ULONG DebugImm8 = 0;
  35. ULONG NotOk = 0;
  36. #define DUMP_HEXL(pxmmi, num) { \
  37. PRINTF(("in Hex: ")); \
  38. for (i = 0; i < num; i++) { \
  39. PRINTF(("[%d] %x ", i, pxmmi->u.ul[i])); \
  40. } \
  41. PRINTF(("\n")); }
  42. #define DUMP_FS(pxmmi, num) { \
  43. PRINTF(("in Fflt: ")); \
  44. for (i = 0; i < num; i++) { \
  45. PRINTF(("[%d] %f ", i, pxmmi->u.fs[i])); \
  46. } \
  47. PRINTF(("\n")); }
  48. #define DUMP_HEXLL(pxmmi, num) { \
  49. PRINTF(("in Hex: ")); \
  50. for (i = 0; i < num; i++) { \
  51. PRINTF(("[%d] %I64x ", i, pxmmi->u.ull[i])); \
  52. } \
  53. PRINTF(("\n")); }
  54. #define DUMP_DS(pxmmi, num) { \
  55. PRINTF(("in Dflt: ")); \
  56. for (i = 0; i < num; i++) { \
  57. PRINTF(("[%d] %e ", i, pxmmi->u.fd[i])); \
  58. } \
  59. PRINTF(("\n")); }
  60. void
  61. print_Rounding(PXMMI_ENV XmmiEnv) {
  62. if (XmmiEnv->Ieee->RoundingMode == _FpRoundNearest) {
  63. PRINTF(("XmmiEnv->Ieee->RoundingMode = _FpRoundNearest\n"));
  64. } else {
  65. if (XmmiEnv->Ieee->RoundingMode == _FpRoundMinusInfinity) {
  66. PRINTF(("XmmiEnv->Ieee->RoundingMode = _FpRoundMinusInfinity\n"));
  67. } else {
  68. if (XmmiEnv->Ieee->RoundingMode == _FpRoundPlusInfinity) {
  69. PRINTF(("XmmiEnv->Ieee->RoundingMode = _FpRoundPlusInfinity\n"));
  70. } else {
  71. if (XmmiEnv->Ieee->RoundingMode == _FpRoundChopped) {
  72. PRINTF(("XmmiEnv->Ieee->RoundingMode = _FpRoundChopped\n"));
  73. } else {
  74. PRINTF(("XmmiEnv->Ieee->RoundingMode = UNKNOWN\n"));
  75. }
  76. }
  77. }
  78. }
  79. }
  80. void
  81. print_Precision(PXMMI_ENV XmmiEnv) {
  82. if (XmmiEnv->Ieee->Precision == _FpPrecision24) {
  83. PRINTF(("XmmiEnv->Ieee->Precision = _FpPrecision24\n"));
  84. } else {
  85. if (XmmiEnv->Ieee->Precision == _FpPrecision53) {
  86. PRINTF(("XmmiEnv->Ieee->Precision = _FpPrecision53\n"));
  87. } else {
  88. if (XmmiEnv->Ieee->Precision == _FpPrecisionFull) {
  89. PRINTF(("XmmiEnv->Ieee->Precision = _FpPrecisionFull\n"));
  90. } else {
  91. PRINTF(("XmmiEnv->Ieee->Precision = INCORRECT\n"));
  92. }
  93. }
  94. }
  95. }
  96. void
  97. print_CauseEnable(PXMMI_ENV XmmiEnv) {
  98. PRINTF(("XmmiEmv->Ieee->Cause: P=%x U=%x O=%x Z=%x I=%x\n",
  99. XmmiEnv->Ieee->Cause.Inexact, XmmiEnv->Ieee->Cause.Underflow,
  100. XmmiEnv->Ieee->Cause.Overflow, XmmiEnv->Ieee->Cause.ZeroDivide,
  101. XmmiEnv->Ieee->Cause.InvalidOperation));
  102. PRINTF(("XmmiEnv->Ieee->Enable: P=%x U=%x O=%x Z=%x I=%x\n",
  103. XmmiEnv->Ieee->Enable.Inexact, XmmiEnv->Ieee->Enable.Underflow,
  104. XmmiEnv->Ieee->Enable.Overflow, XmmiEnv->Ieee->Enable.ZeroDivide,
  105. XmmiEnv->Ieee->Enable.InvalidOperation));
  106. }
  107. void
  108. print_Status(PXMMI_ENV XmmiEnv) {
  109. PRINTF(("XmmiEnv->Ieee->Status: P=%x U=%x O=%x Z=%x I=%x\n",
  110. XmmiEnv->Ieee->Status.Inexact, XmmiEnv->Ieee->Status.Underflow,
  111. XmmiEnv->Ieee->Status.Overflow, XmmiEnv->Ieee->Status.ZeroDivide,
  112. XmmiEnv->Ieee->Status.InvalidOperation));
  113. }
  114. void
  115. print_Operations(PXMMI_ENV XmmiEnv) {
  116. switch (XmmiEnv->Ieee->Operation) {
  117. case OP_ADDPS:
  118. PRINTF(("XmmiEnv->Ieee->Operation = OP_ADDPS\n"));
  119. break;
  120. case OP_ADDSS:
  121. PRINTF(("XmmiEnv->Ieee->Operation = OP_ADDSS\n"));
  122. break;
  123. case OP_SUBPS:
  124. PRINTF(("XmmiEnv->Ieee->Operation = OP_SUBPS\n"));
  125. break;
  126. case OP_SUBSS:
  127. PRINTF(("XmmiEnv->Ieee->Operation = OP_SUBSS\n"));
  128. break;
  129. case OP_MULPS:
  130. PRINTF(("XmmiEnv->Ieee->Operation = OP_MULPS\n"));
  131. break;
  132. case OP_MULSS:
  133. PRINTF(("XmmiEnv->Ieee->Operation = OP_MULSS\n"));
  134. break;
  135. case OP_DIVPS:
  136. PRINTF(("XmmiEnv->Ieee->Operation = OP_DIVPS\n"));
  137. break;
  138. case OP_DIVSS:
  139. PRINTF(("XmmiEnv->Ieee->Operation = OP_DIVSS\n"));
  140. break;
  141. case OP_MAXPS:
  142. PRINTF(("XmmiEnv->Ieee->Operation = OP_MAXPS\n"));
  143. break;
  144. case OP_MAXSS:
  145. PRINTF(("XmmiEnv->Ieee->Operation = OP_MAXSS\n"));
  146. break;
  147. case OP_MINPS:
  148. PRINTF(("XmmiEnv->Ieee->Operation = OP_MINPS\n"));
  149. break;
  150. case OP_MINSS:
  151. PRINTF(("XmmiEnv->Ieee->Operation = OP_MINSS\n"));
  152. break;
  153. case OP_CVTPI2PS:
  154. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTPI2PS\n"));
  155. break;
  156. case OP_CVTSI2SS:
  157. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTSI2SS\n"));
  158. break;
  159. case OP_CVTPS2PI:
  160. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTPS2PI\n"));
  161. break;
  162. case OP_CVTSS2SI:
  163. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTSS2SI\n"));
  164. break;
  165. case OP_CVTTPS2PI:
  166. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTTPS2PI\n"));
  167. break;
  168. case OP_CVTTSS2SI:
  169. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTTSS2SI\n"));
  170. break;
  171. case OP_COMISS:
  172. PRINTF(("XmmiEnv->Ieee->Operation = OP_COMISS\n"));
  173. break;
  174. case OP_UCOMISS:
  175. PRINTF(("XmmiEnv->Ieee->Operation = OP_UCOMISS\n"));
  176. break;
  177. case OP_CMPPS:
  178. case OP_CMPSS:
  179. case OP_CMPPD:
  180. case OP_CMPSD:
  181. PRINTF(("XmmiEnv->Ieee->Operation = OP_CMPPS/CMPSS/CMPPD/CMPSD "));
  182. switch (XmmiEnv->Imm8 & 0x07) {
  183. case IMM8_EQ:
  184. PRINTF(("EQ\n"));
  185. break;
  186. case IMM8_UNORD:
  187. PRINTF(("UNORD\n"));
  188. break;
  189. case IMM8_NEQ:
  190. PRINTF(("NEQ\n"));
  191. break;
  192. case IMM8_ORD:
  193. PRINTF(("ORD\n"));
  194. break;
  195. case IMM8_LT:
  196. PRINTF(("LT\n"));
  197. break;
  198. case IMM8_LE:
  199. PRINTF(("LE\n"));
  200. break;
  201. case IMM8_NLT:
  202. PRINTF(("NLT\n"));
  203. break;
  204. case IMM8_NLE:
  205. PRINTF(("NLE\n"));
  206. break;
  207. default:
  208. ; // will never occur
  209. }
  210. break;
  211. case OP_SQRTPS:
  212. PRINTF(("XmmiEnv->Ieee->Operation = OP_SQRTPS\n"));
  213. break;
  214. case OP_SQRTSS:
  215. PRINTF(("XmmiEnv->Ieee->Operation = OP_SQRTSS\n"));
  216. break;
  217. case OP_ADDPD:
  218. PRINTF(("XmmiEnv->Ieee->Operation = OP_ADDPD\n"));
  219. break;
  220. case OP_ADDSD:
  221. PRINTF(("XmmiEnv->Ieee->Operation = OP_ADDSD\n"));
  222. break;
  223. case OP_SUBPD:
  224. PRINTF(("XmmiEnv->Ieee->Operation = OP_SUBPD\n"));
  225. break;
  226. case OP_SUBSD:
  227. PRINTF(("XmmiEnv->Ieee->Operation = OP_SUBSD\n"));
  228. break;
  229. case OP_MULPD:
  230. PRINTF(("XmmiEnv->Ieee->Operation = OP_MULPD\n"));
  231. break;
  232. case OP_MULSD:
  233. PRINTF(("XmmiEnv->Ieee->Operation = OP_MULSD\n"));
  234. break;
  235. case OP_DIVPD:
  236. PRINTF(("XmmiEnv->Ieee->Operation = OP_DIVPD\n"));
  237. break;
  238. case OP_DIVSD:
  239. PRINTF(("XmmiEnv->Ieee->Operation = OP_DIVSD\n"));
  240. break;
  241. case OP_SQRTPD:
  242. PRINTF(("XmmiEnv->Ieee->Operation = OP_SQRTPD\n"));
  243. break;
  244. case OP_SQRTSD:
  245. PRINTF(("XmmiEnv->Ieee->Operation = OP_SQRTSD\n"));
  246. break;
  247. case OP_MAXPD:
  248. PRINTF(("XmmiEnv->Ieee->Operation = OP_MAXPD\n"));
  249. break;
  250. case OP_MAXSD:
  251. PRINTF(("XmmiEnv->Ieee->Operation = OP_MAXSD\n"));
  252. break;
  253. case OP_MINPD:
  254. PRINTF(("XmmiEnv->Ieee->Operation = OP_MINPD\n"));
  255. break;
  256. case OP_MINSD:
  257. PRINTF(("XmmiEnv->Ieee->Operation = OP_MINSD\n"));
  258. break;
  259. case OP_COMISD:
  260. PRINTF(("XmmiEnv->Ieee->Operation = OP_COMISD\n"));
  261. break;
  262. case OP_UCOMISD:
  263. PRINTF(("XmmiEnv->Ieee->Operation = OP_UCOMISD\n"));
  264. break;
  265. case OP_CVTPD2PI:
  266. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTPD2PI\n"));
  267. break;
  268. case OP_CVTSD2SI:
  269. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTSD2SI\n"));
  270. break;
  271. case OP_CVTTPD2PI:
  272. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTTPD2PI\n"));
  273. break;
  274. case OP_CVTTSD2SI:
  275. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTTSD2SI\n"));
  276. break;
  277. case OP_CVTPS2PD:
  278. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTPS2PD\n"));
  279. break;
  280. case OP_CVTSS2SD:
  281. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTSS2SD\n"));
  282. break;
  283. case OP_CVTPD2PS:
  284. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTPD2PS\n"));
  285. break;
  286. case OP_CVTSD2SS:
  287. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTSD2SS\n"));
  288. break;
  289. case OP_CVTDQ2PS:
  290. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTDQ2PS\n"));
  291. break;
  292. case OP_CVTTPS2DQ:
  293. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTTPS2DQ\n"));
  294. break;
  295. case OP_CVTPS2DQ:
  296. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTPS2DQ\n"));
  297. break;
  298. case OP_CVTPD2DQ:
  299. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTPD2DQ\n"));
  300. break;
  301. case OP_CVTTPD2DQ:
  302. PRINTF(("XmmiEnv->Ieee->Operation = OP_CVTTPD2DQ\n"));
  303. break;
  304. default:
  305. PRINTF(("XmmiEnv->Ieee->Operation %d = UNKNOWN\n",
  306. XmmiEnv->Ieee->Operation));
  307. }
  308. }
  309. void
  310. print_Operand1(PXMMI_ENV XmmiEnv) {
  311. PRINTF(("XmmiEnv->Ieee->Operand1.OperandValid = %x\n",
  312. XmmiEnv->Ieee->Operand1.OperandValid));
  313. if (!XmmiEnv->Ieee->Operand1.OperandValid) return;
  314. if (XmmiEnv->Ieee->Operand1.Format == _FpFormatFp32) {
  315. PRINTF(("XmmiEnv->Ieee->Operand1.Format = _FpFormatFp32\n"));
  316. PRINTF(("XmmiEnv->Ieee->Operand1.Value.Fp32Value = %f = %x\n",
  317. (float)XmmiEnv->Ieee->Operand1.Value.Fp32Value,
  318. XmmiEnv->Ieee->Operand1.Value.U32Value));
  319. } else if (XmmiEnv->Ieee->Operand1.Format == _FpFormatU32) {
  320. PRINTF(("XmmiEnv->Ieee->Operand1.Format = _FpFormatU32\n"));
  321. PRINTF(("XmmiEnv->Ieee->Operand1.Value.U32Value = %d = %x\n",
  322. XmmiEnv->Ieee->Operand1.Value.U32Value,
  323. XmmiEnv->Ieee->Operand1.Value.U32Value));
  324. } else if (XmmiEnv->Ieee->Operand1.Format == _FpFormatI32) {
  325. PRINTF(("XmmiEnv->Ieee->Operand1.Format = _FpFormatI32\n"));
  326. PRINTF(("XmmiEnv->Ieee->Operand1.Value.I32Value = %d = %x\n",
  327. XmmiEnv->Ieee->Operand1.Value.I32Value,
  328. XmmiEnv->Ieee->Operand1.Value.U32Value));
  329. } else if (XmmiEnv->Ieee->Operand1.Format == _FpFormatFp64) {
  330. PRINTF(("XmmiEnv->Ieee->Operand1.Format = _FpFormatFp64\n"));
  331. PRINTF(("XmmiEnv->Ieee->Operand1.Value.Fp64Value = %e = %I64x\n",
  332. (double)XmmiEnv->Ieee->Operand1.Value.Fp64Value,
  333. XmmiEnv->Ieee->Operand1.Value.U64Value));
  334. } else {
  335. PRINTF(("XmmiEnv->Ieee->Operand1.Format = INCORRECT\n"));
  336. }
  337. }
  338. void
  339. print_Operand2(PXMMI_ENV XmmiEnv) {
  340. PRINTF(("XmmiEnv->Ieee->Operand2.OperandValid = %x\n",
  341. XmmiEnv->Ieee->Operand2.OperandValid));
  342. if (!XmmiEnv->Ieee->Operand2.OperandValid) return;
  343. if (XmmiEnv->Ieee->Operand2.Format == _FpFormatFp32) {
  344. PRINTF(("XmmiEnv->Ieee->Operand2.Format = _FpFormatFp32\n"));
  345. PRINTF(("XmmiEnv->Ieee->Operand2.Value.Fp32Value = %f = %x\n",
  346. (float)XmmiEnv->Ieee->Operand2.Value.Fp32Value,
  347. XmmiEnv->Ieee->Operand2.Value.U32Value));
  348. } else if (XmmiEnv->Ieee->Operand2.Format == _FpFormatU32) {
  349. PRINTF(("XmmiEnv->Ieee->Operand2.Format = _FpFormatU32\n"));
  350. PRINTF(("XmmiEnv->Ieee->Operand2.Value.U32Value = %d = %x\n",
  351. XmmiEnv->Ieee->Operand2.Value.U32Value,
  352. XmmiEnv->Ieee->Operand2.Value.U32Value));
  353. } else if (XmmiEnv->Ieee->Operand2.Format == _FpFormatI32) {
  354. PRINTF(("XmmiEnv->Ieee->Operand2.Format = _FpFormatI32\n"));
  355. PRINTF(("XmmiEnv->Ieee->Operand2.Value.I32Value = %d = %x\n",
  356. XmmiEnv->Ieee->Operand2.Value.I32Value,
  357. XmmiEnv->Ieee->Operand2.Value.U32Value));
  358. } else if (XmmiEnv->Ieee->Operand2.Format == _FpFormatFp64) {
  359. PRINTF(("XmmiEnv->Ieee->Operand2.Format = _FpFormatFp64\n"));
  360. PRINTF(("XmmiEnv->Ieee->Operand2.Value.Fp64Value = %e = %I64x\n",
  361. (double)XmmiEnv->Ieee->Operand2.Value.Fp64Value,
  362. XmmiEnv->Ieee->Operand2.Value.U64Value));
  363. } else {
  364. PRINTF(("XmmiEnv->Ieee->Operand2.Format = INCORRECT\n"));
  365. }
  366. }
  367. void
  368. print_Result(PXMMI_ENV XmmiEnv, BOOL Exception) {
  369. PRINTF(("XmmiEnv->Ieee->Result.OperandValid = %x\n",
  370. XmmiEnv->Ieee->Result.OperandValid));
  371. if (XmmiEnv->Ieee->Result.OperandValid) {
  372. if (XmmiEnv->Ieee->Result.Format == _FpFormatFp32) {
  373. PRINTF(("XmmiEnv->Ieee->Result.Format = _FpFormatFp32\n"));
  374. PRINTF(("XmmiEnv->Ieee->Result.Value.Fp32Value = %f = %x\n",
  375. (float)XmmiEnv->Ieee->Result.Value.Fp32Value,
  376. XmmiEnv->Ieee->Result.Value.U32Value));
  377. } else if (XmmiEnv->Ieee->Result.Format == _FpFormatU32) {
  378. PRINTF(("XmmiEnv->Ieee->Result.Format = _FpFormatU32\n"));
  379. PRINTF(("XmmiEnv->Ieee->Result.Value.U32Value = %d = %x\n",
  380. XmmiEnv->Ieee->Result.Value.U32Value,
  381. XmmiEnv->Ieee->Result.Value.U32Value));
  382. } else if (XmmiEnv->Ieee->Result.Format == _FpFormatI32) {
  383. PRINTF(("XmmiEnv->Ieee->Result.Format = _FpFormatI32\n"));
  384. PRINTF(("XmmiEnv->Ieee->Result.Value.I32Value = %d = %x\n",
  385. XmmiEnv->Ieee->Result.Value.I32Value,
  386. XmmiEnv->Ieee->Result.Value.U32Value));
  387. } else if (XmmiEnv->Ieee->Result.Format == _FpFormatFp64) {
  388. PRINTF(("XmmiEnv->Ieee->Result.Format = _FpFormatFp64\n"));
  389. PRINTF(("XmmiEnv->Ieee->Result.Value.Fp64Value = %e = %I64x\n",
  390. (double)XmmiEnv->Ieee->Result.Value.Fp64Value,
  391. XmmiEnv->Ieee->Result.Value.U64Value));
  392. } else {
  393. PRINTF(("XmmiEnv->Ieee->Result.Format = INCORRECT\n"));
  394. }
  395. }
  396. if (!Exception) {
  397. if (XmmiEnv->Ieee->Operation == _FpCodeCompare) {
  398. PRINTF(("XmmiEnv->EFlags = %x\n", XmmiEnv->EFlags));
  399. }
  400. }
  401. }
  402. void print_FPIEEE_RECORD_EXCEPTION (PXMMI_ENV XmmiEnv) {
  403. // print the FP IEEE record info
  404. PRINTF(("\nPRINTING FPIEEE_RECORD INFO (EXCEPTION):\n"));
  405. PRINTF(("XmmiEnv->Masks = %x\n", XmmiEnv->Masks));
  406. PRINTF(("XmmiEnv->Flags = %x\n", XmmiEnv->Flags));
  407. PRINTF(("XmmiEnv->Fz = %x\n", XmmiEnv->Fz));
  408. PRINTF(("XmmiEnv->Daz = %x\n", XmmiEnv->Daz));
  409. print_Rounding(XmmiEnv);
  410. print_Precision(XmmiEnv);
  411. print_CauseEnable(XmmiEnv);
  412. print_Status(XmmiEnv);
  413. print_Result(XmmiEnv, TRUE);
  414. PRINTF(("\n"));
  415. }
  416. void print_FPIEEE_RECORD_NO_EXCEPTION (PXMMI_ENV XmmiEnv) {
  417. // print the FP IEEE record result info
  418. PRINTF(("\nPRINTING FPIEEE_RECORD INFO (NO EXCEPTION):\n"));
  419. PRINTF(("XmmiEnv->Masks = %x\n", XmmiEnv->Masks));
  420. PRINTF(("XmmiEnv->Flags = %x\n", XmmiEnv->Flags));
  421. PRINTF(("XmmiEnv->Fz = %x\n", XmmiEnv->Fz));
  422. PRINTF(("XmmiEnv->Daz = %x\n", XmmiEnv->Daz));
  423. print_Rounding(XmmiEnv);
  424. print_Precision(XmmiEnv);
  425. print_Status(XmmiEnv);
  426. print_Result(XmmiEnv, FALSE);
  427. PRINTF(("\n"));
  428. }
  429. void print_FPIEEE_RECORD (PXMMI_ENV XmmiEnv) {
  430. // print input values
  431. PRINTF(("XmmiEnv->Masks = %x\n", XmmiEnv->Masks));
  432. PRINTF(("XmmiEnv->Flags = %x\n", XmmiEnv->Flags));
  433. PRINTF(("XmmiEnv->Fz = %x\n", XmmiEnv->Fz));
  434. PRINTF(("XmmiEnv->Daz = %x\n", XmmiEnv->Daz));
  435. if (XmmiEnv->Rc == _FpRoundNearest) {
  436. PRINTF(("XmmiEnv->Rc = _FpRoundNearest\n"));
  437. } else {
  438. if (XmmiEnv->Rc == _FpRoundMinusInfinity) {
  439. PRINTF(("XmmiEnv->Rc = _FpRoundMinusInfinity\n"));
  440. } else {
  441. if (XmmiEnv->Rc == _FpRoundPlusInfinity) {
  442. PRINTF(("XmmiEnv->Rc = _FpRoundPlusInfinity\n"));
  443. } else {
  444. if (XmmiEnv->Rc == _FpRoundChopped) {
  445. PRINTF(("XmmiEnv->Rc = _FpRoundChopped\n"));
  446. } else {
  447. PRINTF(("XmmiEnv->Rc = UNKNOWN\n"));
  448. }
  449. }
  450. }
  451. }
  452. if (XmmiEnv->Precision == _FpPrecision24) {
  453. PRINTF(("XmmiEnv->Precision = _FpPrecision24\n"));
  454. } else {
  455. if (XmmiEnv->Precision == _FpPrecision53) {
  456. PRINTF(("XmmiEnv->Precision = _FpPrecision53\n"));
  457. } else {
  458. if (XmmiEnv->Precision == _FpPrecisionFull) {
  459. PRINTF(("XmmiEnv->Precision = _FpPrecisionFull\n"));
  460. } else {
  461. PRINTF(("XmmiEnv->Precision = INCORRECT\n"));
  462. }
  463. }
  464. }
  465. print_Operations(XmmiEnv);
  466. print_Operand1(XmmiEnv);
  467. print_Operand2(XmmiEnv);
  468. }
  469. void
  470. dump_DataXMMI2(PTEMP_EXCEPTION_POINTERS p)
  471. {
  472. PEXCEPTION_RECORD exc;
  473. PTEMP_CONTEXT pctxt;
  474. PFLOATING_EXTENDED_SAVE_AREA pExtendedArea;
  475. PXMMI_AREA XmmiArea;
  476. PX87_AREA X87Area;
  477. PXMMI128 xmmi128;
  478. PXMMI128 reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7;
  479. PMMX64 mmx0, mmx1, mmx2, mmx3, mmx4, mmx5, mmx6, mmx7;
  480. ULONG i;
  481. exc = p->ExceptionRecord;
  482. pctxt = p->ContextRecord;
  483. pExtendedArea = (PFLOATING_EXTENDED_SAVE_AREA) &pctxt->ExtendedRegisters[0];
  484. XmmiArea = (PXMMI_AREA) &pExtendedArea->XMMIRegisterArea[0];
  485. X87Area = (PX87_AREA) &pExtendedArea->X87RegisterArea[0];
  486. reg0 = (PXMMI128) &XmmiArea->Xmmi[0];
  487. reg1 = (PXMMI128) &XmmiArea->Xmmi[1];
  488. reg2 = (PXMMI128) &XmmiArea->Xmmi[2];
  489. reg3 = (PXMMI128) &XmmiArea->Xmmi[3];
  490. reg4 = (PXMMI128) &XmmiArea->Xmmi[4];
  491. reg5 = (PXMMI128) &XmmiArea->Xmmi[5];
  492. reg6 = (PXMMI128) &XmmiArea->Xmmi[6];
  493. reg7 = (PXMMI128) &XmmiArea->Xmmi[7];
  494. mmx0 = (PMMX64) &X87Area->Mm[0].Mmx;
  495. mmx1 = (PMMX64) &X87Area->Mm[1].Mmx;
  496. mmx2 = (PMMX64) &X87Area->Mm[2].Mmx;
  497. mmx3 = (PMMX64) &X87Area->Mm[3].Mmx;
  498. mmx4 = (PMMX64) &X87Area->Mm[4].Mmx;
  499. mmx5 = (PMMX64) &X87Area->Mm[5].Mmx;
  500. mmx6 = (PMMX64) &X87Area->Mm[6].Mmx;
  501. mmx7 = (PMMX64) &X87Area->Mm[7].Mmx;
  502. xmmi128 = (PXMMI128) pExtendedArea->DataOffset;
  503. PRINTF(("Dump Saved Area:\n"));
  504. PRINTF(("Registers: Edi 0x%x Esi 0x%x Ebx 0x%x, Edx 0x%x, Ecx 0x%x, Eax 0x%x, Ebp 0x%x\n",
  505. pctxt->Edi, pctxt->Esi, pctxt->Ebx, pctxt->Edx,
  506. pctxt->Ecx, pctxt->Eax, pctxt->Ebp));
  507. PRINTF(("pExtendedArea->DataOffset\n"));
  508. DUMP_HEXLL(xmmi128, 2);
  509. DUMP_DS(xmmi128, 2);
  510. PRINTF(("mmx reg0:\n"));
  511. DUMP_HEXL(mmx0, 2);
  512. PRINTF(("mmx reg1:\n"));
  513. DUMP_HEXL(mmx1, 2);
  514. PRINTF(("mmx reg2:\n"));
  515. DUMP_HEXL(mmx2, 2);
  516. PRINTF(("mmx reg3:\n"));
  517. DUMP_HEXL(mmx3, 2);
  518. PRINTF(("mmx reg4:\n"));
  519. DUMP_HEXL(mmx4, 2);
  520. PRINTF(("mmx reg5:\n"));
  521. DUMP_HEXL(mmx5, 2);
  522. PRINTF(("mmx reg6:\n"));
  523. DUMP_HEXL(mmx6, 2);
  524. PRINTF(("mmx reg7:\n"));
  525. DUMP_HEXL(mmx7, 2);
  526. PRINTF(("xmmi reg0: (+0, -0)\n"));
  527. DUMP_HEXLL(reg0, 2);
  528. DUMP_DS(reg0, 2);
  529. PRINTF(("xmmi reg1: (+1.5*2^1022, +denormalized finite)\n"));
  530. DUMP_HEXLL(reg1, 2);
  531. DUMP_DS(reg1, 2);
  532. PRINTF(("xmmi reg2: (-denormalized finite, +normalized finite)\n"));
  533. DUMP_HEXLL(reg2, 2);
  534. DUMP_DS(reg2, 2);
  535. PRINTF(("xmmi reg3: (-normalized finite, +infinites)\n"));
  536. DUMP_HEXLL(reg3, 2);
  537. DUMP_DS(reg3, 2);
  538. PRINTF(("xmmi reg4: (-infinity, +1.1111110...011*2^-1022)\n"));
  539. DUMP_HEXLL(reg4, 2);
  540. DUMP_DS(reg4, 2);
  541. PRINTF(("xmmi reg5: (SNan, SNan)\n"));
  542. DUMP_HEXLL(reg5, 2);
  543. DUMP_DS(reg5, 2);
  544. PRINTF(("xmmi reg6: (QNan, QNan)\n"));
  545. DUMP_HEXLL(reg6, 2);
  546. DUMP_DS(reg6, 2);
  547. PRINTF(("xmmi reg7: (+1.375*2^1022, +1.11111110...01 * 2^-1022)\n"));
  548. DUMP_HEXLL(reg7, 2);
  549. DUMP_DS(reg7, 2);
  550. }
  551. void
  552. dump_Data(PTEMP_EXCEPTION_POINTERS p)
  553. {
  554. PEXCEPTION_RECORD exc;
  555. PTEMP_CONTEXT pctxt;
  556. PFLOATING_EXTENDED_SAVE_AREA pExtendedArea;
  557. PXMMI_AREA XmmiArea;
  558. PX87_AREA X87Area;
  559. PXMMI128 xmmi128;
  560. PXMMI128 reg0, reg1, reg2, reg3, reg4, reg5, reg6, reg7;
  561. PMMX64 mmx0, mmx1, mmx2, mmx3, mmx4, mmx5, mmx6, mmx7;
  562. ULONG i;
  563. exc = p->ExceptionRecord;
  564. pctxt = p->ContextRecord;
  565. pExtendedArea = (PFLOATING_EXTENDED_SAVE_AREA) &pctxt->ExtendedRegisters[0];
  566. XmmiArea = (PXMMI_AREA) &pExtendedArea->XMMIRegisterArea[0];
  567. X87Area = (PX87_AREA) &pExtendedArea->X87RegisterArea[0];
  568. reg0 = (PXMMI128) &XmmiArea->Xmmi[0];
  569. reg1 = (PXMMI128) &XmmiArea->Xmmi[1];
  570. reg2 = (PXMMI128) &XmmiArea->Xmmi[2];
  571. reg3 = (PXMMI128) &XmmiArea->Xmmi[3];
  572. reg4 = (PXMMI128) &XmmiArea->Xmmi[4];
  573. reg5 = (PXMMI128) &XmmiArea->Xmmi[5];
  574. reg6 = (PXMMI128) &XmmiArea->Xmmi[6];
  575. reg7 = (PXMMI128) &XmmiArea->Xmmi[7];
  576. mmx0 = (PMMX64) &X87Area->Mm[0].Mmx;
  577. mmx1 = (PMMX64) &X87Area->Mm[1].Mmx;
  578. mmx2 = (PMMX64) &X87Area->Mm[2].Mmx;
  579. mmx3 = (PMMX64) &X87Area->Mm[3].Mmx;
  580. mmx4 = (PMMX64) &X87Area->Mm[4].Mmx;
  581. mmx5 = (PMMX64) &X87Area->Mm[5].Mmx;
  582. mmx6 = (PMMX64) &X87Area->Mm[6].Mmx;
  583. mmx7 = (PMMX64) &X87Area->Mm[7].Mmx;
  584. xmmi128 = (PXMMI128) pExtendedArea->DataOffset;
  585. PRINTF(("Dump Saved Area:\n"));
  586. PRINTF(("Registers: Edi 0x%x Esi 0x%x Ebx 0x%x, Edx 0x%x, Ecx 0x%x, Eax 0x%x, Ebp 0x%x\n",
  587. pctxt->Edi, pctxt->Esi, pctxt->Ebx, pctxt->Edx,
  588. pctxt->Ecx, pctxt->Eax, pctxt->Ebp));
  589. PRINTF(("pExtendedArea->DataOffset\n"));
  590. DUMP_HEXL(xmmi128, 4);
  591. DUMP_FS(xmmi128, 4);
  592. PRINTF(("mmx reg0:\n"));
  593. DUMP_HEXL(mmx0, 2);
  594. PRINTF(("mmx reg1:\n"));
  595. DUMP_HEXL(mmx1, 2);
  596. PRINTF(("mmx reg2:\n"));
  597. DUMP_HEXL(mmx2, 2);
  598. PRINTF(("mmx reg3:\n"));
  599. DUMP_HEXL(mmx3, 2);
  600. PRINTF(("mmx reg4:\n"));
  601. DUMP_HEXL(mmx4, 2);
  602. PRINTF(("mmx reg5:\n"));
  603. DUMP_HEXL(mmx5, 2);
  604. PRINTF(("mmx reg6:\n"));
  605. DUMP_HEXL(mmx6, 2);
  606. PRINTF(("mmx reg7:\n"));
  607. DUMP_HEXL(mmx7, 2);
  608. PRINTF(("xmmi reg0: (n, n, n, n)\n"));
  609. DUMP_HEXL(reg0, 4);
  610. DUMP_FS(reg0, 4);
  611. PRINTF(("xmmi reg1: (+0, -0, +denormalized finite, n)\n"));
  612. DUMP_HEXL(reg1, 4);
  613. DUMP_FS(reg1, 4);
  614. PRINTF(("xmmi reg2: (-denormalized finite, +normalized finite, -normalized finite, n)\n"));
  615. DUMP_HEXL(reg2, 4);
  616. DUMP_FS(reg2, 4);
  617. PRINTF(("xmmi reg3: (+infinites, -infinites, n, 1000003)\n"));
  618. DUMP_HEXL(reg3, 4);
  619. DUMP_FS(reg3, 4);
  620. PRINTF(("xmmi reg4: (n, n, n, n)\n"));
  621. DUMP_HEXL(reg4, 4);
  622. DUMP_FS(reg4, 4);
  623. PRINTF(("xmmi reg5: (SNan, SNan, n, n)\n"));
  624. DUMP_HEXL(reg5, 4);
  625. DUMP_FS(reg5, 4);
  626. PRINTF(("xmmi reg6: (QNan, QNan, 7ec00000, n)\n"));
  627. DUMP_HEXL(reg6, 4);
  628. DUMP_FS(reg6, 4);
  629. PRINTF(("xmmi reg7: (n, n, 7eb00000, 100004)\n"));
  630. DUMP_HEXL(reg7, 4);
  631. DUMP_FS(reg7, 4);
  632. }
  633. void
  634. dump_OpLocation(POPERAND Operand) {
  635. if (!Operand->Op.OperandValid) {
  636. PRINTF(("Operand Invalid\n"))
  637. return;
  638. }
  639. switch (Operand->OpLocation) {
  640. case ST0:
  641. PRINTF(("OpLocation = ST0 "));
  642. break;
  643. case ST1:
  644. PRINTF(("OpLocation = ST1 "));
  645. break;
  646. case ST2:
  647. PRINTF(("OpLocation = ST2 "));
  648. break;
  649. case ST3:
  650. PRINTF(("OpLocation = ST3 "));
  651. break;
  652. case ST4:
  653. PRINTF(("OpLocation = ST4 "));
  654. break;
  655. case ST5:
  656. PRINTF(("OpLocation = ST5 "));
  657. break;
  658. case ST6:
  659. PRINTF(("OpLocation = ST6 "));
  660. break;
  661. case ST7:
  662. PRINTF(("OpLocation = ST7 "));
  663. break;
  664. case REG:
  665. PRINTF(("OpLocation = REG "));
  666. PRINTF(("OpReg %x", Operand->OpReg));
  667. break;
  668. case RS:
  669. PRINTF(("OpLocation = RS "));
  670. break;
  671. case M16I:
  672. PRINTF(("OpLocation = M16I "));
  673. break;
  674. case M32I:
  675. PRINTF(("OpLocation = M32I "));
  676. break;
  677. case M64I:
  678. PRINTF(("OpLocation = M64I "));
  679. break;
  680. case M32R:
  681. PRINTF(("OpLocation = M32R "));
  682. break;
  683. case M64R:
  684. PRINTF(("OpLocation = M64R "));
  685. break;
  686. case M80R:
  687. PRINTF(("OpLocation = M80R "));
  688. break;
  689. case M80D:
  690. PRINTF(("OpLocation = M80D "));
  691. break;
  692. case Z80R:
  693. PRINTF(("OpLocation = Z80R "));
  694. break;
  695. case M128_M32R:
  696. PRINTF(("OpLocation = M128_M32R "));
  697. break;
  698. case M128_M64R:
  699. PRINTF(("OpLocation = M128_M64R "));
  700. break;
  701. case MMX:
  702. PRINTF(("OpLocation = MMX "));
  703. PRINTF(("OpReg %x", Operand->OpReg));
  704. break;
  705. case XMMI:
  706. PRINTF(("OpLocation = XMMI "));
  707. PRINTF(("OpReg %x", Operand->OpReg));
  708. break;
  709. case XMMI2:
  710. PRINTF(("OpLocation = XMMI2 "));
  711. PRINTF(("OpReg %x", Operand->OpReg));
  712. break;
  713. case IMM8:
  714. PRINTF(("OpLocation = IMM8 "));
  715. break;
  716. case M64R_64:
  717. PRINTF(("OpLocation = M64R_64 "));
  718. break;
  719. case M128_M32I:
  720. PRINTF(("OpLocation = M128_M32I "));
  721. break;
  722. case XMMI_M32I:
  723. PRINTF(("OpLocation = XMMI_M32I "));
  724. PRINTF(("OpReg %x", Operand->OpReg));
  725. break;
  726. case LOOKUP:
  727. PRINTF(("OpLocation = LOOKUP "));
  728. break;
  729. case INV:
  730. PRINTF(("OpLocation = INV "));
  731. break;
  732. default:
  733. PRINTF(("?"));
  734. }
  735. PRINTF(("\n"));
  736. }
  737. void
  738. dump_XmmiFpEnv(
  739. PXMMI_FP_ENV XmmiFpEnv) {
  740. POPERAND Operand;
  741. XMMI_ENV XmmiEnv;
  742. _FPIEEE_RECORD ieee;
  743. XmmiEnv.Ieee = &ieee;
  744. XmmiEnv.Ieee->Operation = XmmiFpEnv->OriginalOperation;
  745. XmmiEnv.Imm8 = XmmiFpEnv->Imm8;
  746. print_Operations(&XmmiEnv);
  747. Operand = &XmmiFpEnv->Operand1;
  748. PRINTF(("Operand1: "));
  749. dump_OpLocation(Operand);
  750. Operand = &XmmiFpEnv->Operand2;
  751. PRINTF(("Operand2: "));
  752. dump_OpLocation(Operand);
  753. }
  754. void
  755. dump_Control(PTEMP_EXCEPTION_POINTERS p) {
  756. PEXCEPTION_RECORD exc;
  757. PTEMP_CONTEXT pctxt;
  758. PFLOATING_EXTENDED_SAVE_AREA pExtendedArea;
  759. PULONG istream;
  760. exc = p->ExceptionRecord;
  761. pctxt = p->ContextRecord;
  762. pExtendedArea = (PFLOATING_EXTENDED_SAVE_AREA) &pctxt->ExtendedRegisters[0];
  763. istream = (PULONG) pctxt->Eip;
  764. PRINTF(("EIP %x ExceptionRecord %x ContextRecord %x ExtendedArea %x\n",
  765. istream, exc, pctxt, pExtendedArea));
  766. PRINTF(("MXCsr: %x, CW: %x\n", pExtendedArea->MXCsr, pExtendedArea->ControlWord));
  767. }
  768. void
  769. dump_Format(_FPIEEE_VALUE *Operand) {
  770. _U64 u64;
  771. _I64 i64;
  772. _FP80 fp80;
  773. _FP128 fp128;
  774. ULONG i;
  775. if (!Operand->OperandValid) {
  776. PRINTF(("Operand Invalid\n"));
  777. }
  778. PRINTF(("Format/Value: "));
  779. switch (Operand->Format) {
  780. case _FpFormatFp32:
  781. PRINTF(("_FpFormatFp32 %f", Operand->Value.Fp32Value));
  782. PRINTF((" = (hex) %x\n", Operand->Value.U32Value));
  783. break;
  784. case _FpFormatFp64:
  785. PRINTF(("_FpFormatFp64 %e\n", Operand->Value.Fp64Value));
  786. for (i=0; i < 3; i++) {
  787. PRINTF((" = (hex) %x\n", Operand->Value.U64Value.W[i]));
  788. }
  789. break;
  790. case _FpFormatFp80:
  791. fp80 = Operand->Value.Fp80Value;
  792. PRINTF(("_FpFormatFp80 (hex)"));
  793. for (i=0; i < 5; i++) {
  794. PRINTF((" %x", fp80.W[i]));
  795. }
  796. break;
  797. case _FpFormatFp128:
  798. fp128 = Operand->Value.Fp128Value;
  799. PRINTF(("_FpFormatFp128 (hex)"));
  800. for (i=0; i < 4; i++) {
  801. PRINTF((" %x", fp128.W[i]));
  802. }
  803. break;
  804. case _FpFormatI16:
  805. PRINTF(("_FpFormatI16 %d\n", Operand->Value.I16Value));
  806. break;
  807. case _FpFormatI32:
  808. PRINTF(("_FpFormatI32 %d", Operand->Value.I32Value));
  809. PRINTF((" = (hex) %x\n", Operand->Value.U32Value));
  810. break;
  811. case _FpFormatI64:
  812. i64 = Operand->Value.I64Value;
  813. PRINTF(("_FpFormatI64 (hex)"));
  814. for (i=0; i < 2; i++) {
  815. PRINTF((" %x", i64.W[i]));
  816. }
  817. break;
  818. case _FpFormatU16:
  819. PRINTF(("_FpFormatU16 h%u\n", Operand->Value.U16Value));
  820. break;
  821. case _FpFormatU32:
  822. PRINTF(("_FpFormatU32 l%u\n", Operand->Value.U32Value));
  823. PRINTF((" = (hex) %x\n", Operand->Value.U32Value));
  824. break;
  825. case _FpFormatU64:
  826. u64 = Operand->Value.U64Value;
  827. PRINTF(("_FpFormatU64 (hex)"));
  828. for (i=0; i < 2; i++) {
  829. PRINTF((" %x", u64.W[i]));
  830. }
  831. break;
  832. case _FpFormatCompare:
  833. PRINTF(("_FpFormatCompare %x\n", Operand->Value.CompareValue));
  834. break;
  835. case _FpFormatString:
  836. PRINTF(("_FpFormatString %s\n", Operand->Value.StringValue));
  837. break;
  838. default:
  839. PRINTF(("?"));
  840. break;
  841. }
  842. PRINTF(("\n"));
  843. return;
  844. }
  845. void
  846. dump_fpieee_record(_FPIEEE_RECORD *pieee) {
  847. XMMI_ENV XmmiEnv;
  848. XmmiEnv.Ieee = pieee;
  849. PRINTF(("OPERATION: 0x%x\n", pieee->Operation));
  850. print_Rounding(&XmmiEnv);
  851. print_Precision(&XmmiEnv);
  852. print_CauseEnable(&XmmiEnv);
  853. print_Status(&XmmiEnv);
  854. PRINTF(("Operand 1:\n"));
  855. dump_Format(&pieee->Operand1);
  856. PRINTF(("Operand 2: \n"));
  857. dump_Format(&pieee->Operand2);
  858. PRINTF(("Result:"));
  859. dump_Format(&pieee->Result);
  860. }
  861. void
  862. print_FPIEEE_RECORD_EXCEPTION1 (PXMMI_ENV XmmiEnv, ULONG res1, ULONG res0, ULONG flags) {
  863. // print the FP IEEE record info
  864. PRINTF(("\nPRINTING FPIEEE_RECORD INFO (EXCEPTION):\n"));
  865. if (res1 != XmmiEnv->Ieee->Result.Value.U64Value.W[1] ||
  866. res0 != XmmiEnv->Ieee->Result.Value.U64Value.W[0])
  867. PRINTF (("ERROR: expected res = %8.8x %8.8x got res = %8.8x %8.8x\n",
  868. res1, res0, XmmiEnv->Ieee->Result.Value.U64Value.W[1],
  869. XmmiEnv->Ieee->Result.Value.U64Value.W[0]));
  870. if (flags != XmmiEnv->Flags)
  871. PRINTF (("ERROR: expected flags = %x got flags = %x\n",
  872. flags, XmmiEnv->Flags));
  873. PRINTF(("XmmiEnv->Masks = %x\n", XmmiEnv->Masks));
  874. PRINTF(("XmmiEnv->Flags = %x\n", XmmiEnv->Flags));
  875. PRINTF(("XmmiEnv->Fz = %x\n", XmmiEnv->Fz));
  876. PRINTF(("XmmiEnv->Daz = %x\n", XmmiEnv->Daz));
  877. print_Rounding(XmmiEnv);
  878. print_Precision(XmmiEnv);
  879. print_CauseEnable(XmmiEnv);
  880. print_Status(XmmiEnv);
  881. print_Result(XmmiEnv, TRUE);
  882. PRINTF(("\n"));
  883. }
  884. void
  885. print_FPIEEE_RECORD_EXCEPTION2 (PXMMI_ENV XmmiEnv, ULONG res, ULONG flags) {
  886. // print the FP IEEE record info
  887. PRINTF(("\nPRINTING FPIEEE_RECORD INFO (EXCEPTION):\n"));
  888. if (res != XmmiEnv->Ieee->Result.Value.U32Value)
  889. printf ("ERROR: expected res = %x got res = %f = %8.8x\n",
  890. res, XmmiEnv->Ieee->Result.Value.Fp32Value,
  891. XmmiEnv->Ieee->Result.Value.U32Value);
  892. if (flags != XmmiEnv->Flags)
  893. printf ("ERROR: expected flags = %x got flags = %x\n",
  894. flags, XmmiEnv->Flags);
  895. PRINTF(("XmmiEnv->Masks = %x\n", XmmiEnv->Masks));
  896. PRINTF(("XmmiEnv->Flags = %x\n", XmmiEnv->Flags));
  897. PRINTF(("XmmiEnv->Fz = %x\n", XmmiEnv->Fz));
  898. PRINTF(("XmmiEnv->Daz = %x\n", XmmiEnv->Daz));
  899. print_Rounding(XmmiEnv);
  900. print_Precision(XmmiEnv);
  901. print_CauseEnable(XmmiEnv);
  902. print_Status(XmmiEnv);
  903. print_Result(XmmiEnv, TRUE);
  904. PRINTF(("\n"));
  905. }
  906. void
  907. print_FPIEEE_RECORD_EXCEPTION3 (PXMMI_ENV XmmiEnv, ULONG eflags, ULONG flags) {
  908. // print the FP IEEE record info
  909. PRINTF(("\nPRINTING FPIEEE_RECORD INFO (EXCEPTION):\n"));
  910. if (eflags != XmmiEnv->EFlags)
  911. printf ("ERROR: expected eflags = %x got eflags = %x\n",
  912. eflags, XmmiEnv->EFlags);
  913. if (flags != XmmiEnv->Flags)
  914. printf ("ERROR: expected flags = %x got flags = %x\n",
  915. flags, XmmiEnv->Flags);
  916. PRINTF(("XmmiEnv->Masks = %x\n", XmmiEnv->Masks));
  917. PRINTF(("XmmiEnv->Flags = %x\n", XmmiEnv->Flags));
  918. PRINTF(("XmmiEnv->Fz = %x\n", XmmiEnv->Fz));
  919. PRINTF(("XmmiEnv->Daz = %x\n", XmmiEnv->Daz));
  920. print_Rounding(XmmiEnv);
  921. print_Precision(XmmiEnv);
  922. print_CauseEnable(XmmiEnv);
  923. print_Status(XmmiEnv);
  924. PRINTF(("\n"));
  925. }
  926. void
  927. print_FPIEEE_RECORD_NO_EXCEPTION1 (PXMMI_ENV XmmiEnv, ULONG res1, ULONG res0, ULONG flags) {
  928. // print the FP IEEE record result info
  929. PRINTF(("\nPRINTING FPIEEE_RECORD INFO (NO EXCEPTION):\n"));
  930. if (res1 != XmmiEnv->Ieee->Result.Value.U64Value.W[1] ||
  931. res0 != XmmiEnv->Ieee->Result.Value.U64Value.W[0])
  932. PRINTF (("ERROR: expected res = %8.8x %8.8x got res = %8.8x %8.8x\n",
  933. res1, res0, XmmiEnv->Ieee->Result.Value.U64Value.W[1],
  934. XmmiEnv->Ieee->Result.Value.U64Value.W[0]));
  935. if (flags != XmmiEnv->Flags)
  936. PRINTF (("ERROR: expected flags = %x got flags = %x\n",
  937. flags, XmmiEnv->Flags));
  938. PRINTF(("XmmiEnv->Masks = %x\n", XmmiEnv->Masks));
  939. PRINTF(("XmmiEnv->Flags = %x\n", XmmiEnv->Flags));
  940. PRINTF(("XmmiEnv->Fz = %x\n", XmmiEnv->Fz));
  941. PRINTF(("XmmiEnv->Daz = %x\n", XmmiEnv->Daz));
  942. print_Rounding(XmmiEnv);
  943. print_Precision(XmmiEnv);
  944. print_Status(XmmiEnv);
  945. print_Result(XmmiEnv, FALSE);
  946. PRINTF(("\n"));
  947. }
  948. void
  949. print_FPIEEE_RECORD_NO_EXCEPTION2 (PXMMI_ENV XmmiEnv, ULONG res, ULONG flags) {
  950. // print the FP IEEE record result info
  951. PRINTF(("\nPRINTING FPIEEE_RECORD INFO (NO EXCEPTION):\n"));
  952. if (res != XmmiEnv->Ieee->Result.Value.U32Value)
  953. printf ("ERROR: expected res = %x got res = %f = %8.8x\n",
  954. res, XmmiEnv->Ieee->Result.Value.Fp32Value,
  955. XmmiEnv->Ieee->Result.Value.U32Value);
  956. if (flags != XmmiEnv->Flags)
  957. printf ("ERROR: expected flags = %x got flags = %x\n",
  958. flags, XmmiEnv->Flags);
  959. PRINTF(("XmmiEnv->Masks = %x\n", XmmiEnv->Masks));
  960. PRINTF(("XmmiEnv->Flags = %x\n", XmmiEnv->Flags));
  961. PRINTF(("XmmiEnv->Fz = %x\n", XmmiEnv->Fz));
  962. PRINTF(("XmmiEnv->Daz = %x\n", XmmiEnv->Daz));
  963. print_Rounding(XmmiEnv);
  964. print_Precision(XmmiEnv);
  965. print_Status(XmmiEnv);
  966. print_Result(XmmiEnv, FALSE);
  967. PRINTF(("\n"));
  968. }
  969. void
  970. print_FPIEEE_RECORD_NO_EXCEPTION3 (PXMMI_ENV XmmiEnv, ULONG eflags, ULONG flags)
  971. {
  972. // print the FP IEEE record result info
  973. PRINTF(("\nPRINTING FPIEEE_RECORD INFO (NO EXCEPTION):\n"));
  974. if (eflags != XmmiEnv->EFlags)
  975. printf ("ERROR: expected eflags = %x got eflags = %x\n",
  976. eflags, XmmiEnv->EFlags);
  977. if (flags != XmmiEnv->Flags)
  978. printf ("ERROR: expected flags = %x got flags = %x\n",
  979. flags, XmmiEnv->Flags);
  980. PRINTF(("XmmiEnv->Masks = %x\n", XmmiEnv->Masks));
  981. PRINTF(("XmmiEnv->Flags = %x\n", XmmiEnv->Flags));
  982. PRINTF(("XmmiEnv->Fz = %x\n", XmmiEnv->Fz));
  983. PRINTF(("XmmiEnv->Daz = %x\n", XmmiEnv->Daz));
  984. print_Rounding(XmmiEnv);
  985. print_Precision(XmmiEnv);
  986. print_Status(XmmiEnv);
  987. print_Result(XmmiEnv, FALSE);
  988. PRINTF(("\n"));
  989. }