|
4413 | 4413 | [(set_attr "type" "csel")] |
4414 | 4414 | ) |
4415 | 4415 |
|
| 4416 | +;; There are two canonical forms for `cmp ? ~a : a`. |
| 4417 | +;; This is the second form and is here to help combine. |
| 4418 | +;; Support `-(cmp) ^ a` into `cmp ? ~a : a` |
| 4419 | +;; The second pattern is to support the zero extend'ed version. |
| 4420 | + |
| 4421 | +(define_insn_and_split "*cmov<mode>_insn_insv" |
| 4422 | + [(set (match_operand:GPI 0 "register_operand" "=r") |
| 4423 | + (xor:GPI |
| 4424 | + (neg:GPI |
| 4425 | + (match_operator:GPI 1 "aarch64_comparison_operator" |
| 4426 | + [(match_operand 2 "cc_register" "") (const_int 0)])) |
| 4427 | + (match_operand:GPI 3 "general_operand" "r")))] |
| 4428 | + "" |
| 4429 | + "#" |
| 4430 | + "&& true" |
| 4431 | + [(set (match_dup 0) |
| 4432 | + (if_then_else:GPI (match_dup 1) |
| 4433 | + (not:GPI (match_dup 3)) |
| 4434 | + (match_dup 3)))] |
| 4435 | + { |
| 4436 | + /* After reload this will be a nop due to the constraint. */ |
| 4437 | + operands[3] = force_reg (<MODE>mode, operands[3]); |
| 4438 | + } |
| 4439 | + [(set_attr "type" "csel")] |
| 4440 | +) |
| 4441 | + |
| 4442 | +(define_insn_and_split "*cmov_uxtw_insn_insv" |
| 4443 | + [(set (match_operand:DI 0 "register_operand" "=r") |
| 4444 | + (zero_extend:DI |
| 4445 | + (xor:SI |
| 4446 | + (neg:SI |
| 4447 | + (match_operator:SI 1 "aarch64_comparison_operator" |
| 4448 | + [(match_operand 2 "cc_register" "") (const_int 0)])) |
| 4449 | + (match_operand:SI 3 "general_operand" "r"))))] |
| 4450 | + "can_create_pseudo_p ()" |
| 4451 | + "#" |
| 4452 | + "&& true" |
| 4453 | + [(set (match_dup 0) |
| 4454 | + (if_then_else:DI (match_dup 1) |
| 4455 | + (zero_extend:DI (not:SI (match_dup 3))) |
| 4456 | + (zero_extend:DI (match_dup 3))))] |
| 4457 | + { |
| 4458 | + operands[3] = force_reg (SImode, operands[3]); |
| 4459 | + } |
| 4460 | + [(set_attr "type" "csel")] |
| 4461 | +) |
| 4462 | + |
4416 | 4463 | ;; If X can be loaded by a single CNT[BHWD] instruction, |
4417 | 4464 | ;; |
4418 | 4465 | ;; A = UMAX (B, X) |
|
0 commit comments