aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sparc/sparc.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.davemloft.net>2004-07-09 22:59:32 +0000
committerDavid S. Miller <davem@gcc.gnu.org>2004-07-09 15:59:32 -0700
commit18df6de934489a4ace9de466d596efb7f6ecf5b0 (patch)
tree9b9c0d3ba55cbc78ce2f3096de48e1c4002e38d0 /gcc/config/sparc/sparc.h
parenta3e8d8b400125d422085e28d40c1960bf5dcb6b7 (diff)
downloadgcc-18df6de934489a4ace9de466d596efb7f6ecf5b0.zip
gcc-18df6de934489a4ace9de466d596efb7f6ecf5b0.tar.gz
gcc-18df6de934489a4ace9de466d596efb7f6ecf5b0.tar.bz2
sparc.h (processor_costs): Define.
2004-07-02 David S. Miller <davem@nuts.davemloft.net> * config/sparc/sparc.h (processor_costs): Define. (sparc_costs): Declare. * config/sparc/sparc.c (cypress_costs, supersparc_costs, hypersparc_costs, sparclet_costs, ultrasparc_costs, ultrasparc3_costs): New. (sparc_override_options): Set sparc_costs as appropriate. (sparc_rtx_costs): Use sparc_costs instead of messy conditionals. From-SVN: r84414
Diffstat (limited to 'gcc/config/sparc/sparc.h')
-rw-r--r--gcc/config/sparc/sparc.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 375f65f..d0f75d2 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -25,6 +25,84 @@ Boston, MA 02111-1307, USA. */
/* Note that some other tm.h files include this one and then override
whatever definitions are necessary. */
+/* Define the specific costs for a given cpu */
+
+struct processor_costs {
+ /* Integer load */
+ const int int_load;
+
+ /* Integer signed load */
+ const int int_sload;
+
+ /* Integer zeroed load */
+ const int int_zload;
+
+ /* Float load */
+ const int float_load;
+
+ /* fmov, fneg, fabs */
+ const int float_move;
+
+ /* fadd, fsub */
+ const int float_plusminus;
+
+ /* fcmp */
+ const int float_cmp;
+
+ /* fmov, fmovr */
+ const int float_cmove;
+
+ /* fmul */
+ const int float_mul;
+
+ /* fdivs */
+ const int float_div_sf;
+
+ /* fdivd */
+ const int float_div_df;
+
+ /* fsqrts */
+ const int float_sqrt_sf;
+
+ /* fsqrtd */
+ const int float_sqrt_df;
+
+ /* umul/smul */
+ const int int_mul;
+
+ /* mulX */
+ const int int_mulX;
+
+ /* integer multiply cost for each bit set past the most
+ significant 3, so the formula for multiply cost becomes:
+
+ if (rs1 < 0)
+ highest_bit = highest_clear_bit(rs1);
+ else
+ highest_bit = highest_set_bit(rs1);
+ if (highest_bit < 3)
+ highest_bit = 3;
+ cost = int_mul{,X} + ((highest_bit - 3) / int_mul_bit_factor);
+
+ A value of zero indicates that the multiply costs is fixed,
+ and not variable. */
+ const int int_mul_bit_factor;
+
+ /* udiv/sdiv */
+ const int int_div;
+
+ /* divX */
+ const int int_divX;
+
+ /* movcc, movr */
+ const int int_cmove;
+
+ /* penalty for shifts, due to scheduling rules etc. */
+ const int shift_penalty;
+};
+
+extern const struct processor_costs *sparc_costs;
+
/* Target CPU builtins. FIXME: Defining sparc is for the benefit of
Solaris only; otherwise just define __sparc__. Sadly the headers
are such a mess there is no Solaris-specific header. */