Revision b6abf97d target-i386/op.c

b/target-i386/op.c
21 21
#define ASM_SOFTMMU
22 22
#include "exec.h"
23 23

  
24
/* n must be a constant to be efficient */
25
static inline target_long lshift(target_long x, int n)
26
{
27
    if (n >= 0)
28
        return x << n;
29
    else
30
        return x >> (-n);
31
}
32

  
33 24
/* we define the various pieces of code used by the JIT */
34 25

  
35 26
#define REG EAX
......
132 123

  
133 124
#endif
134 125

  
135
/* operations with flags */
136

  
137
/* update flags with T0 and T1 (add/sub case) */
138
void OPPROTO op_update2_cc(void)
139
{
140
    CC_SRC = T1;
141
    CC_DST = T0;
142
}
143

  
144
/* update flags with T0 (logic operation case) */
145
void OPPROTO op_update1_cc(void)
146
{
147
    CC_DST = T0;
148
}
149

  
150
void OPPROTO op_update_neg_cc(void)
151
{
152
    CC_SRC = -T0;
153
    CC_DST = T0;
154
}
155

  
156
void OPPROTO op_cmpl_T0_T1_cc(void)
157
{
158
    CC_SRC = T1;
159
    CC_DST = T0 - T1;
160
}
161

  
162
void OPPROTO op_update_inc_cc(void)
163
{
164
    CC_SRC = cc_table[CC_OP].compute_c();
165
    CC_DST = T0;
166
}
167

  
168
void OPPROTO op_testl_T0_T1_cc(void)
169
{
170
    CC_DST = T0 & T1;
171
}
172

  
173
/* operations without flags */
174

  
175
void OPPROTO op_negl_T0(void)
176
{
177
    T0 = -T0;
178
}
179

  
180
void OPPROTO op_incl_T0(void)
181
{
182
    T0++;
183
}
184

  
185
void OPPROTO op_decl_T0(void)
186
{
187
    T0--;
188
}
189

  
190
void OPPROTO op_notl_T0(void)
191
{
192
    T0 = ~T0;
193
}
194

  
195 126
/* multiply/divide */
196 127

  
197 128
/* XXX: add eflags optimizations */
......
308 239
    A0 = (uint32_t)(A0 + (EAX & 0xff));
309 240
}
310 241

  
311
#ifdef WORDS_BIGENDIAN
312
typedef union UREG64 {
313
    struct { uint16_t v3, v2, v1, v0; } w;
314
    struct { uint32_t v1, v0; } l;
315
    uint64_t q;
316
} UREG64;
317
#else
318
typedef union UREG64 {
319
    struct { uint16_t v0, v1, v2, v3; } w;
320
    struct { uint32_t v0, v1; } l;
321
    uint64_t q;
322
} UREG64;
323
#endif
324

  
325
#define PARAMQ1 \
326
({\
327
    UREG64 __p;\
328
    __p.l.v1 = PARAM1;\
329
    __p.l.v0 = PARAM2;\
330
    __p.q;\
331
})
332

  
333 242
#ifdef TARGET_X86_64
334 243

  
335 244
void OPPROTO op_addq_A0_AL(void)

Also available in: Unified diff