Create a new mechanism: "emulation warnings", which is a way for Vex
to report to whatever is using it that it cannot emulate precisely.
Net result is that a bb can exit with the guest state pointer set to
VEX_TRC_EMWARN. In this case, the (mandatory) guest state psuedo-reg
called "guest_EMWARN" holds a value of type VexEmWarn, indicating the
kind of problem encounted.
Use this to warn about approximations in the x87 FPU simulation:
unmasked exceptions not supported, round to +inf/-inf not supported,
precisions other than 80-bit not supported.
git-svn-id: svn://svn.valgrind.org/vex/trunk@595 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/main/vex_main.c b/priv/main/vex_main.c
index 062574c..8bf93c9 100644
--- a/priv/main/vex_main.c
+++ b/priv/main/vex_main.c
@@ -34,6 +34,7 @@
*/
#include "libvex.h"
+#include "libvex_emwarn.h"
#include "libvex_guest_x86.h"
#include "libvex_guest_arm.h"
@@ -441,6 +442,27 @@
}
+/* --------- Emulation warnings. --------- */
+
+HChar* LibVEX_EmWarn_string ( VexEmWarn ew )
+{
+ switch (ew) {
+ case EmWarn_NONE:
+ return "none";
+ case EmWarn_X86_x87exns:
+ return "Unmasking x87 FP exceptions";
+ case EmWarn_X86_x87rounding:
+ return "Selection of unsupported x87 FP rounding mode (+inf/-inf)";
+ case EmWarn_X86_x87precision:
+ return "Selection of non-80-bit x87 FP precision";
+ case EmWarn_X86_sseExns:
+ return "Unmasking SSE FP exceptionss";
+ case EmWarn_X86_sseRounding:
+ return "Selection of unsupported SSE FP rounding mode";
+ default:
+ vpanic("LibVEX_EmWarn_string: unknown warning");
+ }
+}
/*---------------------------------------------------------------*/
/*--- end main/vex_main.c ---*/