diff options
author | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-10 16:06:21 +0000 |
---|---|---|
committer | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-10 16:06:21 +0000 |
commit | 260075cce06a6c9782e5115f18025cfd8155cf64 (patch) | |
tree | 82d4c7db62d2eced519a3d9e0098adac8d9ffd9a /gcc/config/s390 | |
parent | 0c4440d59f24d08e0e3d6966bd0d44447dfa6610 (diff) | |
download | gcc-260075cce06a6c9782e5115f18025cfd8155cf64.tar.gz |
2005-01-10 Mark Dettinger <dettinge@de.ibm.com>
* config/s390/s390.c (struct processor_costs): 4 new fields:
ddbr, ddr, debr, der.
(s390_rtx_costs): More precise handling of divide instructions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93142 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390')
-rw-r--r-- | gcc/config/s390/s390.c | 34 |
1 files changed, 34 insertions, 0 deletions
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: |