|
9764 | 9764 | (match_operand:DWIH 3 "nonimmediate_operand" "rm")))
|
9765 | 9765 | (set (match_operand:DWIH 1 "register_operand" "=r")
|
9766 | 9766 | (umul_highpart:DWIH (match_dup 2) (match_dup 3)))]
|
9767 |
| - "TARGET_BMI2 |
9768 |
| - && !(MEM_P (operands[2]) && MEM_P (operands[3]))" |
| 9767 | + "TARGET_BMI2" |
9769 | 9768 | "mulx\t{%3, %0, %1|%1, %0, %3}"
|
9770 | 9769 | [(set_attr "type" "imulx")
|
9771 | 9770 | (set_attr "prefix" "vex")
|
9772 | 9771 | (set_attr "mode" "<MODE>")])
|
9773 | 9772 |
|
| 9773 | +;; Tweak *bmi2_umul<mode><dwi>3_1 to eliminate following mov. |
| 9774 | +(define_peephole2 |
| 9775 | + [(parallel [(set (match_operand:DWIH 0 "general_reg_operand") |
| 9776 | + (mult:DWIH (match_operand:DWIH 2 "register_operand") |
| 9777 | + (match_operand:DWIH 3 "nonimmediate_operand"))) |
| 9778 | + (set (match_operand:DWIH 1 "general_reg_operand") |
| 9779 | + (umul_highpart:DWIH (match_dup 2) (match_dup 3)))]) |
| 9780 | + (set (match_operand:DWIH 4 "general_reg_operand") |
| 9781 | + (match_operand:DWIH 5 "general_reg_operand"))] |
| 9782 | + "TARGET_BMI2 |
| 9783 | + && ((REGNO (operands[5]) == REGNO (operands[0]) |
| 9784 | + && REGNO (operands[1]) != REGNO (operands[4])) |
| 9785 | + || (REGNO (operands[5]) == REGNO (operands[1]) |
| 9786 | + && REGNO (operands[0]) != REGNO (operands[4]))) |
| 9787 | + && peep2_reg_dead_p (2, operands[5])" |
| 9788 | + [(parallel [(set (match_dup 0) (mult:DWIH (match_dup 2) (match_dup 3))) |
| 9789 | + (set (match_dup 1) |
| 9790 | + (umul_highpart:DWIH (match_dup 2) (match_dup 3)))])] |
| 9791 | +{ |
| 9792 | + if (REGNO (operands[5]) == REGNO (operands[0])) |
| 9793 | + operands[0] = operands[4]; |
| 9794 | + else |
| 9795 | + operands[1] = operands[4]; |
| 9796 | +}) |
| 9797 | + |
9774 | 9798 | (define_insn "*umul<mode><dwi>3_1"
|
9775 | 9799 | [(set (match_operand:<DWI> 0 "register_operand" "=r,A")
|
9776 | 9800 | (mult:<DWI>
|
|
0 commit comments