[Patch X86_64]: Fix multiplication cost for -march=znver1.

Kumar, Venkataramanan Venkataramanan.Kumar@amd.com
Sat Mar 5 12:13:00 GMT 2016


Hi Maintainers,

The below patch changes multiplication cost for -march=znver1 target.  
GCC Bootstrap tested with  BOOT_CFLAGS="-O2 -g -march=znver1".

(---Snip---)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index d8a2909..b5dde5e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1350,11 +1350,11 @@ struct processor_costs znver1_cost = {
   COSTS_N_INSNS (1),                   /* cost of a lea instruction.  */
   COSTS_N_INSNS (1),                   /* variable shift costs.  */
   COSTS_N_INSNS (1),                   /* constant shift costs.  */
-  {COSTS_N_INSNS (4),                  /* cost of starting multiply for QI.  */
-   COSTS_N_INSNS (4),                  /*                               HI.  */
-   COSTS_N_INSNS (4),                  /*                               SI.  */
-   COSTS_N_INSNS (6),                  /*                               DI.  */
-   COSTS_N_INSNS (6)},                 /*                            other.  */
+  {COSTS_N_INSNS (3),                  /* cost of starting multiply for QI.  */
+   COSTS_N_INSNS (3),                  /*                               HI.  */
+   COSTS_N_INSNS (3),                  /*                               SI.  */
+   COSTS_N_INSNS (4),                  /*                               DI.  */
+   COSTS_N_INSNS (4)},                 /*                            other.  */
   0,                                   /* cost of multiply per each bit
                                            set.  */
   {COSTS_N_INSNS (19),                 /* cost of a divide/mod for QI.  */
(---Snip---)

2016-03-05  Venkataramanan Kumar  <Venkataramanan.kumar@amd.com>

         * config/i386/i386.c (znver1_cost): Fix Multiply cost.

Ok for trunk?

Regards,
Venkat.



More information about the Gcc-patches mailing list