Commit 4d4cbc0e by Aldy Hernandez Committed by Aldy Hernandez

config.gcc: Add support for --enable-e500_double.

	* config.gcc: Add support for --enable-e500_double.

	* config/rs6000/e500-double.h: New file.

	* config/rs6000/rs6000.h: Define TARGET_E500_SINGLE and
	TARGET_E500_DOUBLE.

	* config/rs6000/eabi.h: Define TARGET_E500_SINGLE and
	TARGET_E500_DOUBLE.

	* config/rs6000/linuxspe.h: Same.

	* doc/invoke.texi (Option Summary): Document new options for
	mfloat-gprs.
	(RS/6000 and PowerPC Options): Same.

	* config/rs6000/rs6000.c (rs6000_parse_float_gprs_option): New
	function.
	(rs6000_override_options): Use it.  Use
	SUB3TARGET_OVERRIDE_OPTIONS.
	Add 8548 to processor_target_table.
	(rs6000_legitimate_address): Handle e500 doubles.
	(rs6000_legitimize_address): Same.
	(rs6000_legitimize_reload_address): Same.
	(rs6000_hard_regno_nregs): Same.
	(spe_func_has_64bit_regs_p): Same.
	(emit_frame_save): Same.
	(gen_frame_mem_offset): Same.
	(rs6000_dwarf_register_span): Same.
	(rs6000_generate_compare): Same.
	(easy_fp_constant): Same.
	(legitimate_offset_address_p): Same.

	* config/rs6000/spe.md: (cmdfeq_gpr): New.
	(tstdfeq_gpr): New.
	(cmpdfgt_gpr): New.
	(tstdfgt_gpr): New.
	(tstdfgt_gpr): New.
	(cmpdflt_gpr): New.
	(tstdflt_gpr): New.
	Add new constants.

