From 98fd0d70ae5130232f8d2457dd687bac4a839961 Mon Sep 17 00:00:00 2001 From: Mark Dettinger Date: Mon, 10 Jan 2005 16:06:21 +0000 Subject: [PATCH] s390.c (struct processor_costs): 4 new fields: ddbr, ddr, debr, der. 2005-01-10 Mark Dettinger * config/s390/s390.c (struct processor_costs): 4 new fields: ddbr, ddr, debr, der. (s390_rtx_costs): More precise handling of divide instructions. From-SVN: r93142 --- gcc/ChangeLog | 6 ++++++ gcc/config/s390/s390.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 08b7e634dcc..42292adbb6b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-01-10 Mark Dettinger + + * config/s390/s390.c (struct processor_costs): 4 new fields: + ddbr, ddr, debr, der. + (s390_rtx_costs): More precise handling of divide instructions. + 2005-01-10 David Edelsohn * config/rs6000/t-aix43 (BOOT_LDFLAGS): Define. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 2f6bcec8148..2ce2cc833dc 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -90,6 +90,7 @@ static enum machine_mode s390_cc_modes_compatible (enum machine_mode, struct processor_costs { + /* multiplication */ const int m; /* cost of an M instruction. */ const int mghi; /* cost of an MGHI instruction. */ const int mh; /* cost of an MH instruction. */ @@ -103,10 +104,17 @@ struct processor_costs const int msgr; /* cost of an MSGR instruction. */ const int msr; /* cost of an MSR instruction. */ const int mult_df; /* cost of multiplication in DFmode. */ + /* square root */ const int sqdbr; /* cost of square root in DFmode. */ const int sqebr; /* cost of square root in SFmode. */ + /* multiply and add */ const int madbr; /* cost of multiply and add in DFmode. */ const int maebr; /* cost of multiply and add in SFmode. */ + /* division */ + const int ddbr; + const int ddr; + const int debr; + const int der; }; const struct processor_costs *s390_cost; @@ -131,6 +139,10 @@ struct processor_costs z900_cost = COSTS_N_INSNS (35), /* SQEBR */ COSTS_N_INSNS (18), /* MADBR */ COSTS_N_INSNS (13), /* MAEBR */ + COSTS_N_INSNS (30), /* DDBR */ + COSTS_N_INSNS (30), /* DDR */ + COSTS_N_INSNS (27), /* DEBR */ + COSTS_N_INSNS (26), /* DER */ }; static const @@ -153,6 +165,10 @@ struct processor_costs z990_cost = COSTS_N_INSNS (38), /* SQEBR */ COSTS_N_INSNS (1), /* MADBR */ COSTS_N_INSNS (1), /* MAEBR */ + COSTS_N_INSNS (40), /* DDBR */ + COSTS_N_INSNS (44), /* DDR */ + COSTS_N_INSNS (26), /* DDBR */ + COSTS_N_INSNS (28), /* DER */ }; @@ -1982,6 +1998,24 @@ s390_rtx_costs (rtx x, int code, int outer_code, int *total) return false; case DIV: + if (GET_MODE (x) == SFmode) + { + if (TARGET_IEEE_FLOAT) + *total = s390_cost->debr; + else /* TARGET_IBM_FLOAT */ + *total = s390_cost->der; + } + else if (GET_MODE (x) == DFmode) + { + if (TARGET_IEEE_FLOAT) + *total = s390_cost->ddbr; + else /* TARGET_IBM_FLOAT */ + *total = s390_cost->ddr; + } + else + *total = COSTS_N_INSNS (33); + return false; + case UDIV: case MOD: case UMOD: -- 2.30.2