~bkerensa/ubuntu/raring/valgrind/merge-from-deb

« back to all changes in this revision

Viewing changes to VEX/priv/guest-ppc/gdefs.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-06-26 00:17:17 UTC
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20060626001717-qi51nzty57cb12q6
Tags: upstream-3.2.0
Import upstream version 3.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*---------------------------------------------------------------*/
 
3
/*---                                                         ---*/
 
4
/*--- This file (guest-ppc/gdefs.h) is                        ---*/
 
5
/*--- Copyright (C) OpenWorks LLP.  All rights reserved.      ---*/
 
6
/*---                                                         ---*/
 
7
/*---------------------------------------------------------------*/
 
8
 
 
9
/*
 
10
   This file is part of LibVEX, a library for dynamic binary
 
11
   instrumentation and translation.
 
12
 
 
13
   Copyright (C) 2004-2006 OpenWorks LLP.  All rights reserved.
 
14
 
 
15
   This library is made available under a dual licensing scheme.
 
16
 
 
17
   If you link LibVEX against other code all of which is itself
 
18
   licensed under the GNU General Public License, version 2 dated June
 
19
   1991 ("GPL v2"), then you may use LibVEX under the terms of the GPL
 
20
   v2, as appearing in the file LICENSE.GPL.  If the file LICENSE.GPL
 
21
   is missing, you can obtain a copy of the GPL v2 from the Free
 
22
   Software Foundation Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
23
   02110-1301, USA.
 
24
 
 
25
   For any other uses of LibVEX, you must first obtain a commercial
 
26
   license from OpenWorks LLP.  Please contact info@open-works.co.uk
 
27
   for information about commercial licensing.
 
28
 
 
29
   This software is provided by OpenWorks LLP "as is" and any express
 
30
   or implied warranties, including, but not limited to, the implied
 
31
   warranties of merchantability and fitness for a particular purpose
 
32
   are disclaimed.  In no event shall OpenWorks LLP be liable for any
 
33
   direct, indirect, incidental, special, exemplary, or consequential
 
34
   damages (including, but not limited to, procurement of substitute
 
35
   goods or services; loss of use, data, or profits; or business
 
36
   interruption) however caused and on any theory of liability,
 
37
   whether in contract, strict liability, or tort (including
 
38
   negligence or otherwise) arising in any way out of the use of this
 
39
   software, even if advised of the possibility of such damage.
 
40
 
 
41
   Neither the names of the U.S. Department of Energy nor the
 
42
   University of California nor the names of its contributors may be
 
43
   used to endorse or promote products derived from this software
 
44
   without prior written permission.
 
45
*/
 
46
 
 
47
/* Only to be used within the guest-ppc directory. */
 
48
 
 
49
 
 
50
#ifndef __LIBVEX_GUEST_PPC_DEFS_H
 
51
#define __LIBVEX_GUEST_PPC_DEFS_H
 
52
 
 
53
 
 
54
/*---------------------------------------------------------*/
 
55
/*--- ppc to IR conversion                              ---*/
 
56
/*---------------------------------------------------------*/
 
57
 
 
58
/* Convert one ppc insn to IR.  See the type DisOneInstrFn in
 
59
   bb_to_IR.h. */
 
60
extern
 
61
DisResult disInstr_PPC ( IRBB*        irbb,
 
62
                         Bool         put_IP,
 
63
                         Bool         (*resteerOkFn) ( void*, Addr64 ),
 
64
                         void*        callback_opaque,
 
65
                         UChar*       guest_code,
 
66
                         Long         delta,
 
67
                         Addr64       guest_IP,
 
68
                         VexArch      guest_arch,
 
69
                         VexArchInfo* archinfo,
 
70
                         Bool         host_bigendian );
 
71
 
 
72
/* Used by the optimiser to specialise calls to helpers. */
 
73
extern
 
74
IRExpr* guest_ppc32_spechelper ( HChar* function_name,
 
75
                                 IRExpr** args );
 
76
 
 
77
extern
 
78
IRExpr* guest_ppc64_spechelper ( HChar* function_name,
 
79
                                 IRExpr** args );
 
