+2003-04-06 Aldy Hernandez <aldyh@redhat.com>
+
+ * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mspe
+ option.
+
+ * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Set
+ rs6000_spe.
+
+ * config/rs6000/eabi.h (TARGET_E500): Define.
+
+ * config/rs6000/rs6000.h (TARGET_E500): Define.
+ (TARGET_OPTIONS): Add spe= option.
+ Declare rs6000_spe and rs6000_spe_string extern.
+
+ * config/rs6000/rs6000.c (branch_positive_comparison_operator):
+ Change TARGET_SPE to TARGET_E500.
+ (ccr_bit): Change TARGET_SPE to TARGET_E500. Check for
+ !TARGET_FPRS.
+ (print_operand): Same.
+ (rs6000_generate_compare): Same.
+ (output_cbranch): Same.
+ (rs6000_spe): Declare.
+ (rs6000_spe_string): Declare.
+ (rs6000_override_options): Call rs6000_parse_spe_option.
+ (rs6000_parse_spe_option): New.
+
2003-04-06 Steven Bosscher <steven@gcc.gnu.org>
* hashtable.c (gcc_obstack_init): Delete this function
/* Whether isel instructions should be generated. */
int rs6000_isel;
+/* Whether SPE simd instructions should be generated. */
+int rs6000_spe;
+
/* Nonzero if we have FPRs. */
int rs6000_fprs = 1;
/* String from -misel=. */
const char *rs6000_isel_string;
+/* String from -mspe=. */
+const char *rs6000_spe_string;
+
/* Set to nonzero once AIX common-mode calls have been defined. */
static GTY(()) int common_mode_defined;
static void rs6000_parse_abi_options PARAMS ((void));
static void rs6000_parse_vrsave_option PARAMS ((void));
static void rs6000_parse_isel_option PARAMS ((void));
+static void rs6000_parse_spe_option (void);
static int first_altivec_reg_to_save PARAMS ((void));
static unsigned int compute_vrsave_mask PARAMS ((void));
static void is_altivec_return_reg PARAMS ((rtx, void *));
}
}
- if (rs6000_cpu == PROCESSOR_PPC8540)
+ if (TARGET_E500)
rs6000_isel = 1;
/* If we are optimizing big endian systems for space, use the load/store
/* Handle -misel= option. */
rs6000_parse_isel_option ();
+ /* Handle -mspe= option. */
+ rs6000_parse_spe_option ();
+
#ifdef SUBTARGET_OVERRIDE_OPTIONS
SUBTARGET_OVERRIDE_OPTIONS;
#endif
rs6000_isel_string);
}
+/* Handle -mspe= option. */
+static void
+rs6000_parse_spe_option (void)
+{
+ if (rs6000_spe_string == 0)
+ return;
+ else if (!strcmp (rs6000_spe_string, "yes"))
+ rs6000_spe = 1;
+ else if (!strcmp (rs6000_spe_string, "no"))
+ rs6000_spe = 0;
+ else
+ error ("unknown -mspe= option specified: '%s'", rs6000_spe_string);
+}
+
/* Handle -mvrsave= options. */
static void
rs6000_parse_vrsave_option ()
code = GET_CODE (op);
return (code == EQ || code == LT || code == GT
- || (TARGET_SPE && TARGET_HARD_FLOAT && !TARGET_FPRS && code == NE)
+ || (TARGET_E500 && TARGET_HARD_FLOAT && !TARGET_FPRS && code == NE)
|| code == LTU || code == GTU
|| code == UNORDERED);
}
switch (code)
{
case NE:
- if (TARGET_SPE && TARGET_HARD_FLOAT && cc_mode == CCFPmode)
+ if (TARGET_E500 && !TARGET_FPRS
+ && TARGET_HARD_FLOAT && cc_mode == CCFPmode)
return base_bit + 1;
return scc_p ? base_bit + 3 : base_bit + 2;
case EQ:
- if (TARGET_SPE && TARGET_HARD_FLOAT && cc_mode == CCFPmode)
+ if (TARGET_E500 && !TARGET_FPRS
+ && TARGET_HARD_FLOAT && cc_mode == CCFPmode)
return base_bit + 1;
return base_bit + 2;
case GT: case GTU: case UNLE:
fprintf (file, "crnor %d,%d,%d\n\t", base_bit + 3,
base_bit + 2, base_bit + 2);
}
- else if (TARGET_SPE && TARGET_HARD_FLOAT
+ else if (TARGET_E500 && !TARGET_FPRS && TARGET_HARD_FLOAT
&& GET_CODE (x) == EQ
&& GET_MODE (XEXP (x, 0)) == CCFPmode)
{
tmp = XEXP (x, 0);
- if (TARGET_SPE)
+ if (TARGET_E500)
{
/* Handle [reg]. */
if (GET_CODE (tmp) == REG)
compare_result = gen_reg_rtx (comp_mode);
/* SPE FP compare instructions on the GPRs. Yuck! */
- if ((TARGET_SPE && TARGET_HARD_FLOAT) && rs6000_compare_fp_p)
+ if ((TARGET_E500 && !TARGET_FPRS && TARGET_HARD_FLOAT)
+ && rs6000_compare_fp_p)
{
rtx cmp, or1, or2, or_result, compare_result2;
except for flag_unsafe_math_optimizations we don't bother. */
if (rs6000_compare_fp_p
&& ! flag_unsafe_math_optimizations
- && ! (TARGET_HARD_FLOAT && TARGET_SPE)
+ && ! (TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS)
&& (code == LE || code == GE
|| code == UNEQ || code == LTGT
|| code == UNGT || code == UNLT))
code = reverse_condition (code);
}
- if ((TARGET_SPE && TARGET_HARD_FLOAT) && mode == CCFPmode)
+ if ((TARGET_E500 && !TARGET_FPRS && TARGET_HARD_FLOAT) && mode == CCFPmode)
{
/* The efscmp/tst* instructions twiddle bit 2, which maps nicely
to the GT bit. */
N_("Specify size of long double (64 or 128 bits)") }, \
{"isel=", &rs6000_isel_string, \
N_("Specify yes/no if isel instructions should be generated") }, \
+ {"spe=", &rs6000_spe_string, \
+ N_("Specify yes/no if SPE SIMD instructions should be generated") },\
{"vrsave=", &rs6000_altivec_vrsave_string, \
N_("Specify yes/no if VRSAVE instructions should be generated for AltiVec") }, \
{"longcall", &rs6000_longcall_switch, \
extern int rs6000_altivec_abi;
extern int rs6000_spe_abi;
extern int rs6000_isel;
+extern int rs6000_spe;
extern int rs6000_fprs;
extern const char *rs6000_isel_string;
+extern const char *rs6000_spe_string;
extern const char *rs6000_altivec_vrsave_string;
extern int rs6000_altivec_vrsave;
extern const char *rs6000_longcall_switch;
#define TARGET_SPE_ABI 0
#define TARGET_SPE 0
+#define TARGET_E500 0
#define TARGET_ISEL 0
#define TARGET_FPRS 1