aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/config
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/config')
-rw-r--r--gcc-4.9/gcc/config/aarch64/aarch64.c136
-rw-r--r--gcc-4.9/gcc/config/i386/i386.c5
2 files changed, 78 insertions, 63 deletions
diff --git a/gcc-4.9/gcc/config/aarch64/aarch64.c b/gcc-4.9/gcc/config/aarch64/aarch64.c
index 09f2d2c..7097994 100644
--- a/gcc-4.9/gcc/config/aarch64/aarch64.c
+++ b/gcc-4.9/gcc/config/aarch64/aarch64.c
@@ -4825,6 +4825,80 @@ aarch64_rtx_arith_op_extract_p (rtx x, enum machine_mode mode)
return false;
}
+/* Calculate the cost of calculating (if_then_else (OP0) (OP1) (OP2)),
+ storing it in *COST. Result is true if the total cost of the operation
+ has now been calculated. */
+static bool
+aarch64_if_then_else_costs (rtx op0, rtx op1, rtx op2, int *cost, bool speed)
+{
+ rtx inner;
+ rtx comparator;
+ enum rtx_code cmpcode;
+
+ if (COMPARISON_P (op0))
+ {
+ inner = XEXP (op0, 0);
+ comparator = XEXP (op0, 1);
+ cmpcode = GET_CODE (op0);
+ }
+ else
+ {
+ inner = op0;
+ comparator = const0_rtx;
+ cmpcode = NE;
+ }
+
+ if (GET_CODE (op1) == PC || GET_CODE (op2) == PC)
+ {
+ /* Conditional branch. */
+ if (GET_MODE_CLASS (GET_MODE (inner)) == MODE_CC)
+ return true;
+ else
+ {
+ if (cmpcode == NE || cmpcode == EQ)
+ {
+ if (comparator == const0_rtx)
+ {
+ /* TBZ/TBNZ/CBZ/CBNZ. */
+ if (GET_CODE (inner) == ZERO_EXTRACT)
+ /* TBZ/TBNZ. */
+ *cost += rtx_cost (XEXP (inner, 0),
+ ZERO_EXTRACT, 0, speed);
+ else
+ /* CBZ/CBNZ. */
+ *cost += rtx_cost (inner, cmpcode, 0, speed);
+
+ return true;
+ }
+ }
+ else if (cmpcode == LT || cmpcode == GE)
+ {
+ /* TBZ/TBNZ. */
+ if (comparator == const0_rtx)
+ return true;
+ }
+ }
+ }
+ else if (GET_MODE_CLASS (GET_MODE (inner)) == MODE_CC)
+ {
+ /* It's a conditional operation based on the status flags,
+ so it must be some flavor of CSEL. */
+
+ /* CSNEG, CSINV, and CSINC are handled for free as part of CSEL. */
+ if (GET_CODE (op1) == NEG
+ || GET_CODE (op1) == NOT
+ || (GET_CODE (op1) == PLUS && XEXP (op1, 1) == const1_rtx))
+ op1 = XEXP (op1, 0);
+
+ *cost += rtx_cost (op1, IF_THEN_ELSE, 1, speed);
+ *cost += rtx_cost (op2, IF_THEN_ELSE, 2, speed);
+ return true;
+ }
+
+ /* We don't know what this is, cost all operands. */
+ return false;
+}
+
/* Calculate the cost of calculating X, storing it in *COST. Result
is true if the total cost of the operation has now been calculated. */
static bool
@@ -5572,66 +5646,8 @@ cost_plus:
return false; /* All arguments need to be in registers. */
case IF_THEN_ELSE:
- op2 = XEXP (x, 2);
- op0 = XEXP (x, 0);
- op1 = XEXP (x, 1);
-
- if (GET_CODE (op1) == PC || GET_CODE (op2) == PC)
- {
- /* Conditional branch. */
- if (GET_MODE_CLASS (GET_MODE (XEXP (op0, 0))) == MODE_CC)
- return true;
- else
- {
- if (GET_CODE (op0) == NE
- || GET_CODE (op0) == EQ)
- {
- rtx inner = XEXP (op0, 0);
- rtx comparator = XEXP (op0, 1);
-
- if (comparator == const0_rtx)
- {
- /* TBZ/TBNZ/CBZ/CBNZ. */
- if (GET_CODE (inner) == ZERO_EXTRACT)
- /* TBZ/TBNZ. */
- *cost += rtx_cost (XEXP (inner, 0), ZERO_EXTRACT,
- 0, speed);
- else
- /* CBZ/CBNZ. */
- *cost += rtx_cost (inner, GET_CODE (op0), 0, speed);
-
- return true;
- }
- }
- else if (GET_CODE (op0) == LT
- || GET_CODE (op0) == GE)
- {
- rtx comparator = XEXP (op0, 1);
-
- /* TBZ/TBNZ. */
- if (comparator == const0_rtx)
- return true;
- }
- }
- }
- else if (GET_MODE_CLASS (GET_MODE (XEXP (op0, 0))) == MODE_CC)
- {
- /* It's a conditional operation based on the status flags,
- so it must be some flavor of CSEL. */
-
- /* CSNEG, CSINV, and CSINC are handled for free as part of CSEL. */
- if (GET_CODE (op1) == NEG
- || GET_CODE (op1) == NOT
- || (GET_CODE (op1) == PLUS && XEXP (op1, 1) == const1_rtx))
- op1 = XEXP (op1, 0);
-
- *cost += rtx_cost (op1, IF_THEN_ELSE, 1, speed);
- *cost += rtx_cost (op2, IF_THEN_ELSE, 2, speed);
- return true;
- }
-
- /* We don't know what this is, cost all operands. */
- return false;
+ return aarch64_if_then_else_costs (XEXP (x, 0), XEXP (x, 1),
+ XEXP (x, 2), cost, speed);
case EQ:
case NE:
diff --git a/gcc-4.9/gcc/config/i386/i386.c b/gcc-4.9/gcc/config/i386/i386.c
index a3c88ce..9f57c6e 100644
--- a/gcc-4.9/gcc/config/i386/i386.c
+++ b/gcc-4.9/gcc/config/i386/i386.c
@@ -4252,8 +4252,7 @@ ix86_option_override_internal (bool main_args_p,
/* Handle stack protector */
if (!opts_set->x_ix86_stack_protector_guard)
- opts->x_ix86_stack_protector_guard
- = TARGET_HAS_BIONIC ? SSP_GLOBAL : SSP_TLS;
+ opts->x_ix86_stack_protector_guard = SSP_TLS;
/* Handle -mmemcpy-strategy= and -mmemset-strategy= */
if (opts->x_ix86_tune_memcpy_strategy)
@@ -11310,7 +11309,7 @@ ix86_set_fp_insn ()
ix86_compute_frame_layout (&frame);
gcc_assert (frame_pointer_partially_needed);
- offset = frame.stack_pointer_offset - frame.hard_frame_pointer_offset;
+ offset = frame.stack_pointer_offset - frame.hard_frame_pointer_offset;
if (TARGET_64BIT && (offset > 0x7fffffff))
{