80
 
 
81
/* Describes to the optimser which part of the guest state require
 
82
   precise memory exceptions.  This is logically part of the guest
 
83
   state description. */
 
84
extern 
 
85
Bool guest_ppc32_state_requires_precise_mem_exns ( Int, Int );
 
86
 
 
87
extern 
 
88
Bool guest_ppc64_state_requires_precise_mem_exns ( Int, Int );
 
89
 
 
90
extern
 
91
VexGuestLayout ppc32Guest_layout;
 
92
 
 
93
extern
 
94
VexGuestLayout ppc64Guest_layout;
 
95
 
 
96
 
 
97
/* FP Rounding mode - different encoding to IR */
 
98
typedef
 
99
   enum {
 
100
      PPCrm_NEAREST = 0,
 
101
      PPCrm_NegINF  = 1,
 
102
      PPCrm_PosINF  = 2,
 
103
      PPCrm_ZERO    = 3
 
104
   } PPCRoundingMode;
 
105
 
 
106
/* Floating point comparison values - different encoding to IR */
 
107
typedef
 
108
   enum {
 
109
      PPCcr_LT = 0x8,
 
110
      PPCcr_GT = 0x4,
 
111
      PPCcr_EQ = 0x2,
 
112
      PPCcr_UN = 0x1
 
113
   }
 
114
   PPCCmpF64Result;
 
115
 
 
116
/*
 
117
  Enumeration for xer_ca/ov calculation helper functions
 
118
*/
 
119
enum {
 
120
   /* 0  */ PPCG_FLAG_OP_ADD=0,   // addc[o], addic
 
121
   /* 1  */ PPCG_FLAG_OP_ADDE,    // adde[o], addme[o], addze[o]
 
122
   /* 2  */ PPCG_FLAG_OP_DIVW,    // divwo
 
123
   /* 3  */ PPCG_FLAG_OP_DIVWU,   // divwuo
 
124
   /* 4  */ PPCG_FLAG_OP_MULLW,   // mullwo
 
125
   /* 5  */ PPCG_FLAG_OP_NEG,     // nego
 
126
   /* 6  */ PPCG_FLAG_OP_SUBF,    // subfo
 
127
   /* 7  */ PPCG_FLAG_OP_SUBFC,   // subfc[o]
 
128
   /* 8  */ PPCG_FLAG_OP_SUBFE,   // subfe[o], subfme[o], subfze[o]
 
129
   /* 9  */ PPCG_FLAG_OP_SUBFI,   // subfic
 
130
   /* 10 */ PPCG_FLAG_OP_SRAW,    // sraw
 
131
   /* 11 */ PPCG_FLAG_OP_SRAWI,   // srawi
 
132
   /* 12 */ PPCG_FLAG_OP_SRAD,    // srad
 
133
   /* 13 */ PPCG_FLAG_OP_SRADI,   // sradi
 
134
   PPCG_FLAG_OP_NUMBER
 
135
};
 
136
 
 
137
 
 
138
/*---------------------------------------------------------*/
 
139
/*--- ppc guest helpers                                 ---*/
 
140
/*---------------------------------------------------------*/
 
141
 
 
142
/* --- CLEAN HELPERS --- */
 
143
 
 
144
/* none, right now */
 
145
 
 
146
/* --- DIRTY HELPERS --- */
 
147
 
 
148
extern ULong ppcg_dirtyhelper_MFTB ( void );
 
149
 
 
150
extern void ppc32g_dirtyhelper_LVS ( VexGuestPPC32State* gst,
 
151
                                     UInt vD_idx, UInt sh,
 
152
                                     UInt shift_right );
 
153
 
 
154
extern void ppc64g_dirtyhelper_LVS ( VexGuestPPC64State* gst,
 
155
                                     UInt vD_idx, UInt sh,
 
156
                                     UInt shift_right );
 
157
 
 
158
#endif /* ndef __LIBVEX_GUEST_PPC_DEFS_H */
 
159
 
 
160
/*---------------------------------------------------------------*/
 
161
/*--- end                                   guest-ppc/gdefs.h ---*/
 
162
/*---------------------------------------------------------------*/