blob: e4eaab06b06122b4b5039058bb25d126b178394b [file] [log] [blame]
sewardj893aada2004-11-29 19:57:54 +00001
2/*---------------------------------------------------------------*/
florian6ef84be2012-08-26 03:20:07 +00003/*--- begin libvex_emnote.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
sewardj89ae8472013-10-18 14:12:58 +000010 Copyright (C) 2004-2013 OpenWorks LLP
sewardj752f9062010-05-03 21:38:49 +000011 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
florian6ef84be2012-08-26 03:20:07 +000036#ifndef __LIBVEX_EMNOTE_H
37#define __LIBVEX_EMNOTE_H
sewardj893aada2004-11-29 19:57:54 +000038
florian58a637b2012-09-30 20:30:17 +000039#include "libvex_basictypes.h"
sewardj893aada2004-11-29 19:57:54 +000040
41/* VEX can sometimes generate code which returns to the dispatcher
florian6ef84be2012-08-26 03:20:07 +000042 with the guest state pointer set to VEX_TRC_JMP_EMWARN or
43 VEX_TRC_JMP_EMFAIL. This means that VEX is trying to tell Valgrind
44 something noteworthy about emulation progress. For example, that Valgrind
45 is doing imprecise emulation in some sense. The guest's pseudo-register
46 "guest_EMNOTE" will hold a value of type VexEmNote, which describes
sewardj893aada2004-11-29 19:57:54 +000047 the nature of the warning. Currently the limitations that are
48 warned about apply primarily to floating point support.
49
florian6ef84be2012-08-26 03:20:07 +000050 All guest states must have a 32-bit (UInt) guest_EMNOTE pseudo-
sewardj893aada2004-11-29 19:57:54 +000051 register, that emulation warnings can be written in to.
52
florian6ef84be2012-08-26 03:20:07 +000053 Note that guest_EMNOTE only carries a valid value at the jump
54 marked as VEX_TRC_JMP_EMWARN / VEX_TRC_JMP_EMFAIL. You can't assume
55 it will continue to carry a valid value from any amount of time after
56 the jump.
sewardj893aada2004-11-29 19:57:54 +000057*/
58
59typedef
60 enum {
florian6ef84be2012-08-26 03:20:07 +000061 /* no note indicated */
62 EmNote_NONE=0,
sewardjd01a9632004-11-30 13:18:37 +000063
sewardj893aada2004-11-29 19:57:54 +000064 /* unmasking x87 FP exceptions is not supported */
65 EmWarn_X86_x87exns,
sewardjd01a9632004-11-30 13:18:37 +000066
sewardj893aada2004-11-29 19:57:54 +000067 /* change of x87 FP precision away from 64-bit (mantissa) */
68 EmWarn_X86_x87precision,
sewardjd01a9632004-11-30 13:18:37 +000069
sewardj893aada2004-11-29 19:57:54 +000070 /* unmasking SSE FP exceptions is not supported */
71 EmWarn_X86_sseExns,
sewardj893aada2004-11-29 19:57:54 +000072
sewardj5edfc262004-12-15 12:13:52 +000073 /* setting mxcsr.fz is not supported */
74 EmWarn_X86_fz,
75
76 /* setting mxcsr.daz is not supported */
77 EmWarn_X86_daz,
sewardj6d269842005-08-06 11:45:02 +000078
79 /* settings to %eflags.ac (alignment check) are noted but ignored */
80 EmWarn_X86_acFlag,
sewardj7df596b2004-12-06 14:29:12 +000081
sewardj9dd9cf12006-01-20 14:13:55 +000082 /* unmasking PPC32/64 FP exceptions is not supported */
83 EmWarn_PPCexns,
84
85 /* overflow/underflow of the PPC64 _REDIR stack (ppc64 only) */
86 EmWarn_PPC64_redir_overflow,
87 EmWarn_PPC64_redir_underflow,
cerion094d1392005-06-20 13:45:57 +000088
florian4b8efad2012-09-02 18:07:08 +000089 /* insn specifies a rounding mode other than "according to FPC"
90 which requires the floating point extension facility. But that
91 facility is not available on this host */
92 EmWarn_S390X_fpext_rounding,
93
florianf0fa1be2012-09-18 20:24:38 +000094 /* insn (e.g. srnmb) specifies an invalid rounding mode */
95 EmWarn_S390X_invalid_rounding,
96
florian4e0083e2012-08-26 03:41:56 +000097 /* stfle insn is not supported on this host */
98 EmFail_S390X_stfle,
99
florianc5c669b2012-08-26 14:32:28 +0000100 /* stckf insn is not supported on this host */
101 EmFail_S390X_stckf,
102
florian8c88cb62012-08-26 18:58:13 +0000103 /* ecag insn is not supported on this host */
104 EmFail_S390X_ecag,
105
floriane75dafa2012-09-01 17:54:09 +0000106 /* insn needs floating point extension facility which is not
107 available on this host */
108 EmFail_S390X_fpext,
109
florian78d5ef72013-05-11 15:02:58 +0000110 /* GPR 0 contains invalid rounding mode for PFPO instruction */
111 EmFail_S390X_invalid_PFPO_rounding_mode,
112
113 /* The function code specified in GPR 0 executed by PFPO
114 instruction is invalid */
115 EmFail_S390X_invalid_PFPO_function,
116
florian6ef84be2012-08-26 03:20:07 +0000117 EmNote_NUMBER
sewardj893aada2004-11-29 19:57:54 +0000118 }
florian6ef84be2012-08-26 03:20:07 +0000119 VexEmNote;
sewardj893aada2004-11-29 19:57:54 +0000120
121
122/* Produces a short string describing the warning. */
florian1ff47562012-10-21 02:09:51 +0000123extern const HChar* LibVEX_EmNote_string ( VexEmNote );
sewardj893aada2004-11-29 19:57:54 +0000124
125
florian6ef84be2012-08-26 03:20:07 +0000126#endif /* ndef __LIBVEX_EMNOTE_H */
sewardj893aada2004-11-29 19:57:54 +0000127
128/*---------------------------------------------------------------*/
florian6ef84be2012-08-26 03:20:07 +0000129/*--- libvex_emnote.h ---*/
sewardj893aada2004-11-29 19:57:54 +0000130/*---------------------------------------------------------------*/