Commit 815cdc52 by Michael Meissner Committed by Michael Meissner

Use alternate crs if cr0 not available

From-SVN: r24821
parent d062c304
1999-01-22 Michael Meissner <meissner@cygnus.com>
* rs6000.h (CR0_REGNO_P): New macro to test if cr0.
(CR_REGNO_NOT_CR0_P): New macro to test if cr, but not cr0.
(PREDICATE_CODES): Add cc_reg_not_cr0_operand.
(cc_reg_not_cr0_operand): Add declaration.
* rs6000.c (cc_reg_not_cr0_operand): Return true if register is a
pseudo register, or a control register that is not CR0.
* rs6000.md (all combiner patterns building . instructions): For
all `.' instructions that do something and set cr0, add an
alternative that does the operation, and then sets a different
flag, in order to avoid using the costly mcrf instruction and also
allow cr0 to be clobbered in asm statements. Also fix a few
patterns that used the wrong register.
* rs6000.h (rs6000_cpu_select): Make string, names be const char *.
(rs6000_debug_name): Make const char *, not char *.
* sysv4.h (rs6000_{abi,sdata}_name): Make const char *.
* rs6000.c (rs6000_{debug,abi,sdata}_name): Make const char *.
(rs6000_select): Use const char * in casts.
Fri Jan 22 07:43:01 1999 Jeffrey A Law (law@cygnus.com)
* Makefile.in (gcc_tooldir): Move before first reference.
......
......@@ -54,10 +54,10 @@ extern int profile_block_flag;
enum processor_type rs6000_cpu;
struct rs6000_cpu_select rs6000_select[3] =
{
/* switch name, tune arch */
{ (char *)0, "--with-cpu=", 1, 1 },
{ (char *)0, "-mcpu=", 1, 1 },
{ (char *)0, "-mtune=", 1, 0 },
/* switch name, tune arch */
{ (const char *)0, "--with-cpu=", 1, 1 },
{ (const char *)0, "-mcpu=", 1, 1 },
{ (const char *)0, "-mtune=", 1, 0 },
};
/* Set to non-zero by "fix" operation to indicate that itrunc and
......@@ -84,13 +84,13 @@ int rs6000_pic_labelno;
int rs6000_pic_func_labelno;
/* Which abi to adhere to */
char *rs6000_abi_name = RS6000_ABI_NAME;
const char *rs6000_abi_name = RS6000_ABI_NAME;
/* Semantics of the small data area */
enum rs6000_sdata_type rs6000_sdata = SDATA_DATA;
/* Which small data model to use */
char *rs6000_sdata_name = (char *)0;
const char *rs6000_sdata_name = (char *)0;
#endif
/* Whether a System V.4 varargs area was created. */
......@@ -105,7 +105,7 @@ int rs6000_fpmem_offset;
int rs6000_fpmem_size;
/* Debug flags */
char *rs6000_debug_name;
const char *rs6000_debug_name;
int rs6000_debug_stack; /* debug stack applications */
int rs6000_debug_arg; /* debug argument handling */
......@@ -559,6 +559,20 @@ cc_reg_operand (op, mode)
|| CR_REGNO_P (REGNO (op))));
}
/* Returns 1 if OP is either a pseudo-register or a register denoting a
CR field that isn't CR0. */
int
cc_reg_not_cr0_operand (op, mode)
register rtx op;
enum machine_mode mode;
{
return (register_operand (op, mode)
&& (GET_CODE (op) != REG
|| REGNO (op) >= FIRST_PSEUDO_REGISTER
|| CR_REGNO_NOT_CR0_P (REGNO (op))));
}
/* Returns 1 if OP is either a constant integer valid for a D-field or a
non-special register. If a register, it must be in the proper mode unless
MODE is VOIDmode. */
......
......@@ -461,8 +461,8 @@ extern enum processor_type rs6000_cpu;
/* rs6000_select[0] is reserved for the default cpu defined via --with-cpu */
struct rs6000_cpu_select
{
char *string;
char *name;
const char *string;
const char *name;
int set_tune_p;
int set_arch_p;
};
......@@ -470,7 +470,7 @@ struct rs6000_cpu_select
extern struct rs6000_cpu_select rs6000_select[];
/* Debug support */
extern char *rs6000_debug_name; /* Name for -mdebug-xxxx option */
extern const char *rs6000_debug_name; /* Name for -mdebug-xxxx option */
extern int rs6000_debug_stack; /* debug stack applications */
extern int rs6000_debug_arg; /* debug argument handling */
......@@ -765,6 +765,12 @@ extern int rs6000_debug_arg; /* debug argument handling */
/* True if register is a condition register. */
#define CR_REGNO_P(N) ((N) >= 68 && (N) <= 75)
/* True if register is condition register 0. */
#define CR0_REGNO_P(N) ((N) == 68)
/* True if register is a condition register, but not cr0. */
#define CR_REGNO_NOT_CR0_P(N) ((N) >= 69 && (N) <= 75)
/* True if register is an integer register. */
#define INT_REGNO_P(N) ((N) <= 31 || (N) == 67)
......@@ -3208,6 +3214,7 @@ do { \
{"non_short_cint_operand", {CONST_INT}}, \
{"gpc_reg_operand", {SUBREG, REG}}, \
{"cc_reg_operand", {SUBREG, REG}}, \
{"cc_reg_not_cr0_operand", {SUBREG, REG}}, \
{"reg_or_short_operand", {SUBREG, REG, CONST_INT}}, \
{"reg_or_neg_short_operand", {SUBREG, REG, CONST_INT}}, \
{"reg_or_u_short_operand", {SUBREG, REG, CONST_INT}}, \
......@@ -3272,6 +3279,7 @@ extern int u_short_cint_operand ();
extern int non_short_cint_operand ();
extern int gpc_reg_operand ();
extern int cc_reg_operand ();
extern int cc_reg_not_cr0_operand ();
extern int reg_or_short_operand ();
extern int reg_or_neg_short_operand ();
extern int reg_or_u_short_operand ();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* Target definitions for GNU compiler for PowerPC running System V.4
Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GNU CC.
......@@ -107,8 +107,8 @@ extern enum rs6000_sdata_type rs6000_sdata;
#define RS6000_ABI_NAME "sysv"
/* Strings provided by SUBTARGET_OPTIONS */
extern char *rs6000_abi_name;
extern char *rs6000_sdata_name;
extern const char *rs6000_abi_name;
extern const char *rs6000_sdata_name;
#define SUBTARGET_OPTIONS \
{ "call-", &rs6000_abi_name}, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment