|
1352 | 1352 | DONE;
|
1353 | 1353 | })
|
1354 | 1354 |
|
1355 |
| -(define_expand "usubv<mode>4" |
1356 |
| - [(match_operand:SIDI 0 "register_operand") |
1357 |
| - (match_operand:SIDI 1 "register_operand") |
1358 |
| - (match_operand:SIDI 2 "register_operand") |
| 1355 | +(define_expand "usubvsi4" |
| 1356 | + [(match_operand:SI 0 "s_register_operand") |
| 1357 | + (match_operand:SI 1 "arm_rhs_operand") |
| 1358 | + (match_operand:SI 2 "arm_add_operand") |
1359 | 1359 | (match_operand 3 "")]
|
1360 | 1360 | "TARGET_32BIT"
|
1361 | 1361 | {
|
1362 |
| - emit_insn (gen_sub<mode>3_compare1 (operands[0], operands[1], operands[2])); |
| 1362 | + machine_mode mode = CCmode; |
| 1363 | + if (CONST_INT_P (operands[1]) && CONST_INT_P (operands[2])) |
| 1364 | + { |
| 1365 | + /* If both operands are constants we can decide the result statically. */ |
| 1366 | + wi::overflow_type overflow; |
| 1367 | + wide_int val = wi::sub (rtx_mode_t (operands[1], SImode), |
| 1368 | + rtx_mode_t (operands[2], SImode), |
| 1369 | + UNSIGNED, &overflow); |
| 1370 | + emit_move_insn (operands[0], GEN_INT (val.to_shwi ())); |
| 1371 | + if (overflow != wi::OVF_NONE) |
| 1372 | + emit_jump_insn (gen_jump (operands[3])); |
| 1373 | + DONE; |
| 1374 | + } |
| 1375 | + else if (CONST_INT_P (operands[2])) |
| 1376 | + emit_insn (gen_cmpsi2_addneg (operands[0], operands[1], operands[2], |
| 1377 | + GEN_INT (-INTVAL (operands[2])))); |
| 1378 | + else if (CONST_INT_P (operands[1])) |
| 1379 | + { |
| 1380 | + mode = CC_RSBmode; |
| 1381 | + emit_insn (gen_rsb_imm_compare (operands[0], operands[1], operands[2], |
| 1382 | + GEN_INT (~UINTVAL (operands[1])))); |
| 1383 | + } |
| 1384 | + else |
| 1385 | + emit_insn (gen_subsi3_compare1 (operands[0], operands[1], operands[2])); |
| 1386 | + arm_gen_unlikely_cbranch (LTU, mode, operands[3]); |
| 1387 | + |
| 1388 | + DONE; |
| 1389 | +}) |
| 1390 | + |
| 1391 | +(define_expand "usubvdi4" |
| 1392 | + [(match_operand:DI 0 "s_register_operand") |
| 1393 | + (match_operand:DI 1 "s_register_operand") |
| 1394 | + (match_operand:DI 2 "s_register_operand") |
| 1395 | + (match_operand 3 "")] |
| 1396 | + "TARGET_32BIT" |
| 1397 | +{ |
| 1398 | + emit_insn (gen_subdi3_compare1 (operands[0], operands[1], operands[2])); |
1363 | 1399 | arm_gen_unlikely_cbranch (LTU, CCmode, operands[3]);
|
1364 | 1400 |
|
1365 | 1401 | DONE;
|
|
0 commit comments