Revision 3b89f26c target-sparc/op.c
b/target-sparc/op.c | ||
---|---|---|
169 | 169 |
#include "fop_template.h" |
170 | 170 |
#endif |
171 | 171 |
|
172 |
#define FLAG_SET(x) ((env->psr&x)?1:0) |
|
173 |
|
|
174 |
void OPPROTO op_udiv_T1_T0(void) |
|
175 |
{ |
|
176 |
uint64_t x0; |
|
177 |
uint32_t x1; |
|
178 |
|
|
179 |
x0 = T0 | ((uint64_t) (env->y) << 32); |
|
180 |
x1 = T1; |
|
181 |
|
|
182 |
if (x1 == 0) { |
|
183 |
raise_exception(TT_DIV_ZERO); |
|
184 |
} |
|
185 |
|
|
186 |
x0 = x0 / x1; |
|
187 |
if (x0 > 0xffffffff) { |
|
188 |
T0 = 0xffffffff; |
|
189 |
T1 = 1; |
|
190 |
} else { |
|
191 |
T0 = x0; |
|
192 |
T1 = 0; |
|
193 |
} |
|
194 |
FORCE_RET(); |
|
195 |
} |
|
196 |
|
|
197 |
void OPPROTO op_sdiv_T1_T0(void) |
|
198 |
{ |
|
199 |
int64_t x0; |
|
200 |
int32_t x1; |
|
201 |
|
|
202 |
x0 = T0 | ((int64_t) (env->y) << 32); |
|
203 |
x1 = T1; |
|
204 |
|
|
205 |
if (x1 == 0) { |
|
206 |
raise_exception(TT_DIV_ZERO); |
|
207 |
} |
|
208 |
|
|
209 |
x0 = x0 / x1; |
|
210 |
if ((int32_t) x0 != x0) { |
|
211 |
T0 = x0 < 0? 0x80000000: 0x7fffffff; |
|
212 |
T1 = 1; |
|
213 |
} else { |
|
214 |
T0 = x0; |
|
215 |
T1 = 0; |
|
216 |
} |
|
217 |
FORCE_RET(); |
|
218 |
} |
|
219 |
|
|
220 | 172 |
/* Load and store */ |
221 | 173 |
#define MEMSUFFIX _raw |
222 | 174 |
#include "op_mem.h" |
Also available in: Unified diff