Revision 01547f7f
b/tcg/optimize.c | ||
---|---|---|
304 | 304 |
muls64(&l64, &h64, x, y); |
305 | 305 |
return h64; |
306 | 306 |
|
307 |
case INDEX_op_div_i32: |
|
308 |
/* Avoid crashing on divide by zero, otherwise undefined. */ |
|
309 |
return (int32_t)x / ((int32_t)y ? : 1); |
|
310 |
case INDEX_op_divu_i32: |
|
311 |
return (uint32_t)x / ((uint32_t)y ? : 1); |
|
312 |
case INDEX_op_div_i64: |
|
313 |
return (int64_t)x / ((int64_t)y ? : 1); |
|
314 |
case INDEX_op_divu_i64: |
|
315 |
return (uint64_t)x / ((uint64_t)y ? : 1); |
|
316 |
|
|
317 |
case INDEX_op_rem_i32: |
|
318 |
return (int32_t)x % ((int32_t)y ? : 1); |
|
319 |
case INDEX_op_remu_i32: |
|
320 |
return (uint32_t)x % ((uint32_t)y ? : 1); |
|
321 |
case INDEX_op_rem_i64: |
|
322 |
return (int64_t)x % ((int64_t)y ? : 1); |
|
323 |
case INDEX_op_remu_i64: |
|
324 |
return (uint64_t)x % ((uint64_t)y ? : 1); |
|
325 |
|
|
307 | 326 |
default: |
308 | 327 |
fprintf(stderr, |
309 | 328 |
"Unrecognized operation %d in do_constant_folding.\n", op); |
... | ... | |
902 | 921 |
CASE_OP_32_64(nor): |
903 | 922 |
CASE_OP_32_64(muluh): |
904 | 923 |
CASE_OP_32_64(mulsh): |
924 |
CASE_OP_32_64(div): |
|
925 |
CASE_OP_32_64(divu): |
|
926 |
CASE_OP_32_64(rem): |
|
927 |
CASE_OP_32_64(remu): |
|
905 | 928 |
if (temps[args[1]].state == TCG_TEMP_CONST |
906 | 929 |
&& temps[args[2]].state == TCG_TEMP_CONST) { |
907 | 930 |
s->gen_opc_buf[op_index] = op_to_movi(op); |
Also available in: Unified diff