Revision d9ba4830 target-arm/op.c

b/target-arm/op.c
80 80

  
81 81
OPSUB(rsb, rsc, T0, T1, T0)
82 82

  
83
#define EIP (env->regs[15])
84

  
85
void OPPROTO op_test_eq(void)
86
{
87
    if (env->NZF == 0)
88
        GOTO_LABEL_PARAM(1);;
89
    FORCE_RET();
90
}
91

  
92
void OPPROTO op_test_ne(void)
93
{
94
    if (env->NZF != 0)
95
        GOTO_LABEL_PARAM(1);;
96
    FORCE_RET();
97
}
98

  
99
void OPPROTO op_test_cs(void)
100
{
101
    if (env->CF != 0)
102
        GOTO_LABEL_PARAM(1);
103
    FORCE_RET();
104
}
105

  
106
void OPPROTO op_test_cc(void)
107
{
108
    if (env->CF == 0)
109
        GOTO_LABEL_PARAM(1);
110
    FORCE_RET();
111
}
112

  
113
void OPPROTO op_test_mi(void)
114
{
115
    if ((env->NZF & 0x80000000) != 0)
116
        GOTO_LABEL_PARAM(1);
117
    FORCE_RET();
118
}
119

  
120
void OPPROTO op_test_pl(void)
121
{
122
    if ((env->NZF & 0x80000000) == 0)
123
        GOTO_LABEL_PARAM(1);
124
    FORCE_RET();
125
}
126

  
127
void OPPROTO op_test_vs(void)
128
{
129
    if ((env->VF & 0x80000000) != 0)
130
        GOTO_LABEL_PARAM(1);
131
    FORCE_RET();
132
}
133

  
134
void OPPROTO op_test_vc(void)
135
{
136
    if ((env->VF & 0x80000000) == 0)
137
        GOTO_LABEL_PARAM(1);
138
    FORCE_RET();
139
}
140

  
141
void OPPROTO op_test_hi(void)
142
{
143
    if (env->CF != 0 && env->NZF != 0)
144
        GOTO_LABEL_PARAM(1);
145
    FORCE_RET();
146
}
147

  
148
void OPPROTO op_test_ls(void)
149
{
150
    if (env->CF == 0 || env->NZF == 0)
151
        GOTO_LABEL_PARAM(1);
152
    FORCE_RET();
153
}
154

  
155
void OPPROTO op_test_ge(void)
156
{
157
    if (((env->VF ^ env->NZF) & 0x80000000) == 0)
158
        GOTO_LABEL_PARAM(1);
159
    FORCE_RET();
160
}
161

  
162
void OPPROTO op_test_lt(void)
163
{
164
    if (((env->VF ^ env->NZF) & 0x80000000) != 0)
165
        GOTO_LABEL_PARAM(1);
166
    FORCE_RET();
167
}
168

  
169
void OPPROTO op_test_gt(void)
170
{
171
    if (env->NZF != 0 && ((env->VF ^ env->NZF) & 0x80000000) == 0)
172
        GOTO_LABEL_PARAM(1);
173
    FORCE_RET();
174
}
175

  
176
void OPPROTO op_test_le(void)
177
{
178
    if (env->NZF == 0 || ((env->VF ^ env->NZF) & 0x80000000) != 0)
179
        GOTO_LABEL_PARAM(1);
180
    FORCE_RET();
181
}
182

  
183
void OPPROTO op_test_T0(void)
184
{
185
    if (T0)
186
        GOTO_LABEL_PARAM(1);
187
    FORCE_RET();
188
}
189
void OPPROTO op_testn_T0(void)
190
{
191
    if (!T0)
192
        GOTO_LABEL_PARAM(1);
193
    FORCE_RET();
194
}
195

  
196
void OPPROTO op_movl_T0_cpsr(void)
197
{
198
    /* Execution state bits always read as zero.  */
199
    T0 = cpsr_read(env) & ~CPSR_EXEC;
200
    FORCE_RET();
201
}
202

  
203
void OPPROTO op_movl_T0_spsr(void)
204
{
205
    T0 = env->spsr;
206
}
207

  
208
void OPPROTO op_movl_spsr_T0(void)
209
{
210
    uint32_t mask = PARAM1;
211
    env->spsr = (env->spsr & ~mask) | (T0 & mask);
212
}
213

  
214
void OPPROTO op_movl_cpsr_T0(void)
215
{
216
    cpsr_write(env, T0, PARAM1);
217
    FORCE_RET();
218
}
219

  
220
/* 48 bit signed mul, top 32 bits */
221
void OPPROTO op_imulw_T0_T1(void)
222
{
223
  uint64_t res;
224
  res = (int64_t)((int32_t)T0) * (int64_t)((int32_t)T1);
225
  T0 = res >> 16;
226
}
227

  
228 83
void OPPROTO op_addq_T0_T1(void)
229 84
{
230 85
    uint64_t res;
......
397 252
    FORCE_RET();
398 253
}
399 254

  
400
/* exceptions */
401

  
402
void OPPROTO op_swi(void)
403
{
404
    env->exception_index = EXCP_SWI;
405
    cpu_loop_exit();
406
}
407

  
408
void OPPROTO op_undef_insn(void)
409
{
410
    env->exception_index = EXCP_UDEF;
411
    cpu_loop_exit();
412
}
413

  
414
void OPPROTO op_debug(void)
415
{
416
    env->exception_index = EXCP_DEBUG;
417
    cpu_loop_exit();
418
}
419

  
420
void OPPROTO op_wfi(void)
421
{
422
    env->exception_index = EXCP_HLT;
423
    env->halted = 1;
424
    cpu_loop_exit();
425
}
426

  
427
void OPPROTO op_bkpt(void)
428
{
429
    env->exception_index = EXCP_BKPT;
430
    cpu_loop_exit();
431
}
432

  
433
void OPPROTO op_exception_exit(void)
434
{
435
    env->exception_index = EXCP_EXCEPTION_EXIT;
436
    cpu_loop_exit();
437
}
438

  
439 255
/* VFP support.  We follow the convention used for VFP instrunctions:
440 256
   Single precition routines have a "s" suffix, double precision a
441 257
   "d" suffix.  */

Also available in: Unified diff