From: Segher Boessenkool Date: Wed, 7 Jun 2017 14:59:11 +0000 (+0200) Subject: rs6000: Remove TARGET_E500_{SINGLE,DOUBLE} X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7c12ec44d2380c17e50bff0195c4678899d338a;p=gcc.git rs6000: Remove TARGET_E500_{SINGLE,DOUBLE} TARGET_E500_{SINGLE,DOUBLE} is always false now. * config/rs6000/predicates.md: Replace TARGET_E500_DOUBLE and TARGET_E500_SINGLE by 0, simplify. * config/rs6000/rs6000.c: Ditto. (rs6000_option_override_internal): Delete CHECK_E500_OPTIONS. (spe_build_register_parallel): Delete. * config/rs6000/rs6000.h: Delete TARGET_E500_SINGLE, TARGET_E500_DOUBLE, and CHECK_E500_OPTIONS. * config/rs6000/rs6000.md: Replace TARGET_E500_DOUBLE, TARGET_E500_SINGLE, and by 0, simplify. (E500_CONVERT): Delete. * config/rs6000/spe.md: Remove many patterns and all define_constants. From-SVN: r248975 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 49c26e53140..c6ffccf3a82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2017-06-07 Segher Boessenkool + + * config/rs6000/predicates.md: Replace TARGET_E500_DOUBLE and + TARGET_E500_SINGLE by 0, simplify. + * config/rs6000/rs6000.c: Ditto. + (rs6000_option_override_internal): Delete CHECK_E500_OPTIONS. + (spe_build_register_parallel): Delete. + * config/rs6000/rs6000.h: Delete TARGET_E500_SINGLE, + TARGET_E500_DOUBLE, and CHECK_E500_OPTIONS. + * config/rs6000/rs6000.md: Replace TARGET_E500_DOUBLE, + TARGET_E500_SINGLE, and by 0, simplify. + (E500_CONVERT): Delete. + * config/rs6000/spe.md: Remove many patterns and all define_constants. + 2017-06-07 Segher Boessenkool * config/rs6000/darwin.md: Replace TARGET_FPRS by 1 and simplify. diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index a9bf8541f34..dd961a7e9ed 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -299,7 +299,7 @@ (define_predicate "gpc_reg_operand" (match_operand 0 "register_operand") { - if ((TARGET_E500_DOUBLE || TARGET_SPE) && invalid_e500_subreg (op, mode)) + if (TARGET_SPE && invalid_e500_subreg (op, mode)) return 0; if (GET_CODE (op) == SUBREG) @@ -331,7 +331,7 @@ (define_predicate "int_reg_operand" (match_operand 0 "register_operand") { - if ((TARGET_E500_DOUBLE || TARGET_SPE) && invalid_e500_subreg (op, mode)) + if (TARGET_SPE && invalid_e500_subreg (op, mode)) return 0; if (GET_CODE (op) == SUBREG) @@ -357,7 +357,7 @@ (define_predicate "int_reg_operand_not_pseudo" (match_operand 0 "register_operand") { - if ((TARGET_E500_DOUBLE || TARGET_SPE) && invalid_e500_subreg (op, mode)) + if (TARGET_SPE && invalid_e500_subreg (op, mode)) return 0; if (GET_CODE (op) == SUBREG) @@ -606,7 +606,7 @@ return 0; /* Consider all constants with -msoft-float to be easy. */ - if ((TARGET_SOFT_FLOAT || TARGET_E500_SINGLE + if ((TARGET_SOFT_FLOAT || (TARGET_HARD_FLOAT && (TARGET_SINGLE_FLOAT && ! TARGET_DOUBLE_FLOAT))) && mode != DImode) return 1; @@ -1014,10 +1014,9 @@ ;; Return 1 if the operand is either an easy FP constant or memory or reg. (define_predicate "reg_or_none500mem_operand" (if_then_else (match_code "mem") - (and (match_test "!TARGET_E500_DOUBLE") - (ior (match_operand 0 "memory_operand") - (ior (match_test "macho_lo_sum_memory_operand (op, mode)") - (match_operand 0 "volatile_mem_operand")))) + (ior (match_operand 0 "memory_operand") + (match_test "macho_lo_sum_memory_operand (op, mode)") + (match_operand 0 "volatile_mem_operand")) (match_operand 0 "gpc_reg_operand"))) ;; Return 1 if the operand is CONST_DOUBLE 0, register or memory operand. @@ -1137,7 +1136,7 @@ return 1; /* Do not allow invalid E500 subregs. */ - if ((TARGET_E500_DOUBLE || TARGET_SPE) + if (TARGET_SPE && GET_CODE (op) == SUBREG && invalid_e500_subreg (op, mode)) return 0; @@ -1205,7 +1204,7 @@ (define_predicate "rs6000_nonimmediate_operand" (match_code "reg,subreg,mem") { - if ((TARGET_E500_DOUBLE || TARGET_SPE) + if (TARGET_SPE && GET_CODE (op) == SUBREG && invalid_e500_subreg (op, mode)) return 0; diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index d5ff96aa179..f1819b3fded 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -2082,15 +2082,6 @@ rs6000_hard_regno_nregs_internal (int regno, machine_mode mode) else if (ALTIVEC_REGNO_P (regno)) reg_size = UNITS_PER_ALTIVEC_WORD; - /* The value returned for SCmode in the E500 double case is 2 for - ABI compatibility; storing an SCmode value in a single register - would require function_arg and rs6000_spe_function_arg to handle - SCmode so as to pass the value correctly in a pair of - registers. */ - else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode - && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno)) - reg_size = UNITS_PER_FP_WORD; - else reg_size = UNITS_PER_WORD; @@ -2862,12 +2853,6 @@ rs6000_debug_reg_global (void) fprintf (stderr, DEBUG_FMT_S, "soft_float", (TARGET_SOFT_FLOAT ? "true" : "false")); - fprintf (stderr, DEBUG_FMT_S, "e500_single", - (TARGET_E500_SINGLE ? "true" : "false")); - - fprintf (stderr, DEBUG_FMT_S, "e500_double", - (TARGET_E500_DOUBLE ? "true" : "false")); - if (TARGET_LINK_STACK) fprintf (stderr, DEBUG_FMT_S, "link_stack", "true"); @@ -2989,8 +2974,7 @@ rs6000_setup_reg_addr_masks (void) && !complex_p && !small_int_vsx_p && (m2 != DFmode || !TARGET_UPPER_REGS_DF) - && (m2 != SFmode || !TARGET_UPPER_REGS_SF) - && !(TARGET_E500_DOUBLE && msize == 8)) + && (m2 != SFmode || !TARGET_UPPER_REGS_SF)) { addr_mask |= RELOAD_REG_PRE_INCDEC; @@ -3738,9 +3722,6 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p) } } - if (TARGET_E500_DOUBLE) - rs6000_class_max_nregs[DFmode][GENERAL_REGS] = 1; - /* Calculate which modes to automatically generate code to use a the reciprocal divide and square root instructions. In the future, possibly automatically generate the instructions even if the user did not specify @@ -5147,8 +5128,8 @@ rs6000_option_override_internal (bool global_init_p) case PROCESSOR_PPCE5500: case PROCESSOR_PPCE6500: - rs6000_single_float = TARGET_E500_SINGLE || TARGET_E500_DOUBLE; - rs6000_double_float = TARGET_E500_DOUBLE; + rs6000_single_float = 0; + rs6000_double_float = 0; rs6000_isa_flags &= ~OPTION_MASK_STRING; @@ -5172,9 +5153,6 @@ rs6000_option_override_internal (bool global_init_p) "point"); } - /* Detect invalid option combinations with E500. */ - CHECK_E500_OPTIONS; - rs6000_always_hint = (rs6000_cpu != PROCESSOR_POWER4 && rs6000_cpu != PROCESSOR_POWER5 && rs6000_cpu != PROCESSOR_POWER6 @@ -8232,36 +8210,6 @@ rs6000_split_v4si_init (rtx operands[]) bool invalid_e500_subreg (rtx op, machine_mode mode) { - if (TARGET_E500_DOUBLE) - { - /* Reject (subreg:SI (reg:DF)); likewise with subreg:DI or - subreg:TI and reg:TF. Decimal float modes are like integer - modes (only low part of each register used) for this - purpose. */ - if (GET_CODE (op) == SUBREG - && (mode == SImode || mode == DImode || mode == TImode - || mode == DDmode || mode == TDmode || mode == PTImode) - && REG_P (SUBREG_REG (op)) - && (GET_MODE (SUBREG_REG (op)) == DFmode - || GET_MODE (SUBREG_REG (op)) == TFmode - || GET_MODE (SUBREG_REG (op)) == IFmode - || GET_MODE (SUBREG_REG (op)) == KFmode)) - return true; - - /* Reject (subreg:DF (reg:DI)); likewise with subreg:TF and - reg:TI. */ - if (GET_CODE (op) == SUBREG - && (mode == DFmode || mode == TFmode || mode == IFmode - || mode == KFmode) - && REG_P (SUBREG_REG (op)) - && (GET_MODE (SUBREG_REG (op)) == DImode - || GET_MODE (SUBREG_REG (op)) == TImode - || GET_MODE (SUBREG_REG (op)) == PTImode - || GET_MODE (SUBREG_REG (op)) == DDmode - || GET_MODE (SUBREG_REG (op)) == TDmode)) - return true; - } - if (TARGET_SPE && GET_CODE (op) == SUBREG && mode == SImode @@ -8292,13 +8240,6 @@ rs6000_data_alignment (tree type, unsigned int align, enum data_align how) else if (align < 128) align = 128; } - else if (TARGET_E500_DOUBLE - && TREE_CODE (type) == REAL_TYPE - && TYPE_MODE (type) == DFmode) - { - if (align < 64) - align = 64; - } } if (how != align_abi) @@ -8952,14 +8893,6 @@ rs6000_legitimate_offset_address_p (machine_mode mode, rtx x, case DFmode: case DDmode: case DImode: - /* On e500v2, we may have: - - (subreg:DF (mem:DI (plus (reg) (const_int))) 0). - - Which gets addressed with evldd instructions. */ - if (TARGET_E500_DOUBLE) - return SPE_CONST_OFFSET_OK (offset); - /* If we are using VSX scalar loads, restrict ourselves to reg+reg addressing. */ if (VECTOR_MEM_VSX_P (mode)) @@ -8979,10 +8912,6 @@ rs6000_legitimate_offset_address_p (machine_mode mode, rtx x, case TDmode: case TImode: case PTImode: - if (TARGET_E500_DOUBLE) - return (SPE_CONST_OFFSET_OK (offset) - && SPE_CONST_OFFSET_OK (offset + 8)); - extra = 8; if (!worst_case) break; @@ -9071,9 +9000,6 @@ legitimate_lo_sum_address_p (machine_mode mode, rtx x, int strict) /* quad word addresses are restricted, and we can't use LO_SUM. */ if (mode_supports_vsx_dform_quad (mode)) return false; - /* Restrict addressing for DI because of our SUBREG hackery. */ - if (TARGET_E500_DOUBLE && GET_MODE_SIZE (mode) > UNITS_PER_WORD) - return false; x = XEXP (x, 1); if (TARGET_ELF || TARGET_MACHO) @@ -9190,8 +9116,7 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, && GET_CODE (XEXP (x, 1)) == CONST_INT && ((unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 1)) + 0x8000) >= 0x10000 - extra) - && !(SPE_VECTOR_MODE (mode) - || (TARGET_E500_DOUBLE && GET_MODE_SIZE (mode) > UNITS_PER_WORD))) + && !SPE_VECTOR_MODE (mode)) { HOST_WIDE_INT high_int, low_int; rtx sum; @@ -9216,8 +9141,7 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, return gen_rtx_PLUS (Pmode, XEXP (x, 0), force_reg (Pmode, force_operand (XEXP (x, 1), 0))); } - else if (SPE_VECTOR_MODE (mode) - || (TARGET_E500_DOUBLE && GET_MODE_SIZE (mode) > UNITS_PER_WORD)) + else if (SPE_VECTOR_MODE (mode)) { if (mode == DImode) return x; @@ -9981,7 +9905,6 @@ rs6000_legitimize_reload_address (rtx x, machine_mode mode, && CONST_INT_P (XEXP (x, 1)) && reg_offset_p && !SPE_VECTOR_MODE (mode) - && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (mode) > UNITS_PER_WORD) && (quad_offset_p || !VECTOR_MODE_P (mode) || VECTOR_MEM_NONE_P (mode))) { HOST_WIDE_INT val = INTVAL (XEXP (x, 1)); @@ -10240,8 +10163,7 @@ rs6000_legitimate_address_p (machine_mode mode, rtx x, bool reg_ok_strict) if (!FLOAT128_2REG_P (mode) && ((TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT) || TARGET_POWERPC64 - || (mode != DFmode && mode != DDmode) - || (TARGET_E500_DOUBLE && mode != DDmode)) + || (mode != DFmode && mode != DDmode)) && (TARGET_POWERPC64 || mode != DImode) && (mode != TImode || VECTOR_MEM_VSX_P (TImode)) && mode != PTImode @@ -11429,10 +11351,9 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) fit into 1, whereas DI still needs two. */ static bool -rs6000_member_type_forces_blk (const_tree field, machine_mode mode) +rs6000_member_type_forces_blk (const_tree field, machine_mode) { - return ((TARGET_SPE && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE) - || (TARGET_E500_DOUBLE && mode == DFmode)); + return (TARGET_SPE && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE); } /* Nonzero if we can use a floating-point register to pass this arg. */ @@ -12547,42 +12468,6 @@ rs6000_function_arg_advance (cumulative_args_t cum, machine_mode mode, 0); } -static rtx -spe_build_register_parallel (machine_mode mode, int gregno) -{ - rtx r1, r3, r5, r7; - - switch (mode) - { - case DFmode: - r1 = gen_rtx_REG (DImode, gregno); - r1 = gen_rtx_EXPR_LIST (VOIDmode, r1, const0_rtx); - return gen_rtx_PARALLEL (mode, gen_rtvec (1, r1)); - - case DCmode: - case TFmode: - r1 = gen_rtx_REG (DImode, gregno); - r1 = gen_rtx_EXPR_LIST (VOIDmode, r1, const0_rtx); - r3 = gen_rtx_REG (DImode, gregno + 2); - r3 = gen_rtx_EXPR_LIST (VOIDmode, r3, GEN_INT (8)); - return gen_rtx_PARALLEL (mode, gen_rtvec (2, r1, r3)); - - case TCmode: - r1 = gen_rtx_REG (DImode, gregno); - r1 = gen_rtx_EXPR_LIST (VOIDmode, r1, const0_rtx); - r3 = gen_rtx_REG (DImode, gregno + 2); - r3 = gen_rtx_EXPR_LIST (VOIDmode, r3, GEN_INT (8)); - r5 = gen_rtx_REG (DImode, gregno + 4); - r5 = gen_rtx_EXPR_LIST (VOIDmode, r5, GEN_INT (16)); - r7 = gen_rtx_REG (DImode, gregno + 6); - r7 = gen_rtx_EXPR_LIST (VOIDmode, r7, GEN_INT (24)); - return gen_rtx_PARALLEL (mode, gen_rtvec (4, r1, r3, r5, r7)); - - default: - gcc_unreachable (); - } -} - /* Determine where to put a SIMD argument on the SPE. */ static rtx rs6000_spe_function_arg (const CUMULATIVE_ARGS *cum, machine_mode mode, @@ -12590,23 +12475,6 @@ rs6000_spe_function_arg (const CUMULATIVE_ARGS *cum, machine_mode mode, { int gregno = cum->sysv_gregno; - /* On E500 v2, double arithmetic is done on the full 64-bit GPR, but - are passed and returned in a pair of GPRs for ABI compatibility. */ - if (TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode - || mode == DCmode || mode == TCmode)) - { - int n_words = rs6000_arg_size (mode, type); - - /* Doubles go in an odd/even register pair (r5/r6, etc). */ - if (mode == DFmode) - gregno += (1 - gregno) & 1; - - /* Multi-reg args are not split between registers and stack. */ - if (gregno + n_words - 1 > GP_ARG_MAX_REG) - return NULL_RTX; - - return spe_build_register_parallel (mode, gregno); - } if (cum->stdarg) { int n_words = rs6000_arg_size (mode, type); @@ -13099,12 +12967,7 @@ rs6000_function_arg (cumulative_args_t cum_v, machine_mode mode, return gen_rtx_REG (part_mode, GP_ARG_MIN_REG + align_words); } } - else if (TARGET_SPE_ABI && TARGET_SPE - && (SPE_VECTOR_MODE (mode) - || (TARGET_E500_DOUBLE && (mode == DFmode - || mode == DCmode - || mode == TFmode - || mode == TCmode)))) + else if (TARGET_SPE_ABI && TARGET_SPE && SPE_VECTOR_MODE (mode)) return rs6000_spe_function_arg (cum, mode, type); else if (abi == ABI_V4) @@ -23350,16 +23213,6 @@ rs6000_cannot_change_mode_class (machine_mode from, return false; } - if (TARGET_E500_DOUBLE - && ((((to) == DFmode) + ((from) == DFmode)) == 1 - || (((to) == TFmode) + ((from) == TFmode)) == 1 - || (((to) == IFmode) + ((from) == IFmode)) == 1 - || (((to) == KFmode) + ((from) == KFmode)) == 1 - || (((to) == DDmode) + ((from) == DDmode)) == 1 - || (((to) == TDmode) + ((from) == TDmode)) == 1 - || (((to) == DImode) + ((from) == DImode)) == 1)) - return true; - /* Since the VSX register set includes traditional floating point registers and altivec registers, just check for the size being different instead of trying to check whether the modes are vector modes. Otherwise it won't @@ -24220,7 +24073,7 @@ print_operand (FILE *file, rtx x, int code) tmp = XEXP (x, 0); /* Ugly hack because %y is overloaded. */ - if ((TARGET_SPE || TARGET_E500_DOUBLE) + if (TARGET_SPE && (GET_MODE_SIZE (GET_MODE (x)) == 8 || FLOAT128_2REG_P (GET_MODE (x)) || GET_MODE (x) == TImode @@ -26562,8 +26415,6 @@ rs6000_split_multireg_move (rtx dst, rtx src) ((TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT) ? DFmode : SFmode); else if (ALTIVEC_REGNO_P (reg)) reg_mode = V16QImode; - else if (TARGET_E500_DOUBLE && FLOAT128_2REG_P (mode)) - reg_mode = DFmode; else reg_mode = word_mode; reg_mode_size = GET_MODE_SIZE (reg_mode); @@ -27684,9 +27535,6 @@ spe_func_has_64bit_regs_p (void) if (SPE_VECTOR_MODE (mode)) return true; - if (TARGET_E500_DOUBLE - && (mode == DFmode || FLOAT128_2REG_P (mode))) - return true; } } } @@ -28635,7 +28483,6 @@ emit_frame_save (rtx frame_reg, machine_mode mode, /* Some cases that need register indexed addressing. */ gcc_checking_assert (!((TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) || (TARGET_VSX && ALTIVEC_OR_VSX_VECTOR_MODE (mode)) - || (TARGET_E500_DOUBLE && mode == DFmode) || (TARGET_SPE_ABI && SPE_VECTOR_MODE (mode) && !SPE_CONST_OFFSET_OK (offset)))); @@ -28656,8 +28503,7 @@ gen_frame_mem_offset (machine_mode mode, rtx reg, int offset) int_rtx = GEN_INT (offset); - if ((TARGET_SPE_ABI && SPE_VECTOR_MODE (mode) && !SPE_CONST_OFFSET_OK (offset)) - || (TARGET_E500_DOUBLE && mode == DFmode)) + if (TARGET_SPE_ABI && SPE_VECTOR_MODE (mode) && !SPE_CONST_OFFSET_OK (offset)) { offset_rtx = gen_rtx_REG (Pmode, FIXED_SCRATCH); emit_move_insn (offset_rtx, int_rtx); @@ -38762,10 +38608,6 @@ rs6000_function_value (const_tree valtype, && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI && ALTIVEC_OR_VSX_VECTOR_MODE (mode)) regno = ALTIVEC_ARG_RETURN; - else if (TARGET_E500_DOUBLE && TARGET_HARD_FLOAT - && (mode == DFmode || mode == DCmode - || FLOAT128_IBM_P (mode) || mode == TCmode)) - return spe_build_register_parallel (mode, GP_ARG_RETURN); else regno = GP_ARG_RETURN; @@ -38798,10 +38640,6 @@ rs6000_libcall_value (machine_mode mode) regno = ALTIVEC_ARG_RETURN; else if (COMPLEX_MODE_P (mode) && targetm.calls.split_complex_arg) return rs6000_complex_function_value (mode); - else if (TARGET_E500_DOUBLE && TARGET_HARD_FLOAT - && (mode == DFmode || mode == DCmode - || FLOAT128_IBM_P (mode) || mode == TCmode)) - return spe_build_register_parallel (mode, GP_ARG_RETURN); else regno = GP_ARG_RETURN; @@ -38904,9 +38742,7 @@ rs6000_dwarf_register_span (rtx reg) if (TARGET_SPE && regno < 32 - && (SPE_VECTOR_MODE (GET_MODE (reg)) - || (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) - && mode != SFmode && mode != SDmode && mode != SCmode))) + && SPE_VECTOR_MODE (GET_MODE (reg))) ; else return NULL_RTX; diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index dec1ab7f625..66f8170d68a 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -572,9 +572,6 @@ extern int rs6000_vector_align[]; #define TARGET_SPE_ABI 0 #define TARGET_SPE 0 #define TARGET_ISEL64 (TARGET_ISEL && TARGET_POWERPC64) -#define TARGET_E500_SINGLE 0 -#define TARGET_E500_DOUBLE 0 -#define CHECK_E500_OPTIONS do { } while (0) /* ISA 2.01 allowed FCFID to be done in 32-bit, previously it was 64-bit only. Enable 32-bit fcfid's on any of the switches for newer ISA machines or @@ -1276,13 +1273,9 @@ enum data_align { align_abi, align_opt, align_both }; && ((MODE) == VOIDmode || ALTIVEC_OR_VSX_VECTOR_MODE (MODE)) \ && FP_REGNO_P (REGNO) \ ? V2DFmode \ - : TARGET_E500_DOUBLE && (MODE) == SImode \ - ? SImode \ - : TARGET_E500_DOUBLE && ((MODE) == VOIDmode || (MODE) == DFmode) \ + : FLOAT128_IBM_P (MODE) && FP_REGNO_P (REGNO) \ ? DFmode \ - : !TARGET_E500_DOUBLE && FLOAT128_IBM_P (MODE) && FP_REGNO_P (REGNO) \ - ? DFmode \ - : !TARGET_E500_DOUBLE && (MODE) == TDmode && FP_REGNO_P (REGNO) \ + : (MODE) == TDmode && FP_REGNO_P (REGNO) \ ? DImode \ : choose_hard_reg_mode ((REGNO), (NREGS), false)) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 210077de218..efca26cfd76 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -372,8 +372,8 @@ ; Any hardware-supported floating-point mode (define_mode_iterator FP [ - (SF "TARGET_HARD_FLOAT && (TARGET_SINGLE_FLOAT || TARGET_E500_SINGLE)") - (DF "TARGET_HARD_FLOAT && (TARGET_DOUBLE_FLOAT || TARGET_E500_DOUBLE)") + (SF "TARGET_HARD_FLOAT && TARGET_SINGLE_FLOAT") + (DF "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT") (TF "TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128") (IF "TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128") (KF "TARGET_FLOAT128_TYPE") @@ -454,8 +454,7 @@ (define_mode_attr f64_p9 [(DF "wb") (DD "wn")]) ; These modes do not fit in integer registers in 32-bit mode. -; but on e500v2, the gpr are 64 bit registers -(define_mode_iterator DIFD [DI (DF "!TARGET_E500_DOUBLE") DD]) +(define_mode_iterator DIFD [DI DF DD]) ; Iterator for reciprocal estimate instructions (define_mode_iterator RECIPF [SF DF V4SF V2DF]) @@ -614,9 +613,6 @@ (define_mode_attr SI_CONVERT_FP [(SF "TARGET_FCFIDS") (DF "TARGET_FCFID")]) -(define_mode_attr E500_CONVERT [(SF "0") - (DF "TARGET_E500_DOUBLE")]) - (define_mode_attr TARGET_FLOAT [(SF "TARGET_SINGLE_FLOAT") (DF "TARGET_DOUBLE_FLOAT")]) @@ -4646,7 +4642,7 @@ (define_expand "extendsfdf2" [(set (match_operand:DF 0 "gpc_reg_operand") (float_extend:DF (match_operand:SF 1 "reg_or_none500mem_operand")))] - "TARGET_HARD_FLOAT && (TARGET_DOUBLE_FLOAT || TARGET_E500_DOUBLE)" + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" { if (HONOR_SNANS (SFmode)) operands[1] = force_reg (SFmode, operands[1]); @@ -4684,7 +4680,7 @@ (define_expand "truncdfsf2" [(set (match_operand:SF 0 "gpc_reg_operand" "") (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "")))] - "TARGET_HARD_FLOAT && (TARGET_DOUBLE_FLOAT || TARGET_E500_DOUBLE)" + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" "") (define_insn "*truncdfsf2_fpr" @@ -5258,17 +5254,10 @@ (clobber (match_dup 4)) (clobber (match_dup 5)) (clobber (match_dup 6))])] - "TARGET_HARD_FLOAT && (TARGET_DOUBLE_FLOAT || TARGET_E500_DOUBLE)" + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" " { - if (TARGET_E500_DOUBLE) - { - if (!REG_P (operands[1])) - operands[1] = force_reg (SImode, operands[1]); - emit_insn (gen_spe_floatsidf2 (operands[0], operands[1])); - DONE; - } - else if (TARGET_LFIWAX && TARGET_FCFID) + if (TARGET_LFIWAX && TARGET_FCFID) { emit_insn (gen_floatsidf2_lfiwax (operands[0], operands[1])); DONE; @@ -5359,17 +5348,10 @@ (use (match_dup 3)) (clobber (match_dup 4)) (clobber (match_dup 5))])] - "TARGET_HARD_FLOAT && (TARGET_DOUBLE_FLOAT || TARGET_E500_DOUBLE)" + "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" " { - if (TARGET_E500_DOUBLE) - { - if (!REG_P (operands[1])) - operands[1] = force_reg (SImode, operands[1]); - emit_insn (gen_spe_floatunssidf2 (operands[0], operands[1])); - DONE; - } - else if (TARGET_LFIWZX && TARGET_FCFID) + if (TARGET_LFIWZX && TARGET_FCFID) { emit_insn (gen_floatunssidf2_lfiwzx (operands[0], operands[1])); DONE; @@ -5532,10 +5514,10 @@ (define_expand "fix_truncsi2" [(set (match_operand:SI 0 "gpc_reg_operand" "") (fix:SI (match_operand:SFDF 1 "gpc_reg_operand" "")))] - "TARGET_HARD_FLOAT && ( || )" + "TARGET_HARD_FLOAT && " " { - if (! && !TARGET_VSX_SMALL_INTEGER) + if (!TARGET_VSX_SMALL_INTEGER) { rtx src = force_reg (mode, operands[1]); @@ -5680,11 +5662,10 @@ (define_expand "fixuns_truncsi2" [(set (match_operand:SI 0 "gpc_reg_operand" "") (unsigned_fix:SI (match_operand:SFDF 1 "gpc_reg_operand" "")))] - "TARGET_HARD_FLOAT - && (( && TARGET_FCTIWUZ && TARGET_STFIWX) || )" + "TARGET_HARD_FLOAT && && TARGET_FCTIWUZ && TARGET_STFIWX" " { - if (! && !TARGET_VSX_SMALL_INTEGER) + if (!TARGET_VSX_SMALL_INTEGER) { emit_insn (gen_fixuns_truncsi2_stfiwx (operands[0], operands[1])); DONE; @@ -7432,8 +7413,7 @@ [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=Y,r,r,r,r,r") (match_operand:FMOVE64 1 "input_operand" "r,Y,r,G,H,F"))] "! TARGET_POWERPC64 - && (TARGET_SINGLE_FLOAT || TARGET_SOFT_FLOAT || TARGET_E500_SINGLE - || (mode == DDmode && TARGET_E500_DOUBLE)) + && (TARGET_SINGLE_FLOAT || TARGET_SOFT_FLOAT) && (gpc_reg_operand (operands[0], mode) || gpc_reg_operand (operands[1], mode))" "#" @@ -7565,11 +7545,6 @@ { if (FLOAT128_IEEE_P (mode)) rs6000_expand_float128_convert (operands[0], operands[1], false); - else if (TARGET_E500_DOUBLE) - { - gcc_assert (mode == TFmode); - emit_insn (gen_spe_extenddftf2 (operands[0], operands[1])); - } else if (TARGET_VSX) { if (mode == TFmode) @@ -7693,11 +7668,6 @@ { if (FLOAT128_IEEE_P (mode)) rs6000_expand_float128_convert (operands[0], operands[1], false); - else if (TARGET_E500_DOUBLE) - { - gcc_assert (mode == TFmode); - emit_insn (gen_spe_trunctfsf2 (operands[0], operands[1])); - } else if (mode == TFmode) emit_insn (gen_trunctfsf2_fprs (operands[0], operands[1])); else if (mode == IFmode) @@ -7777,8 +7747,6 @@ { if (FLOAT128_IEEE_P (mode)) rs6000_expand_float128_convert (op0, op1, false); - else if (TARGET_E500_DOUBLE && mode == TFmode) - emit_insn (gen_spe_fix_trunctfsi2 (op0, op1)); else if (mode == TFmode) emit_insn (gen_fix_trunctfsi2_fprs (op0, op1)); else if (mode == IFmode) @@ -7980,14 +7948,7 @@ } label = gen_label_rtx (); - if (TARGET_E500_DOUBLE && mode == TFmode) - { - if (flag_finite_math_only && !flag_trapping_math) - emit_insn (gen_spe_abstf2_tst (operands[0], operands[1], label)); - else - emit_insn (gen_spe_abstf2_cmp (operands[0], operands[1], label)); - } - else if (mode == TFmode) + if (mode == TFmode) emit_insn (gen_abstf2_internal (operands[0], operands[1], label)); else if (mode == TFmode) emit_insn (gen_absif2_internal (operands[0], operands[1], label)); @@ -9791,7 +9752,6 @@ ;; clobber outputs. Although those sets expand to multi-ppc-insn ;; sequences, using get_attr_length here will smash the operands ;; array. Neither is there an early_cobbler_p predicate. -;; Disallow subregs for E500 so we don't munge frob_di_df_2. ;; Also this optimization interferes with scalars going into ;; altivec registers (the code does reloading through the FPRs). (define_peephole2 @@ -9799,8 +9759,7 @@ (match_operand:DF 1 "any_operand" "")) (set (match_operand:DF 2 "gpc_reg_operand" "") (match_dup 0))] - "!(TARGET_E500_DOUBLE && GET_CODE (operands[2]) == SUBREG) - && !TARGET_UPPER_REGS_DF + "!TARGET_UPPER_REGS_DF && peep2_reg_dead_p (2, operands[0])" [(set (match_dup 2) (match_dup 1))]) diff --git a/gcc/config/rs6000/spe.md b/gcc/config/rs6000/spe.md index b6f4e0a6485..536697b8a9c 100644 --- a/gcc/config/rs6000/spe.md +++ b/gcc/config/rs6000/spe.md @@ -18,21 +18,6 @@ ;; along with GCC; see the file COPYING3. If not see ;; . -(define_constants - [(CMPDFEQ_GPR 1006) - (TSTDFEQ_GPR 1007) - (CMPDFGT_GPR 1008) - (TSTDFGT_GPR 1009) - (CMPDFLT_GPR 1010) - (TSTDFLT_GPR 1011) - (CMPTFEQ_GPR 1012) - (TSTTFEQ_GPR 1013) - (CMPTFGT_GPR 1014) - (TSTTFGT_GPR 1015) - (CMPTFLT_GPR 1016) - (TSTTFLT_GPR 1017) - ]) - ;; Modes using a 64-bit register. (define_mode_iterator SPE64 [DF V4HI V2SF V1DI V2SI]) @@ -42,43 +27,6 @@ ;; DImode and TImode. (define_mode_iterator DITI [DI TI]) -;; Floating point conversion instructions. - -(define_insn "spe_fixuns_truncdfsi2" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (unsigned_fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdctuiz %0,%1" - [(set_attr "type" "fp")]) - -(define_insn "spe_extendsfdf2" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdcfs %0,%1" - [(set_attr "type" "fp")]) - -(define_insn "spe_fix_truncdfsi2" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdctsiz %0,%1" - [(set_attr "type" "fp")]) - -(define_insn "spe_floatunssidf2" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdcfui %0,%1" - [(set_attr "type" "fp")]) - -(define_insn "spe_floatsidf2" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdcfsi %0,%1" - [(set_attr "type" "fp")]) - ;; SPE SIMD instructions (define_insn "absv2si2" @@ -2215,8 +2163,7 @@ (define_insn "*frob__" [(set (match_operand:SPE64 0 "nonimmediate_operand" "=r,r") (subreg:SPE64 (match_operand:DITI 1 "input_operand" "r,m") 0))] - "(TARGET_E500_DOUBLE && mode == DFmode) - || (TARGET_SPE && mode != DFmode)" + "TARGET_SPE && mode != DFmode" { switch (which_alternative) { @@ -2235,8 +2182,7 @@ (define_insn "*frob__ti_8" [(set (match_operand:SPE64 0 "nonimmediate_operand" "=r") (subreg:SPE64 (match_operand:TI 1 "input_operand" "r") 8))] - "(TARGET_E500_DOUBLE && mode == DFmode) - || (TARGET_SPE && mode != DFmode)" + "TARGET_SPE && mode != DFmode" { if (WORDS_BIG_ENDIAN) return "evmergelo %0,%Y1,%Z1"; @@ -2244,23 +2190,10 @@ return "evmergelo %0,%Z1,%Y1"; }) -(define_insn "*frob_tf_ti" - [(set (match_operand:TF 0 "gpc_reg_operand" "=r") - (subreg:TF (match_operand:TI 1 "gpc_reg_operand" "r") 0))] - "TARGET_E500_DOUBLE" -{ - if (WORDS_BIG_ENDIAN) - return "evmergelo %0,%1,%L1\;evmergelo %L0,%Y1,%Z1"; - else - return "evmergelo %L0,%Z1,%Y1\;evmergelo %0,%L1,%1"; -} - [(set_attr "length" "8")]) - (define_insn "*frob__di_2" [(set (subreg:DI (match_operand:SPE64TF 0 "nonimmediate_operand" "+&r,r") 0) (match_operand:DI 1 "input_operand" "r,m"))] - "(TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode)" + "TARGET_SPE && mode != DFmode && mode != TFmode" { switch (which_alternative) { @@ -2276,30 +2209,10 @@ } }) -(define_insn "*frob_tf_di_8_2" - [(set (subreg:DI (match_operand:TF 0 "nonimmediate_operand" "+&r,r") 8) - (match_operand:DI 1 "input_operand" "r,m"))] - "TARGET_E500_DOUBLE" -{ - switch (which_alternative) - { - default: - gcc_unreachable (); - case 0: - if (WORDS_BIG_ENDIAN) - return "evmergelo %L0,%1,%L1"; - else - return "evmergelo %L0,%L1,%1"; - case 1: - return "evldd%X1 %L0,%y1"; - } -}) - (define_insn "*frob_di_" [(set (match_operand:DI 0 "nonimmediate_operand" "=&r") (subreg:DI (match_operand:SPE64TF 1 "input_operand" "r") 0))] - "(TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode)" + "TARGET_SPE && mode != DFmode && mode != TFmode" { if (WORDS_BIG_ENDIAN) return "evmergehi %0,%1,%1\;mr %L0,%1"; @@ -2308,23 +2221,10 @@ } [(set_attr "length" "8")]) -(define_insn "*frob_ti_tf" - [(set (match_operand:TI 0 "nonimmediate_operand" "=&r") - (subreg:TI (match_operand:TF 1 "input_operand" "r") 0))] - "TARGET_E500_DOUBLE" -{ - if (WORDS_BIG_ENDIAN) - return "evmergehi %0,%1,%1\;mr %L0,%1\;evmergehi %Y0,%L1,%L1\;mr %Z0,%L1"; - else - return "evmergehi %Z0,%L1,%L1\;mr %Y0,%L1\;evmergehi %L0,%1,%1\;mr %0,%1"; -} - [(set_attr "length" "16")]) - (define_insn "*frob___2" [(set (subreg:SPE64 (match_operand:DITI 0 "register_operand" "+&r,r") 0) (match_operand:SPE64 1 "input_operand" "r,m"))] - "(TARGET_E500_DOUBLE && mode == DFmode) - || (TARGET_SPE && mode != DFmode)" + "TARGET_SPE && mode != DFmode" "* { switch (which_alternative) @@ -2373,8 +2273,7 @@ (define_insn "*frob_ti__8_2" [(set (subreg:SPE64 (match_operand:TI 0 "register_operand" "+&r,r") 8) (match_operand:SPE64 1 "input_operand" "r,m"))] - "(TARGET_E500_DOUBLE && mode == DFmode) - || (TARGET_SPE && mode != DFmode)" + "TARGET_SPE && mode != DFmode" "* { switch (which_alternative) @@ -2412,24 +2311,11 @@ }" [(set_attr "length" "8,8")]) -(define_insn "*frob_ti_tf_2" - [(set (subreg:TF (match_operand:TI 0 "gpc_reg_operand" "=&r") 0) - (match_operand:TF 1 "input_operand" "r"))] - "TARGET_E500_DOUBLE" -{ - if (WORDS_BIG_ENDIAN) - return "evmergehi %0,%1,%1\;mr %L0,%1\;evmergehi %Y0,%L1,%L1\;mr %Z0,%L1"; - else - return "evmergehi %Z0,%L1,%L1\;mr %Y0,%L1\;evmergehi %L0,%1,%1\;mr %0,%1"; -} - [(set_attr "length" "16")]) - (define_insn "mov_si_e500_subreg0_be" [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r,&r") 0) (match_operand:SI 1 "input_operand" "r,m"))] "WORDS_BIG_ENDIAN - && ((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode))" + && (TARGET_SPE && mode != DFmode && mode != TFmode)" "@ evmergelo %0,%1,%0 evmergelohi %0,%0,%0\;lwz%U1%X1 %0,%1\;evmergelohi %0,%0,%0" @@ -2439,8 +2325,7 @@ [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r,r") 0) (match_operand:SI 1 "input_operand" "r,m"))] "!WORDS_BIG_ENDIAN - && ((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode))" + && (TARGET_SPE && mode != DFmode && mode != TFmode)" "@ mr %0,%1 lwz%U1%X1 %0,%1") @@ -2450,9 +2335,8 @@ (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") (match_operand 2 "" "")))] "WORDS_BIG_ENDIAN - && (((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode)) - && TARGET_ELF && !TARGET_64BIT && can_create_pseudo_p ())" + && TARGET_SPE && mode != DFmode && mode != TFmode + && TARGET_ELF && !TARGET_64BIT && can_create_pseudo_p ()" "#" "&& 1" [(pc)] @@ -2469,9 +2353,8 @@ (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") (match_operand 2 "" "")))] "!WORDS_BIG_ENDIAN - && (((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode)) - && TARGET_ELF && !TARGET_64BIT)" + && TARGET_SPE && mode != DFmode && mode != TFmode + && TARGET_ELF && !TARGET_64BIT" "addi %0,%1,%K2") ;; ??? Could use evstwwe for memory stores in some cases, depending on @@ -2480,8 +2363,7 @@ [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,m") (subreg:SI (match_operand:SPE64TF 1 "register_operand" "+r,&r") 0))] "WORDS_BIG_ENDIAN - && ((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode))" + && TARGET_SPE && mode != DFmode && mode != TFmode" "@ evmergelohi %0,%1,%1 evmergelohi %1,%1,%1\;stw%U0%X0 %1,%0" @@ -2491,8 +2373,7 @@ [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,m") (subreg:SI (match_operand:SPE64TF 1 "register_operand" "r,r") 0))] "!WORDS_BIG_ENDIAN - && ((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode))" + && TARGET_SPE && mode != DFmode && mode != TFmode" "@ mr %0,%1 stw%U0%X0 %1,%0") @@ -2501,8 +2382,7 @@ [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r,r") 4) (match_operand:SI 1 "input_operand" "r,m"))] "WORDS_BIG_ENDIAN - && ((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode))" + && TARGET_SPE && mode != DFmode && mode != TFmode" "@ mr %0,%1 lwz%U1%X1 %0,%1") @@ -2511,8 +2391,7 @@ [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r,&r") 4) (match_operand:SI 1 "input_operand" "r,m"))] "!WORDS_BIG_ENDIAN - && ((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode))" + && TARGET_SPE && mode != DFmode && mode != TFmode" "@ evmergelo %0,%1,%0 evmergelohi %0,%0,%0\;lwz%U1%X1 %0,%1\;evmergelohi %0,%0,%0" @@ -2523,8 +2402,7 @@ (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") (match_operand 2 "" "")))] "WORDS_BIG_ENDIAN - && ((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode)) + && TARGET_SPE && mode != DFmode && mode != TFmode && TARGET_ELF && !TARGET_64BIT" "addi %0,%1,%K2") @@ -2533,9 +2411,8 @@ (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") (match_operand 2 "" "")))] "!WORDS_BIG_ENDIAN - && (((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode)) - && TARGET_ELF && !TARGET_64BIT && can_create_pseudo_p ())" + && TARGET_SPE && mode != DFmode && mode != TFmode + && TARGET_ELF && !TARGET_64BIT && can_create_pseudo_p ()" "#" "&& 1" [(pc)] @@ -2551,8 +2428,7 @@ [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,m") (subreg:SI (match_operand:SPE64TF 1 "register_operand" "r,r") 4))] "WORDS_BIG_ENDIAN - && ((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode))" + && TARGET_SPE && mode != DFmode && mode != TFmode" "@ mr %0,%1 stw%U0%X0 %1,%0") @@ -2561,287 +2437,12 @@ [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,m") (subreg:SI (match_operand:SPE64TF 1 "register_operand" "+r,&r") 4))] "!WORDS_BIG_ENDIAN - && ((TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode)) - || (TARGET_SPE && mode != DFmode && mode != TFmode))" + && TARGET_SPE && mode != DFmode && mode != TFmode" "@ evmergelohi %0,%1,%1 evmergelohi %1,%1,%1\;stw%U0%X0 %1,%0" [(set_attr "length" "4,8")]) -(define_insn "*mov_sitf_e500_subreg8_be" - [(set (subreg:SI (match_operand:TF 0 "register_operand" "+r,&r") 8) - (match_operand:SI 1 "input_operand" "r,m"))] - "WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE" - "@ - evmergelo %L0,%1,%L0 - evmergelohi %L0,%L0,%L0\;lwz%U1%X1 %L0,%1\;evmergelohi %L0,%L0,%L0" - [(set_attr "length" "4,12")]) - -(define_insn "*mov_sitf_e500_subreg8_le" - [(set (subreg:SI (match_operand:TF 0 "register_operand" "+r,r") 8) - (match_operand:SI 1 "input_operand" "r,m"))] - "!WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE" - "@ - mr %L0,%1 - lwz%U1%X1 %L0,%1") - -(define_insn "*mov_sitf_e500_subreg8_2_be" - [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,m") - (subreg:SI (match_operand:TF 1 "register_operand" "+r,&r") 8))] - "WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE" - "@ - evmergelohi %0,%L1,%L1 - evmergelohi %L1,%L1,%L1\;stw%U0%X0 %L1,%0" - [(set_attr "length" "4,8")]) - -(define_insn "*mov_sitf_e500_subreg8_2_le" - [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,m") - (subreg:SI (match_operand:TF 1 "register_operand" "r,r") 8))] - "!WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE" - "@ - mr %0,%L1 - stw%U0%X0 %L1,%0") - -(define_insn "*mov_sitf_e500_subreg12_be" - [(set (subreg:SI (match_operand:TF 0 "register_operand" "+r,r") 12) - (match_operand:SI 1 "input_operand" "r,m"))] - "WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE" - "@ - mr %L0,%1 - lwz%U1%X1 %L0,%1") - -(define_insn "*mov_sitf_e500_subreg12_le" - [(set (subreg:SI (match_operand:TF 0 "register_operand" "+r,&r") 12) - (match_operand:SI 1 "input_operand" "r,m"))] - "!WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE" - "@ - evmergelo %L0,%1,%L0 - evmergelohi %L0,%L0,%L0\;lwz%U1%X1 %L0,%1\;evmergelohi %L0,%L0,%L0" - [(set_attr "length" "4,12")]) - -(define_insn "*mov_sitf_e500_subreg12_2_be" - [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,m") - (subreg:SI (match_operand:TF 1 "register_operand" "r,r") 12))] - "WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE" - "@ - mr %0,%L1 - stw%U0%X0 %L1,%0") - -(define_insn "*mov_sitf_e500_subreg12_2_le" - [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "=r,m") - (subreg:SI (match_operand:TF 1 "register_operand" "+r,&r") 12))] - "!WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE" - "@ - evmergelohi %0,%L1,%L1 - evmergelohi %L1,%L1,%L1\;stw%U0%X0 %L1,%0" - [(set_attr "length" "4,8")]) - -;; FIXME: Allow r=CONST0. -(define_insn "*movdf_e500_double" - [(set (match_operand:DF 0 "rs6000_nonimmediate_operand" "=r,r,m") - (match_operand:DF 1 "input_operand" "r,m,r"))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE - && (gpc_reg_operand (operands[0], DFmode) - || gpc_reg_operand (operands[1], DFmode))" - "* - { - switch (which_alternative) - { - case 0: - return \"evor %0,%1,%1\"; - case 1: - return \"evldd%X1 %0,%y1\"; - case 2: - return \"evstdd%X0 %1,%y0\"; - default: - gcc_unreachable (); - } - }" - [(set_attr "type" "*,vecload,vecstore") - (set_attr "length" "*,*,*")]) - -(define_insn "spe_truncdfsf2" - [(set (match_operand:SF 0 "gpc_reg_operand" "=r") - (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efscfd %0,%1") - -(define_insn "spe_absdf2" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (abs:DF (match_operand:DF 1 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdabs %0,%1") - -(define_insn "spe_nabsdf2" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (neg:DF (abs:DF (match_operand:DF 1 "gpc_reg_operand" "r"))))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdnabs %0,%1") - -(define_insn "spe_negdf2" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (neg:DF (match_operand:DF 1 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdneg %0,%1") - -(define_insn "spe_adddf3" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (plus:DF (match_operand:DF 1 "gpc_reg_operand" "r") - (match_operand:DF 2 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdadd %0,%1,%2") - -(define_insn "spe_subdf3" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (minus:DF (match_operand:DF 1 "gpc_reg_operand" "r") - (match_operand:DF 2 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdsub %0,%1,%2") - -(define_insn "spe_muldf3" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (mult:DF (match_operand:DF 1 "gpc_reg_operand" "r") - (match_operand:DF 2 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efdmul %0,%1,%2") - -(define_insn "spe_divdf3" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r") - (div:DF (match_operand:DF 1 "gpc_reg_operand" "r") - (match_operand:DF 2 "gpc_reg_operand" "r")))] - "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE" - "efddiv %0,%1,%2") - -;; Double-precision floating point instructions for IBM long double. - -(define_insn_and_split "spe_trunctfdf2_internal1" - [(set (match_operand:DF 0 "gpc_reg_operand" "=r,?r") - (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "0,r")))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128" - "@ - # - evor %0,%1,%1" - "&& reload_completed && REGNO (operands[0]) == REGNO (operands[1])" - [(const_int 0)] -{ - emit_note (NOTE_INSN_DELETED); - DONE; -}) - -(define_insn_and_split "spe_trunctfsf2" - [(set (match_operand:SF 0 "gpc_reg_operand" "=r") - (float_truncate:SF (match_operand:TF 1 "gpc_reg_operand" "r"))) - (clobber (match_scratch:DF 2 "=r"))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128" - "#" - "&& reload_completed" - [(set (match_dup 2) - (float_truncate:DF (match_dup 1))) - (set (match_dup 0) - (float_truncate:SF (match_dup 2)))] - "") - -(define_insn "spe_extenddftf2" - [(set (match_operand:TF 0 "rs6000_nonimmediate_operand" "=r,?r,r,o") - (float_extend:TF (match_operand:DF 1 "input_operand" "0,r,m,r"))) - (clobber (match_scratch:DF 2 "=X,X,X,&r"))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128" - "@ - evxor %L0,%L0,%L0 - evor %0,%1,%1\;evxor %L0,%L0,%L0 - evldd%X1 %0,%y1\;evxor %L0,%L0,%L0 - evstdd%X0 %1,%y0\;evxor %2,%2,%2\;evstdd %2,%Y0" - [(set_attr "length" "4,8,8,12")]) - -(define_expand "spe_fix_trunctfsi2" - [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "") - (fix:SI (match_operand:TF 1 "gpc_reg_operand" ""))) - (clobber (match_dup 2)) - (clobber (match_dup 3)) - (clobber (match_dup 4))])] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128" -{ - operands[2] = gen_reg_rtx (DFmode); - operands[3] = gen_reg_rtx (SImode); - operands[4] = gen_reg_rtx (SImode); -}) - -; Like fix_trunc_helper, add with rounding towards 0. -(define_insn "spe_fix_trunctfsi2_internal" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (fix:SI (match_operand:TF 1 "gpc_reg_operand" "r"))) - (clobber (match_operand:DF 2 "gpc_reg_operand" "=r")) - (clobber (match_operand:SI 3 "gpc_reg_operand" "=&r")) - (clobber (match_operand:SI 4 "gpc_reg_operand" "=&r"))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128" - "mfspefscr %3\;rlwinm %4,%3,0,0,29\;ori %4,%4,1\;efdadd %2,%1,%L1\;mtspefscr %3\;efdctsiz %0, %2" - [(set_attr "length" "24")]) - -(define_insn "spe_negtf2_internal" - [(set (match_operand:TF 0 "gpc_reg_operand" "=r") - (neg:TF (match_operand:TF 1 "gpc_reg_operand" "r")))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128" - "* -{ - if (REGNO (operands[0]) == REGNO (operands[1]) + 1) - return \"efdneg %L0,%L1\;efdneg %0,%1\"; - else - return \"efdneg %0,%1\;efdneg %L0,%L1\"; -}" - [(set_attr "length" "8")]) - -(define_expand "spe_abstf2_cmp" - [(set (match_operand:TF 0 "gpc_reg_operand" "=f") - (match_operand:TF 1 "gpc_reg_operand" "f")) - (set (match_dup 3) (match_dup 5)) - (set (match_dup 5) (abs:DF (match_dup 5))) - (set (match_dup 4) (unspec:CCFP [(compare:CCFP (match_dup 3) - (match_dup 5))] CMPDFEQ_GPR)) - (set (pc) (if_then_else (eq (match_dup 4) (const_int 0)) - (label_ref (match_operand 2 "" "")) - (pc))) - (set (match_dup 6) (neg:DF (match_dup 6)))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128" - " -{ - const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode); - const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0; - operands[3] = gen_reg_rtx (DFmode); - operands[4] = gen_reg_rtx (CCFPmode); - operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word); - operands[6] = simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word); -}") - -(define_expand "spe_abstf2_tst" - [(set (match_operand:TF 0 "gpc_reg_operand" "=f") - (match_operand:TF 1 "gpc_reg_operand" "f")) - (set (match_dup 3) (match_dup 5)) - (set (match_dup 5) (abs:DF (match_dup 5))) - (set (match_dup 4) (unspec:CCFP [(compare:CCFP (match_dup 3) - (match_dup 5))] TSTDFEQ_GPR)) - (set (pc) (if_then_else (eq (match_dup 4) (const_int 0)) - (label_ref (match_operand 2 "" "")) - (pc))) - (set (match_dup 6) (neg:DF (match_dup 6)))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128" - " -{ - const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode); - const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0; - operands[3] = gen_reg_rtx (DFmode); - operands[4] = gen_reg_rtx (CCFPmode); - operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word); - operands[6] = simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word); -}") - ;; Vector move instructions. (define_expand "movv2si" @@ -3155,154 +2756,6 @@ ;; We have 2 variants for each. One for IEEE compliant math and one ;; for non IEEE compliant math. -;; 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_finite_math_only && !flag_trapping_math)" - "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_finite_math_only && !flag_trapping_math" - "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_finite_math_only && !flag_trapping_math)" - "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_finite_math_only && !flag_trapping_math" - "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_finite_math_only && !flag_trapping_math)" - "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_finite_math_only && !flag_trapping_math" - "efdtstlt %0,%1,%2" - [(set_attr "type" "veccmpsimple")]) - -;; Same thing, but for IBM long double. - -(define_insn "cmptfeq_gpr" - [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r") - (match_operand:TF 2 "gpc_reg_operand" "r"))] - CMPTFEQ_GPR))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128 - && !(flag_finite_math_only && !flag_trapping_math)" - "efdcmpeq %0,%1,%2\;bng %0,$+8\;efdcmpeq %0,%L1,%L2" - [(set_attr "type" "veccmp") - (set_attr "length" "12")]) - -(define_insn "tsttfeq_gpr" - [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r") - (match_operand:TF 2 "gpc_reg_operand" "r"))] - TSTTFEQ_GPR))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128 - && flag_finite_math_only && !flag_trapping_math" - "efdtsteq %0,%1,%2\;bng %0,$+8\;efdtsteq %0,%L1,%L2" - [(set_attr "type" "veccmpsimple") - (set_attr "length" "12")]) - -(define_insn "cmptfgt_gpr" - [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r") - (match_operand:TF 2 "gpc_reg_operand" "r"))] - CMPTFGT_GPR))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128 - && !(flag_finite_math_only && !flag_trapping_math)" - "efdcmpgt %0,%1,%2\;bgt %0,$+16\;efdcmpeq %0,%1,%2\;bng %0,$+8\;efdcmpgt %0,%L1,%L2" - [(set_attr "type" "veccmp") - (set_attr "length" "20")]) - -(define_insn "tsttfgt_gpr" - [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r") - (match_operand:TF 2 "gpc_reg_operand" "r"))] - TSTTFGT_GPR))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128 - && flag_finite_math_only && !flag_trapping_math" - "efdtstgt %0,%1,%2\;bgt %0,$+16\;efdtsteq %0,%1,%2\;bng %0,$+8\;efdtstgt %0,%L1,%L2" - [(set_attr "type" "veccmpsimple") - (set_attr "length" "20")]) - -(define_insn "cmptflt_gpr" - [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r") - (match_operand:TF 2 "gpc_reg_operand" "r"))] - CMPTFLT_GPR))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128 - && !(flag_finite_math_only && !flag_trapping_math)" - "efdcmplt %0,%1,%2\;bgt %0,$+16\;efdcmpeq %0,%1,%2\;bng %0,$+8\;efdcmplt %0,%L1,%L2" - [(set_attr "type" "veccmp") - (set_attr "length" "20")]) - -(define_insn "tsttflt_gpr" - [(set (match_operand:CCFP 0 "cc_reg_operand" "=y") - (unspec:CCFP - [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r") - (match_operand:TF 2 "gpc_reg_operand" "r"))] - TSTTFLT_GPR))] - "!TARGET_IEEEQUAD - && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128 - && flag_finite_math_only && !flag_trapping_math" - "efdtstlt %0,%1,%2\;bgt %0,$+16\;efdtsteq %0,%1,%2\;bng %0,$+8\;efdtstlt %0,%L1,%L2" - [(set_attr "type" "veccmpsimple") - (set_attr "length" "20")]) - ;; Out-of-line prologues and epilogues. (define_insn "*save_gpregs_spe" [(match_parallel 0 "any_parallel_operand"