libvex_emnote.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*---------------------------------------------------------------*/
  2. /*--- begin libvex_emnote.h ---*/
  3. /*---------------------------------------------------------------*/
  4. /*
  5. This file is part of Valgrind, a dynamic binary instrumentation
  6. framework.
  7. Copyright (C) 2004-2017 OpenWorks LLP
  8. info@open-works.net
  9. This program is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU General Public License as
  11. published by the Free Software Foundation; either version 2 of the
  12. License, or (at your option) any later version.
  13. This program is distributed in the hope that it will be useful, but
  14. WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. General Public License for more details.
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  20. 02110-1301, USA.
  21. The GNU General Public License is contained in the file COPYING.
  22. Neither the names of the U.S. Department of Energy nor the
  23. University of California nor the names of its contributors may be
  24. used to endorse or promote products derived from this software
  25. without prior written permission.
  26. */
  27. #ifndef __LIBVEX_EMNOTE_H
  28. #define __LIBVEX_EMNOTE_H
  29. #include "libvex_basictypes.h"
  30. /* VEX can sometimes generate code which returns to the dispatcher
  31. with the guest state pointer set to VEX_TRC_JMP_EMWARN or
  32. VEX_TRC_JMP_EMFAIL. This means that VEX is trying to tell Valgrind
  33. something noteworthy about emulation progress. For example, that Valgrind
  34. is doing imprecise emulation in some sense. The guest's pseudo-register
  35. "guest_EMNOTE" will hold a value of type VexEmNote, which describes
  36. the nature of the warning. Currently the limitations that are
  37. warned about apply primarily to floating point support.
  38. All guest states must have a 32-bit (UInt) guest_EMNOTE pseudo-
  39. register, that emulation warnings can be written in to.
  40. Note that guest_EMNOTE only carries a valid value at the jump
  41. marked as VEX_TRC_JMP_EMWARN / VEX_TRC_JMP_EMFAIL. You can't assume
  42. it will continue to carry a valid value from any amount of time after
  43. the jump.
  44. */
  45. typedef
  46. enum {
  47. /* no note indicated */
  48. EmNote_NONE=0,
  49. /* unmasking x87 FP exceptions is not supported */
  50. EmWarn_X86_x87exns,
  51. /* change of x87 FP precision away from 64-bit (mantissa) */
  52. EmWarn_X86_x87precision,
  53. /* unmasking SSE FP exceptions is not supported */
  54. EmWarn_X86_sseExns,
  55. /* setting mxcsr.fz is not supported */
  56. EmWarn_X86_fz,
  57. /* setting mxcsr.daz is not supported */
  58. EmWarn_X86_daz,
  59. /* settings to %eflags.ac (alignment check) are noted but ignored */
  60. EmWarn_X86_acFlag,
  61. /* unmasking PPC32/64 FP exceptions is not supported */
  62. EmWarn_PPCexns,
  63. /* overflow/underflow of the PPC64 _REDIR stack (ppc64 only) */
  64. EmWarn_PPC64_redir_overflow,
  65. EmWarn_PPC64_redir_underflow,
  66. /* insn specifies a rounding mode other than "according to FPC"
  67. which requires the floating point extension facility. But that
  68. facility is not available on this host */
  69. EmWarn_S390X_fpext_rounding,
  70. /* insn (e.g. srnmb) specifies an invalid rounding mode */
  71. EmWarn_S390X_invalid_rounding,
  72. /* stfle insn is not supported on this host */
  73. EmFail_S390X_stfle,
  74. /* stckf insn is not supported on this host */
  75. EmFail_S390X_stckf,
  76. /* ecag insn is not supported on this host */
  77. EmFail_S390X_ecag,
  78. /* pfpo insn is not supported on this host */
  79. EmFail_S390X_pfpo,
  80. /* DFP insns are not supported on this host */
  81. EmFail_S390X_DFP_insn,
  82. /* insn needs floating point extension facility which is not
  83. available on this host */
  84. EmFail_S390X_fpext,
  85. /* GPR 0 contains invalid rounding mode for PFPO instruction */
  86. EmFail_S390X_invalid_PFPO_rounding_mode,
  87. /* The function code specified in GPR 0 executed by PFPO
  88. instruction is invalid */
  89. EmFail_S390X_invalid_PFPO_function,
  90. /* some insn needs vector facility which is not available on this host */
  91. EmFail_S390X_vx,
  92. /* ppno insn is not supported on this host */
  93. EmFail_S390X_ppno,
  94. EmNote_NUMBER
  95. }
  96. VexEmNote;
  97. /* Produces a short string describing the warning. */
  98. extern const HChar* LibVEX_EmNote_string ( VexEmNote );
  99. #endif /* ndef __LIBVEX_EMNOTE_H */
  100. /*---------------------------------------------------------------*/
  101. /*--- libvex_emnote.h ---*/
  102. /*---------------------------------------------------------------*/