blob: 0bf263f5f5476f02e1dfe6ae98d1ba671c9823ac [file] [log] [blame]
sewardj893aada2004-11-29 19:57:54 +00001
2/*---------------------------------------------------------------*/
sewardj752f9062010-05-03 21:38:49 +00003/*--- begin libvex_emwarn.h ---*/
sewardj893aada2004-11-29 19:57:54 +00004/*---------------------------------------------------------------*/
5
6/*
sewardj752f9062010-05-03 21:38:49 +00007 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
sewardj893aada2004-11-29 19:57:54 +00009
sewardj752f9062010-05-03 21:38:49 +000010 Copyright (C) 2004-2010 OpenWorks LLP
11 info@open-works.net
sewardj893aada2004-11-29 19:57:54 +000012
sewardj752f9062010-05-03 21:38:49 +000013 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
sewardj893aada2004-11-29 19:57:54 +000017
sewardj752f9062010-05-03 21:38:49 +000018 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
sewardj7bd6ffe2005-08-03 16:07:36 +000026 02110-1301, USA.
27
sewardj752f9062010-05-03 21:38:49 +000028 The GNU General Public License is contained in the file COPYING.
sewardj893aada2004-11-29 19:57:54 +000029
30 Neither the names of the U.S. Department of Energy nor the
31 University of California nor the names of its contributors may be
32 used to endorse or promote products derived from this software
33 without prior written permission.
sewardj893aada2004-11-29 19:57:54 +000034*/
35
36#ifndef __LIBVEX_EMWARN_H
37#define __LIBVEX_EMWARN_H
38
39
40/* VEX can sometimes generate code which returns to the dispatcher
41 with the guest state pointer set to VEX_TRC_JMP_EMWARN. This means
42 that VEX is trying to warn Valgrind that it is doing imprecise
43 emulation in some sense. The guest's pseudo-register
44 "guest_EMWARN" will hold a value of type VexEmWarn, which describes
45 the nature of the warning. Currently the limitations that are
46 warned about apply primarily to floating point support.
47
48 All guest states should have a 32-bit (UInt) guest_EMWARN pseudo-
49 register, that emulation warnings can be written in to.
50
51 Note that guest_EMWARN only carries a valid value at the jump
52 marked as VEX_TRC_JMP_EMWARN. You can't assume it will continue to
53 carry a valid value from any amount of time after the jump.
54*/
55
56typedef
57 enum {
58 /* no warning indicated */
59 EmWarn_NONE=0,
sewardjd01a9632004-11-30 13:18:37 +000060
sewardj893aada2004-11-29 19:57:54 +000061 /* unmasking x87 FP exceptions is not supported */
62 EmWarn_X86_x87exns,
sewardjd01a9632004-11-30 13:18:37 +000063
sewardj893aada2004-11-29 19:57:54 +000064 /* change of x87 FP precision away from 64-bit (mantissa) */
65 EmWarn_X86_x87precision,
sewardjd01a9632004-11-30 13:18:37 +000066
sewardj893aada2004-11-29 19:57:54 +000067 /* unmasking SSE FP exceptions is not supported */
68 EmWarn_X86_sseExns,
sewardj893aada2004-11-29 19:57:54 +000069
sewardj5edfc262004-12-15 12:13:52 +000070 /* setting mxcsr.fz is not supported */
71 EmWarn_X86_fz,
72
73 /* setting mxcsr.daz is not supported */
74 EmWarn_X86_daz,
sewardj6d269842005-08-06 11:45:02 +000075
76 /* settings to %eflags.ac (alignment check) are noted but ignored */
77 EmWarn_X86_acFlag,
sewardj7df596b2004-12-06 14:29:12 +000078
sewardj9dd9cf12006-01-20 14:13:55 +000079 /* unmasking PPC32/64 FP exceptions is not supported */
80 EmWarn_PPCexns,
81
82 /* overflow/underflow of the PPC64 _REDIR stack (ppc64 only) */
83 EmWarn_PPC64_redir_overflow,
84 EmWarn_PPC64_redir_underflow,
cerion094d1392005-06-20 13:45:57 +000085
sewardj893aada2004-11-29 19:57:54 +000086 EmWarn_NUMBER
87 }
88 VexEmWarn;
89
90
91/* Produces a short string describing the warning. */
92extern HChar* LibVEX_EmWarn_string ( VexEmWarn );
93
94
95#endif /* ndef __LIBVEX_EMWARN_H */
96
97/*---------------------------------------------------------------*/
98/*--- libvex_emwarn.h ---*/
99/*---------------------------------------------------------------*/