aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-07 20:26:40 +0000
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2015-04-07 20:26:40 +0000
commite649cb82534325704ba54b05841ebc4dad702096 (patch)
treefdbea6c0e13d9f64e8102bc7e6ffd56081a108ae
parent9daeda34b3ac8d29982c2ab772c93ff3573fed79 (diff)
Back fixes for 65576, 65240, and 65614 to the branchibm/gcc-4_9-addr
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ibm/gcc-4_9-addr@221907 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.meissner59
-rw-r--r--gcc/config/rs6000/predicates.md3
-rw-r--r--gcc/config/rs6000/rs6000.c48
-rw-r--r--gcc/config/rs6000/rs6000.md22
-rw-r--r--gcc/testsuite/ChangeLog.meissner10
-rw-r--r--gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c4
-rw-r--r--gcc/testsuite/gcc.target/powerpc/compress-float-ppc.c4
7 files changed, 128 insertions, 22 deletions
diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner
index 954d5edaa52..65c30c848e6 100644
--- a/gcc/ChangeLog.meissner
+++ b/gcc/ChangeLog.meissner
@@ -1,3 +1,62 @@
+2015-04-07 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Back port from trunk:
+ 2015-04-06 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/65614
+ * config/rs6000/rs6000.c (struct processor_costs): Add cost field
+ for SF->DF conversions to make FLOAT_EXTEND more expensive, so
+ that LFD is used to load double constants instead of LFS. Add
+ defaults for all costs structures. Add comments for missing
+ initialization fields.
+ (size32_cost): Likewise.
+ (size64_cost): Likewise.
+ (rs64a_cost): Likewise.
+ (mpccore_cost): Likewise.
+ (ppc403_cost): Likewise.
+ (ppc405_cost): Likewise.
+ (ppc440_cost): Likewise.
+ (ppc476_cost): Likewise.
+ (ppc601_cost): Likewise.
+ (ppc603_cost): Likewise.
+ (ppc604_cost): Likewise.
+ (ppc604e_cost): Likewise.
+ (ppc620_cost): Likewise.
+ (ppc630_cost): Likewise.
+ (ppccell_cost): Likewise.
+ (ppc750_cost): Likewise.
+ (ppc7450_cost): Likewise.
+ (ppc8540_cost): Likewise.
+ (ppce300c2c3_cost): Likewise.
+ (ppce500mc_cost): Likewise.
+ (ppce500mc64_cost): Likewise.
+ (ppce5500_cost): Likewise.
+ (ppce6500_cost): Likewise.
+ (titan_cost): Likewise.
+ (power4_cost): Likewise.
+ (power6_cost): Likewise.
+ (power7_cost): Likewise.
+ (power8_cost): Likewise.
+ (ppca2_cost): Likewise.
+ (rs6000_rtx_costs): Make FLOAT_EXTEND use SFDF_convert field.
+
+ * config/rs6000/rs6000.md (extendsfdf2_fpr): Generate XSCPSGNDP
+ instead of XXLOR to copy SFmode to clear out dirty bits created
+ when SFmode denormals are generated.
+ (mov<mode>_hardfloat, FMOVE32 case): Likewise.
+ (truncdfsf2_fpr): Add support for ISA 2.07 XSRSP instruction.
+
+ Back port from trunk:
+ 2015-04-04 Alan Modra <amodra@gmail.com>
+
+ PR target/65576
+ PR target/65240
+ * config/rs6000/predicates.md (zero_reg_mem_operand): Exclude
+ 0.0 constant unless TARGET_VSX.
+ * config/rs6000/rs6000.md (extenddftf2_internal): Remove last
+ alternative.
+
+
2015-03-25 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk:
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index 3f983256ba8..647148d91df 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -938,7 +938,8 @@
;; Return 1 if the operand is CONST_DOUBLE 0, register or memory operand.
(define_predicate "zero_reg_mem_operand"
- (ior (match_operand 0 "zero_fp_constant")
+ (ior (and (match_test "TARGET_VSX")
+ (match_operand 0 "zero_fp_constant"))
(match_operand 0 "reg_or_mem_operand")))
;; Return 1 if the operand is a CONST_INT and it is the element for 64-bit
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 14904c685f5..9f9dcec525e 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -433,6 +433,7 @@ struct processor_costs {
const int l2_cache_size; /* size of l2 cache, in kilobytes. */
const int simultaneous_prefetches; /* number of parallel prefetch
operations. */
+ const int sfdf_convert; /* cost of SF->DF conversion. */
};
const struct processor_costs *rs6000_cost;
@@ -452,10 +453,11 @@ struct processor_costs size32_cost = {
COSTS_N_INSNS (1), /* dmul */
COSTS_N_INSNS (1), /* sdiv */
COSTS_N_INSNS (1), /* ddiv */
- 32,
- 0,
- 0,
- 0,
+ 32, /* cache line size */
+ 0, /* l1 cache */
+ 0, /* l2 cache */
+ 0, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction size costs on 64bit processors. */
@@ -471,10 +473,11 @@ struct processor_costs size64_cost = {
COSTS_N_INSNS (1), /* dmul */
COSTS_N_INSNS (1), /* sdiv */
COSTS_N_INSNS (1), /* ddiv */
- 128,
- 0,
- 0,
- 0,
+ 128, /* cache line size */
+ 0, /* l1 cache */
+ 0, /* l2 cache */
+ 0, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on RS64A processors. */
@@ -494,6 +497,7 @@ struct processor_costs rs64a_cost = {
128, /* l1 cache */
2048, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on MPCCORE processors. */
@@ -513,6 +517,7 @@ struct processor_costs mpccore_cost = {
4, /* l1 cache */
16, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC403 processors. */
@@ -532,6 +537,7 @@ struct processor_costs ppc403_cost = {
4, /* l1 cache */
16, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC405 processors. */
@@ -551,6 +557,7 @@ struct processor_costs ppc405_cost = {
16, /* l1 cache */
128, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC440 processors. */
@@ -570,6 +577,7 @@ struct processor_costs ppc440_cost = {
32, /* l1 cache */
256, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC476 processors. */
@@ -589,6 +597,7 @@ struct processor_costs ppc476_cost = {
32, /* l1 cache */
512, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC601 processors. */
@@ -608,6 +617,7 @@ struct processor_costs ppc601_cost = {
32, /* l1 cache */
256, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC603 processors. */
@@ -627,6 +637,7 @@ struct processor_costs ppc603_cost = {
8, /* l1 cache */
64, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC604 processors. */
@@ -646,6 +657,7 @@ struct processor_costs ppc604_cost = {
16, /* l1 cache */
512, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC604e processors. */
@@ -665,6 +677,7 @@ struct processor_costs ppc604e_cost = {
32, /* l1 cache */
1024, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC620 processors. */
@@ -684,6 +697,7 @@ struct processor_costs ppc620_cost = {
32, /* l1 cache */
1024, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC630 processors. */
@@ -703,6 +717,7 @@ struct processor_costs ppc630_cost = {
64, /* l1 cache */
1024, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on Cell processor. */
@@ -723,6 +738,7 @@ struct processor_costs ppccell_cost = {
32, /* l1 cache */
512, /* l2 cache */
6, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC750 and PPC7400 processors. */
@@ -742,6 +758,7 @@ struct processor_costs ppc750_cost = {
32, /* l1 cache */
512, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC7450 processors. */
@@ -761,6 +778,7 @@ struct processor_costs ppc7450_cost = {
32, /* l1 cache */
1024, /* l2 cache */
1, /* streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPC8540 processors. */
@@ -780,6 +798,7 @@ struct processor_costs ppc8540_cost = {
32, /* l1 cache */
256, /* l2 cache */
1, /* prefetch streams /*/
+ 0, /* SF->DF convert */
};
/* Instruction costs on E300C2 and E300C3 cores. */
@@ -799,6 +818,7 @@ struct processor_costs ppce300c2c3_cost = {
16, /* l1 cache */
16, /* l2 cache */
1, /* prefetch streams /*/
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPCE500MC processors. */
@@ -818,6 +838,7 @@ struct processor_costs ppce500mc_cost = {
32, /* l1 cache */
128, /* l2 cache */
1, /* prefetch streams /*/
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPCE500MC64 processors. */
@@ -837,6 +858,7 @@ struct processor_costs ppce500mc64_cost = {
32, /* l1 cache */
128, /* l2 cache */
1, /* prefetch streams /*/
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPCE5500 processors. */
@@ -856,6 +878,7 @@ struct processor_costs ppce5500_cost = {
32, /* l1 cache */
128, /* l2 cache */
1, /* prefetch streams /*/
+ 0, /* SF->DF convert */
};
/* Instruction costs on PPCE6500 processors. */
@@ -875,6 +898,7 @@ struct processor_costs ppce6500_cost = {
32, /* l1 cache */
128, /* l2 cache */
1, /* prefetch streams /*/
+ 0, /* SF->DF convert */
};
/* Instruction costs on AppliedMicro Titan processors. */
@@ -894,6 +918,7 @@ struct processor_costs titan_cost = {
32, /* l1 cache */
512, /* l2 cache */
1, /* prefetch streams /*/
+ 0, /* SF->DF convert */
};
/* Instruction costs on POWER4 and POWER5 processors. */
@@ -913,6 +938,7 @@ struct processor_costs power4_cost = {
32, /* l1 cache */
1024, /* l2 cache */
8, /* prefetch streams /*/
+ 0, /* SF->DF convert */
};
/* Instruction costs on POWER6 processors. */
@@ -932,6 +958,7 @@ struct processor_costs power6_cost = {
64, /* l1 cache */
2048, /* l2 cache */
16, /* prefetch streams */
+ 0, /* SF->DF convert */
};
/* Instruction costs on POWER7 processors. */
@@ -951,6 +978,7 @@ struct processor_costs power7_cost = {
32, /* l1 cache */
256, /* l2 cache */
12, /* prefetch streams */
+ COSTS_N_INSNS (3), /* SF->DF convert */
};
/* Instruction costs on POWER8 processors. */
@@ -970,6 +998,7 @@ struct processor_costs power8_cost = {
32, /* l1 cache */
256, /* l2 cache */
12, /* prefetch streams */
+ COSTS_N_INSNS (3), /* SF->DF convert */
};
/* Instruction costs on POWER A2 processors. */
@@ -989,6 +1018,7 @@ struct processor_costs ppca2_cost = {
16, /* l1 cache */
2048, /* l2 cache */
16, /* prefetch streams */
+ 0, /* SF->DF convert */
};
@@ -30154,7 +30184,7 @@ rs6000_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
case FLOAT_EXTEND:
if (mode == DFmode)
- *total = 0;
+ *total = rs6000_cost->sfdf_convert;
else
*total = rs6000_cost->fp;
return false;
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index f353b97773d..e17e0b7f3aa 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -5281,7 +5281,7 @@
fmr %0,%1
lfs%U1%X1 %0,%1
#
- xxlor %x0,%x1,%x1
+ xscpsgndp %x0,%x1,%x1
lxsspx %x0,%y1"
"&& reload_completed && REG_P (operands[1]) && REGNO (operands[0]) == REGNO (operands[1])"
[(const_int 0)]
@@ -5300,7 +5300,7 @@
(const_string "fpload_u")
(const_string "fpload")))
(const_string "fp")
- (const_string "vecsimple")
+ (const_string "fp")
(if_then_else
(match_test "update_indexed_address_mem (operands[1], VOIDmode)")
(const_string "fpload_ux")
@@ -5316,10 +5316,12 @@
"")
(define_insn "*truncdfsf2_fpr"
- [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
- (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "d")))]
+ [(set (match_operand:SF 0 "gpc_reg_operand" "=f,wy")
+ (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "d,ws")))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT"
- "frsp %0,%1"
+ "@
+ frsp %0,%1
+ xsrsp %x0,%x1"
[(set_attr "type" "fp")])
;; This expander is here to avoid FLOAT_WORDS_BIGENDIAN tests in
@@ -9243,7 +9245,7 @@
lwz%U1%X1 %0,%1
stw%U0%X0 %1,%0
fmr %0,%1
- xxlor %x0,%x1,%x1
+ xscpsgndp %x0,%x1,%x1
xxlxor %x0,%x0,%x0
li %0,0
<f32_li>
@@ -9272,7 +9274,7 @@
(const_string "store_u")
(const_string "store")))
(const_string "fp")
- (const_string "vecsimple")
+ (const_string "fp")
(const_string "vecsimple")
(const_string "integer")
(if_then_else
@@ -9714,9 +9716,9 @@
})
(define_insn_and_split "*extenddftf2_internal"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=m,Y,ws,d,&d,r")
- (float_extend:TF (match_operand:DF 1 "input_operand" "d,r,md,md,md,rm")))
- (use (match_operand:DF 2 "zero_reg_mem_operand" "d,r,j,m,d,n"))]
+ [(set (match_operand:TF 0 "nonimmediate_operand" "=m,Y,ws,d,&d")
+ (float_extend:TF (match_operand:DF 1 "input_operand" "d,r,md,md,md")))
+ (use (match_operand:DF 2 "zero_reg_mem_operand" "d,r,j,m,d"))]
"!TARGET_IEEEQUAD
&& TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
&& TARGET_LONG_DOUBLE_128"
diff --git a/gcc/testsuite/ChangeLog.meissner b/gcc/testsuite/ChangeLog.meissner
index 095e8f1ec02..3cf9dc09180 100644
--- a/gcc/testsuite/ChangeLog.meissner
+++ b/gcc/testsuite/ChangeLog.meissner
@@ -1,3 +1,13 @@
+2015-04-07 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Back port from trunk:
+ 2015-04-06 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/65614
+ * gcc.target/powerpc/compress-float-ppc-pic.c: Run test on power5
+ to get floating point compression.
+ * gcc.target/powerpc/compress-foat-ppc.c: Likewise.
+
2015-03-17 Michael Meissner <meissner@linux.vnet.ibm.com>
Back port from trunk:
diff --git a/gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c b/gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c
index aa1da5245ff..1c8814bcb93 100644
--- a/gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c
+++ b/gcc/testsuite/gcc.target/powerpc/compress-float-ppc-pic.c
@@ -1,5 +1,7 @@
/* { dg-do compile { target powerpc_fprs } } */
-/* { dg-options "-O2 -fpic" } */
+/* { dg-options "-O2 -fpic -mcpu=power5" } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power5" } } */
+
double foo (double x) {
return x + 1.75;
}
diff --git a/gcc/testsuite/gcc.target/powerpc/compress-float-ppc.c b/gcc/testsuite/gcc.target/powerpc/compress-float-ppc.c
index 312642e68fc..290ab2be121 100644
--- a/gcc/testsuite/gcc.target/powerpc/compress-float-ppc.c
+++ b/gcc/testsuite/gcc.target/powerpc/compress-float-ppc.c
@@ -1,5 +1,7 @@
/* { dg-do compile { target powerpc_fprs } } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mcpu=power5" } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power5" } } */
+
double foo (double x) {
return x + 1.75;
}