i386: do not use SImode mul-highpart on 64-bit (PR 82418)
authorAlexander Monakov <amonakov@ispras.ru>
Fri, 10 Aug 2018 10:13:37 +0000 (13:13 +0300)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Fri, 10 Aug 2018 10:13:37 +0000 (13:13 +0300)
PR target/82418
* config/i386/i386.md (<s>mul<mode>3_highpart): Use DWIH mode iterator
instead of SWI48.

testsuite/
* gcc.target/i386/pr82418.c: New test.

From-SVN: r263467

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr82418.c [new file with mode: 0644]

index 28e44cf455d774b110fda651ec5d70a6a722fe07..710d164ba88dd6edc517d35308fffea735b3f8bf 100644 (file)
@@ -1,3 +1,9 @@
+2018-08-10  Alexander Monakov  <amonakov@ispras.ru>
+
+       PR target/82418
+       * config/i386/i386.md (<s>mul<mode>3_highpart): Use DWIH mode iterator
+       instead of SWI48.
+
 2018-08-10  Martin Liska  <mliska@suse.cz>
 
         PR target/83610
index 73948c12618df2c06846574d63775b5d2a79412a..10783d305d24ea12cd9def9a4e579da628d35c62 100644 (file)
    (set_attr "mode" "QI")])
 
 (define_expand "<s>mul<mode>3_highpart"
-  [(parallel [(set (match_operand:SWI48 0 "register_operand")
-                  (truncate:SWI48
+  [(parallel [(set (match_operand:DWIH 0 "register_operand")
+                  (truncate:DWIH
                     (lshiftrt:<DWI>
                       (mult:<DWI>
                         (any_extend:<DWI>
-                          (match_operand:SWI48 1 "nonimmediate_operand"))
+                          (match_operand:DWIH 1 "nonimmediate_operand"))
                         (any_extend:<DWI>
-                          (match_operand:SWI48 2 "register_operand")))
+                          (match_operand:DWIH 2 "register_operand")))
                       (match_dup 3))))
-             (clobber (match_scratch:SWI48 4))
+             (clobber (match_scratch:DWIH 4))
              (clobber (reg:CC FLAGS_REG))])]
   ""
   "operands[3] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode));")
index af9e9c17aa435301b1ae500a527fd8bfc359efe6..174137ee086a42353c686f4e557dae330e97e405 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-10  Alexander Monakov  <amonakov@ispras.ru>
+
+       PR target/82418
+       * gcc.target/i386/pr82418.c: New test.
+
 2018-08-10  Martin Liska  <mliska@suse.cz>
 
         PR target/83610
diff --git a/gcc/testsuite/gcc.target/i386/pr82418.c b/gcc/testsuite/gcc.target/i386/pr82418.c
new file mode 100644 (file)
index 0000000..95a506d
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR target/82418 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "imul\[^\n\r]*1374389535" } } */
+
+unsigned
+f1(unsigned x)
+{
+  return x / 100;
+}