From: MITSUNARI Shigeo <[email protected]>

This series keeps the expmed path changes focused on the existing
try-and-fallback flow, adds a non-BMI2 x86_64 testcase for the widened
high-part multiply path, keeps the BMI2 mulx testcase, and adds the
peephole2 that converts a mov + highpart-mul sequence into mulx.

Changes since v2:
- clarify expmed comments/wording
- rename the local flag to did_wide_mulh_path
- use uint64_t for the magic constant computation
- add gcc.target/i386/mulq-highpart.c
- include Signed-off-by lines for DCO compliance

MITSUNARI Shigeo (3):
  expmed: Optimize 32-bit unsigned division by constants on 64-bit
    targets
  i386: Add BMI2 MULX pattern for highpart-only multiplication
  i386: Add peephole2 to convert highpart mul to mulx

 gcc/config/i386/i386.md                       | 32 +++++++
 gcc/expmed.cc                                 | 90 +++++++++++++------
 .../gcc.target/i386/bmi2-mulx-highpart-1.c    | 18 ++++
 .../gcc.target/i386/bmi2-mulx-highpart-2.c    | 19 ++++
 gcc/testsuite/gcc.target/i386/mulq-highpart.c | 19 ++++
 5 files changed, 151 insertions(+), 27 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/bmi2-mulx-highpart-1.c
 create mode 100644 gcc/testsuite/gcc.target/i386/bmi2-mulx-highpart-2.c
 create mode 100644 gcc/testsuite/gcc.target/i386/mulq-highpart.c

-- 
2.43.0

Reply via email to