diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-14 07:03:09 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-14 07:03:09 +0000 |
commit | d329a134cd2455f54f873318532f14938116b8b6 (patch) | |
tree | 2e790b36b33b55ae6f7b6bdff6fbf559fce5df4f /gcc/config/rs6000 | |
parent | 9f9551c1ebf9d9421d8496c92d0f4a8c7b7571b5 (diff) | |
download | gcc-d329a134cd2455f54f873318532f14938116b8b6.tar.gz |
2011-03-14 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 170931 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@170932 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r-- | gcc/config/rs6000/freebsd.h | 9 | ||||
-rw-r--r-- | gcc/config/rs6000/predicates.md | 10 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 45 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 20 | ||||
-rw-r--r-- | gcc/config/rs6000/t-freebsd | 50 |
5 files changed, 111 insertions, 23 deletions
diff --git a/gcc/config/rs6000/freebsd.h b/gcc/config/rs6000/freebsd.h index bd3045ea181..567263b2aef 100644 --- a/gcc/config/rs6000/freebsd.h +++ b/gcc/config/rs6000/freebsd.h @@ -1,5 +1,6 @@ /* Definitions for PowerPC running FreeBSD using the ELF format - Copyright (C) 2001, 2003, 2007, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2007, 2009, 2010, 2011 + Free Software Foundation, Inc. Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi. This file is part of GCC. @@ -70,4 +71,10 @@ #undef ASM_APP_OFF #define ASM_APP_OFF "#NO_APP\n" +/* We don't need to generate entries in .fixup, except when + -mrelocatable or -mrelocatable-lib is given. */ +#undef RELOCATABLE_NEEDS_FIXUP +#define RELOCATABLE_NEEDS_FIXUP \ + (target_flags & target_flags_explicit & MASK_RELOCATABLE) + #define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO) diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 3839643af4a..1796bf58eed 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -371,7 +371,10 @@ (and (match_test "TARGET_ALTIVEC") (match_test "easy_altivec_constant (op, mode)"))) { - HOST_WIDE_INT val = const_vector_elt_as_int (op, GET_MODE_NUNITS (mode) - 1); + HOST_WIDE_INT val; + if (mode == V2DImode || mode == V2DFmode) + return 0; + val = const_vector_elt_as_int (op, GET_MODE_NUNITS (mode) - 1); val = ((val & 0xff) ^ 0x80) - 0x80; return EASY_VECTOR_15_ADD_SELF (val); }) @@ -382,7 +385,10 @@ (and (match_test "TARGET_ALTIVEC") (match_test "easy_altivec_constant (op, mode)"))) { - HOST_WIDE_INT val = const_vector_elt_as_int (op, GET_MODE_NUNITS (mode) - 1); + HOST_WIDE_INT val; + if (mode == V2DImode || mode == V2DFmode) + return 0; + val = const_vector_elt_as_int (op, GET_MODE_NUNITS (mode) - 1); return EASY_VECTOR_MSB (val, GET_MODE_INNER (mode)); }) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index b6d1a94caea..231651e0d46 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4855,7 +4855,13 @@ num_insns_constant (rtx op, enum machine_mode mode) HOST_WIDE_INT const_vector_elt_as_int (rtx op, unsigned int elt) { - rtx tmp = CONST_VECTOR_ELT (op, elt); + rtx tmp; + + /* We can't handle V2DImode and V2DFmode vector constants here yet. */ + gcc_assert (GET_MODE (op) != V2DImode + && GET_MODE (op) != V2DFmode); + + tmp = CONST_VECTOR_ELT (op, elt); if (GET_MODE (op) == V4SFmode || GET_MODE (op) == V2SFmode) tmp = gen_lowpart (SImode, tmp); @@ -4876,13 +4882,24 @@ vspltis_constant (rtx op, unsigned step, unsigned copies) enum machine_mode inner = GET_MODE_INNER (mode); unsigned i; - unsigned nunits = GET_MODE_NUNITS (mode); - unsigned bitsize = GET_MODE_BITSIZE (inner); - unsigned mask = GET_MODE_MASK (inner); + unsigned nunits; + unsigned bitsize; + unsigned mask; + + HOST_WIDE_INT val; + HOST_WIDE_INT splat_val; + HOST_WIDE_INT msb_val; + + if (mode == V2DImode || mode == V2DFmode) + return false; + + nunits = GET_MODE_NUNITS (mode); + bitsize = GET_MODE_BITSIZE (inner); + mask = GET_MODE_MASK (inner); - HOST_WIDE_INT val = const_vector_elt_as_int (op, nunits - 1); - HOST_WIDE_INT splat_val = val; - HOST_WIDE_INT msb_val = val > 0 ? 0 : -1; + val = const_vector_elt_as_int (op, nunits - 1); + splat_val = val; + msb_val = val > 0 ? 0 : -1; /* Construct the value to be splatted, if possible. If not, return 0. */ for (i = 2; i <= copies; i *= 2) @@ -5314,12 +5331,18 @@ rs6000_expand_vector_init (rtx target, rtx vals) } else { - rtx op0 = copy_to_reg (XVECEXP (vals, 0, 0)); - rtx op1 = copy_to_reg (XVECEXP (vals, 0, 1)); if (mode == V2DFmode) - emit_insn (gen_vsx_concat_v2df (target, op0, op1)); + { + rtx op0 = copy_to_mode_reg (DFmode, XVECEXP (vals, 0, 0)); + rtx op1 = copy_to_mode_reg (DFmode, XVECEXP (vals, 0, 1)); + emit_insn (gen_vsx_concat_v2df (target, op0, op1)); + } else - emit_insn (gen_vsx_concat_v2di (target, op0, op1)); + { + rtx op0 = copy_to_mode_reg (DImode, XVECEXP (vals, 0, 0)); + rtx op1 = copy_to_mode_reg (DImode, XVECEXP (vals, 0, 1)); + emit_insn (gen_vsx_concat_v2di (target, op0, op1)); + } } return; } diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 38a5a50b8e5..4455d9a8319 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -10052,8 +10052,8 @@ ; List r->r after r->"o<>", otherwise reload will try to reload a ; non-offsettable address by using r->r which won't make progress. (define_insn "*movdi_internal32" - [(set (match_operand:DI 0 "rs6000_nonimmediate_operand" "=o<>,r,r,*d,*d,m,r") - (match_operand:DI 1 "input_operand" "r,r,m,d,m,d,IJKnGHF"))] + [(set (match_operand:DI 0 "rs6000_nonimmediate_operand" "=o<>,r,r,*d,*d,m,r,?wa") + (match_operand:DI 1 "input_operand" "r,r,m,d,m,d,IJKnGHF,O"))] "! TARGET_POWERPC64 && (gpc_reg_operand (operands[0], DImode) || gpc_reg_operand (operands[1], DImode))" @@ -10064,8 +10064,9 @@ fmr %0,%1 lfd%U1%X1 %0,%1 stfd%U0%X0 %1,%0 - #" - [(set_attr "type" "load,*,store,fp,fpload,fpstore,*")]) + # + xxlxor %x0,%x0,%x0" + [(set_attr "type" "load,*,store,fp,fpload,fpstore,*,vecsimple")]) (define_split [(set (match_operand:DI 0 "gpc_reg_operand" "") @@ -10122,8 +10123,8 @@ (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4,4")]) (define_insn "*movdi_internal64" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,*d,*d,m,r,*h,*h") - (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,d,m,d,*h,r,0"))] + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,*d,*d,m,r,*h,*h,?wa") + (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,d,m,d,*h,r,0,O"))] "TARGET_POWERPC64 && (!TARGET_MFPGPR || !TARGET_HARD_FLOAT || !TARGET_FPRS) && (gpc_reg_operand (operands[0], DImode) || gpc_reg_operand (operands[1], DImode))" @@ -10140,9 +10141,10 @@ stfd%U0%X0 %1,%0 mf%1 %0 mt%0 %1 - {cror 0,0,0|nop}" - [(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*") - (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4")]) + {cror 0,0,0|nop} + xxlxor %x0,%x0,%x0" + [(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,mfjmpr,mtjmpr,*,vecsimple") + (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4,4")]) ;; immediate value valid for a single instruction hiding in a const_double (define_insn "" diff --git a/gcc/config/rs6000/t-freebsd b/gcc/config/rs6000/t-freebsd new file mode 100644 index 00000000000..8c5c2565615 --- /dev/null +++ b/gcc/config/rs6000/t-freebsd @@ -0,0 +1,50 @@ +# Overrides for FreeBSD PowerPC +# +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# 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 3, 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 COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# We do not want to build darwin-ldouble.c, so set the LIB2FUNCS_EXTRA again. +# Invoke this file after rs6000/t-ppccomm. + +LIB2FUNCS_EXTRA = tramp.S + +# Overrides for FreeBSD PowerPC +# +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# 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 3, 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 COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# We do not want to build darwin-ldouble.c, so set the LIB2FUNCS_EXTRA again. +# Invoke this file after rs6000/t-ppccomm. + +LIB2FUNCS_EXTRA = tramp.S + |