From-SVN: r89416
parent cbf52bfa
2004-10-21 Aldy Hernandez <aldyh@redhat.com>
* config.gcc: Add support for --enable-e500_double.
* config/rs6000/e500-double.h: New file.
* config/rs6000/rs6000.h: Define TARGET_E500_SINGLE and
TARGET_E500_DOUBLE.
* config/rs6000/eabi.h: Define TARGET_E500_SINGLE and
TARGET_E500_DOUBLE.
* config/rs6000/linuxspe.h: Same.
* doc/invoke.texi (Option Summary): Document new options for
mfloat-gprs.
(RS/6000 and PowerPC Options): Same.
* config/rs6000/rs6000.c (rs6000_parse_float_gprs_option): New
function.
(rs6000_override_options): Use it. Use
SUB3TARGET_OVERRIDE_OPTIONS.
Add 8548 to processor_target_table.
(rs6000_legitimate_address): Handle e500 doubles.
(rs6000_legitimize_address): Same.
(rs6000_legitimize_reload_address): Same.
(rs6000_hard_regno_nregs): Same.
(spe_func_has_64bit_regs_p): Same.
(emit_frame_save): Same.
(gen_frame_mem_offset): Same.
(rs6000_dwarf_register_span): Same.
(rs6000_generate_compare): Same.
(easy_fp_constant): Same.
(legitimate_offset_address_p): Same.
* config/rs6000/spe.md: (cmdfeq_gpr): New.
(tstdfeq_gpr): New.
(cmpdfgt_gpr): New.
(tstdfgt_gpr): New.
(tstdfgt_gpr): New.
(cmpdflt_gpr): New.
(tstdflt_gpr): New.
Add new constants.
2004-10-21 Giovanni Bajo <giovannibajo@gcc.gnu.org> 2004-10-21 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* config/arc/lib1funcs.asm (___umulsidi3): Fix typo. * config/arc/lib1funcs.asm (___umulsidi3): Fix typo.
......
...@@ -2665,6 +2665,11 @@ fi ...@@ -2665,6 +2665,11 @@ fi
c_target_objs="${c_target_objs} rs6000-c.o" c_target_objs="${c_target_objs} rs6000-c.o"
cxx_target_objs="${cxx_target_objs} rs6000-c.o" cxx_target_objs="${cxx_target_objs} rs6000-c.o"
tmake_file="rs6000/t-rs6000 ${tmake_file}" tmake_file="rs6000/t-rs6000 ${tmake_file}"
if test x$enable_e500_double = xyes
then
tm_file="$tm_file rs6000/e500-double.h"
fi
;; ;;
sparc*-*-*) sparc*-*-*)
......
/* Target definitions for E500 with double precision FP.
Copyright (C) 2004 Free Software Foundation, Inc.
Contributed by Aldy Hernandez (aldyh@redhat.com).
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2, or (at your
option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
#undef SUB3TARGET_OVERRIDE_OPTIONS
#define SUB3TARGET_OVERRIDE_OPTIONS \
if (rs6000_float_gprs_string == NULL) \
rs6000_float_gprs = 2;
...@@ -49,9 +49,13 @@ ...@@ -49,9 +49,13 @@
#undef TARGET_E500 #undef TARGET_E500
#undef TARGET_ISEL #undef TARGET_ISEL
#undef TARGET_FPRS #undef TARGET_FPRS
#undef TARGET_E500_SINGLE
#undef TARGET_E500_DOUBLE
#define TARGET_SPE_ABI rs6000_spe_abi #define TARGET_SPE_ABI rs6000_spe_abi
#define TARGET_SPE rs6000_spe #define TARGET_SPE rs6000_spe
#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540) #define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
#define TARGET_ISEL rs6000_isel #define TARGET_ISEL rs6000_isel
#define TARGET_FPRS (!rs6000_float_gprs) #define TARGET_FPRS (rs6000_float_gprs == 0)
#define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1)
#define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2)
...@@ -32,12 +32,16 @@ ...@@ -32,12 +32,16 @@
#undef TARGET_E500 #undef TARGET_E500
#undef TARGET_ISEL #undef TARGET_ISEL
#undef TARGET_FPRS #undef TARGET_FPRS
#undef TARGET_E500_SINGLE
#undef TARGET_E500_DOUBLE
#define TARGET_SPE_ABI rs6000_spe_abi #define TARGET_SPE_ABI rs6000_spe_abi
#define TARGET_SPE rs6000_spe #define TARGET_SPE rs6000_spe
#define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540) #define TARGET_E500 (rs6000_cpu == PROCESSOR_PPC8540)
#define TARGET_ISEL rs6000_isel #define TARGET_ISEL rs6000_isel
#define TARGET_FPRS (!rs6000_float_gprs) #define TARGET_FPRS (rs6000_float_gprs == 0)
#define TARGET_E500_SINGLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 1)
#define TARGET_E500_DOUBLE (TARGET_HARD_FLOAT && rs6000_float_gprs == 2)
#undef SUBSUBTARGET_OVERRIDE_OPTIONS #undef SUBSUBTARGET_OVERRIDE_OPTIONS
#define SUBSUBTARGET_OVERRIDE_OPTIONS \ #define SUBSUBTARGET_OVERRIDE_OPTIONS \
......
...@@ -568,6 +568,8 @@ extern const char *rs6000_warn_altivec_long_switch; ...@@ -568,6 +568,8 @@ extern const char *rs6000_warn_altivec_long_switch;
#define TARGET_E500 0 #define TARGET_E500 0
#define TARGET_ISEL 0 #define TARGET_ISEL 0
#define TARGET_FPRS 1 #define TARGET_FPRS 1
#define TARGET_E500_SINGLE 0
#define TARGET_E500_DOUBLE 0
/* Sometimes certain combinations of command options do not make sense /* Sometimes certain combinations of command options do not make sense
on a particular target machine. You can define a macro on a particular target machine. You can define a macro
......
...@@ -21,7 +21,15 @@ ...@@ -21,7 +21,15 @@
(define_constants (define_constants
[(SPE_ACC_REGNO 111) [(SPE_ACC_REGNO 111)
(SPEFSCR_REGNO 112)]) (SPEFSCR_REGNO 112)
(CMPDFEQ_GPR 1006)
(TSTDFEQ_GPR 1007)
(CMPDFGT_GPR 1008)
(TSTDFGT_GPR 1009)
(CMPDFLT_GPR 1010)
(TSTDFLT_GPR 1011)
])
(define_insn "*negsf2_gpr" (define_insn "*negsf2_gpr"
[(set (match_operand:SF 0 "gpc_reg_operand" "=r") [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
...@@ -2532,3 +2540,65 @@ ...@@ -2532,3 +2540,65 @@
"TARGET_HARD_FLOAT && !TARGET_FPRS && flag_unsafe_math_optimizations" "TARGET_HARD_FLOAT && !TARGET_FPRS && flag_unsafe_math_optimizations"
"efststlt %0,%1,%2" "efststlt %0,%1,%2"
[(set_attr "type" "veccmpsimple")]) [(set_attr "type" "veccmpsimple")])
;; Same thing, but for double-precision.
(define_insn "cmpdfeq_gpr"
[(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
(unspec:CCFP
[(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
(match_operand:DF 2 "gpc_reg_operand" "r"))]
CMPDFEQ_GPR))]
"TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && !flag_unsafe_math_optimizations"
"efdcmpeq %0,%1,%2"
[(set_attr "type" "veccmp")])
(define_insn "tstdfeq_gpr"
[(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
(unspec:CCFP
[(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
(match_operand:DF 2 "gpc_reg_operand" "r"))]
TSTDFEQ_GPR))]
"TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && flag_unsafe_math_optimizations"
"efdtsteq %0,%1,%2"
[(set_attr "type" "veccmpsimple")])
(define_insn "cmpdfgt_gpr"
[(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
(unspec:CCFP
[(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
(match_operand:DF 2 "gpc_reg_operand" "r"))]
CMPDFGT_GPR))]
"TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && !flag_unsafe_math_optimizations"
"efdcmpgt %0,%1,%2"
[(set_attr "type" "veccmp")])
(define_insn "tstdfgt_gpr"
[(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
(unspec:CCFP
[(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
(match_operand:DF 2 "gpc_reg_operand" "r"))]
TSTDFGT_GPR))]
"TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && flag_unsafe_math_optimizations"
"efdtstgt %0,%1,%2"
[(set_attr "type" "veccmpsimple")])
(define_insn "cmpdflt_gpr"
[(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
(unspec:CCFP
[(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
(match_operand:DF 2 "gpc_reg_operand" "r"))]
CMPDFLT_GPR))]
"TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && !flag_unsafe_math_optimizations"
"efdcmplt %0,%1,%2"
[(set_attr "type" "veccmp")])
(define_insn "tstdflt_gpr"
[(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
(unspec:CCFP
[(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
(match_operand:DF 2 "gpc_reg_operand" "r"))]
TSTDFLT_GPR))]
"TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && flag_unsafe_math_optimizations"
"efdtstlt %0,%1,%2"
[(set_attr "type" "veccmpsimple")])
...@@ -616,7 +616,7 @@ See RS/6000 and PowerPC Options. ...@@ -616,7 +616,7 @@ See RS/6000 and PowerPC Options.
-mabi=spe -mabi=no-spe @gol -mabi=spe -mabi=no-spe @gol
-misel=yes -misel=no @gol -misel=yes -misel=no @gol
-mspe=yes -mspe=no @gol -mspe=yes -mspe=no @gol
-mfloat-gprs=yes -mfloat-gprs=no @gol -mfloat-gprs=yes -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
-mprototype -mno-prototype @gol -mprototype -mno-prototype @gol
-msim -mmvme -mads -myellowknife -memb -msdata @gol -msim -mmvme -mads -myellowknife -memb -msdata @gol
-msdata=@var{opt} -mvxworks -mwindiss -G @var{num} -pthread} -msdata=@var{opt} -mvxworks -mwindiss -G @var{num} -pthread}
...@@ -10279,12 +10279,23 @@ This switch enables or disables the generation of ISEL instructions. ...@@ -10279,12 +10279,23 @@ This switch enables or disables the generation of ISEL instructions.
This switch enables or disables the generation of SPE simd This switch enables or disables the generation of SPE simd
instructions. instructions.
@item -mfloat-gprs=@var{yes/no} @item -mfloat-gprs=@var{yes/single/double/no}
@itemx -mfloat-gprs @itemx -mfloat-gprs
@opindex mfloat-gprs @opindex mfloat-gprs
This switch enables or disables the generation of floating point This switch enables or disables the generation of floating point
operations on the general purpose registers for architectures that operations on the general purpose registers for architectures that
support it. This option is currently only available on the MPC8540. support it.
The argument @var{yes} or @var{single} enables the use of
single-precision floating point operations.
The argument @var{double} enables the use of single and
double-precision floating point operations.
The argument @var{no} disables floating point operations on the
general purpose registers.
This option is currently only available on the MPC854x.
@item -m32 @item -m32
@itemx -m64 @itemx -m64
......
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