aarch64.c (aarch64_if_then_else_costs): Allow non comparisons for OP0.
2014-06-03 Andrew Pinski <apinski@cavium.com> * config/aarch64/aarch64.c (aarch64_if_then_else_costs): Allow non comparisons for OP0. 2014-06-03 Andrew Pinski <apinski@cavium.com> * gcc.c-torture/compile/20140528-1.c: New testcase. From-SVN: r211206
This commit is contained in:
parent
2d5ffe4631
commit
b9e3afe9b4
|
@ -1,4 +1,9 @@
|
||||||
014-06-03 Andrew Pinski <apinski@cavium.com>
|
2014-06-03 Andrew Pinski <apinski@cavium.com>
|
||||||
|
|
||||||
|
* config/aarch64/aarch64.c (aarch64_if_then_else_costs): Allow non comparisons
|
||||||
|
for OP0.
|
||||||
|
|
||||||
|
2014-06-03 Andrew Pinski <apinski@cavium.com>
|
||||||
|
|
||||||
* config/aarch64/aarch64.c (aarch64_if_then_else_costs): New function.
|
* config/aarch64/aarch64.c (aarch64_if_then_else_costs): New function.
|
||||||
(aarch64_rtx_costs): Use aarch64_if_then_else_costs.
|
(aarch64_rtx_costs): Use aarch64_if_then_else_costs.
|
||||||
|
|
|
@ -4855,19 +4855,32 @@ aarch64_rtx_arith_op_extract_p (rtx x, enum machine_mode mode)
|
||||||
static bool
|
static bool
|
||||||
aarch64_if_then_else_costs (rtx op0, rtx op1, rtx op2, int *cost, bool speed)
|
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)
|
if (GET_CODE (op1) == PC || GET_CODE (op2) == PC)
|
||||||
{
|
{
|
||||||
/* Conditional branch. */
|
/* Conditional branch. */
|
||||||
if (GET_MODE_CLASS (GET_MODE (XEXP (op0, 0))) == MODE_CC)
|
if (GET_MODE_CLASS (GET_MODE (inner)) == MODE_CC)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GET_CODE (op0) == NE
|
if (cmpcode == NE || cmpcode == EQ)
|
||||||
|| GET_CODE (op0) == EQ)
|
|
||||||
{
|
{
|
||||||
rtx inner = XEXP (op0, 0);
|
|
||||||
rtx comparator = XEXP (op0, 1);
|
|
||||||
|
|
||||||
if (comparator == const0_rtx)
|
if (comparator == const0_rtx)
|
||||||
{
|
{
|
||||||
/* TBZ/TBNZ/CBZ/CBNZ. */
|
/* TBZ/TBNZ/CBZ/CBNZ. */
|
||||||
|
@ -4877,23 +4890,20 @@ aarch64_if_then_else_costs (rtx op0, rtx op1, rtx op2, int *cost, bool speed)
|
||||||
0, speed);
|
0, speed);
|
||||||
else
|
else
|
||||||
/* CBZ/CBNZ. */
|
/* CBZ/CBNZ. */
|
||||||
*cost += rtx_cost (inner, GET_CODE (op0), 0, speed);
|
*cost += rtx_cost (inner, cmpcode, 0, speed);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (GET_CODE (op0) == LT
|
else if (cmpcode == LT || cmpcode == GE)
|
||||||
|| GET_CODE (op0) == GE)
|
|
||||||
{
|
{
|
||||||
rtx comparator = XEXP (op0, 1);
|
|
||||||
|
|
||||||
/* TBZ/TBNZ. */
|
/* TBZ/TBNZ. */
|
||||||
if (comparator == const0_rtx)
|
if (comparator == const0_rtx)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (GET_MODE_CLASS (GET_MODE (XEXP (op0, 0))) == MODE_CC)
|
else if (GET_MODE_CLASS (GET_MODE (inner)) == MODE_CC)
|
||||||
{
|
{
|
||||||
/* It's a conditional operation based on the status flags,
|
/* It's a conditional operation based on the status flags,
|
||||||
so it must be some flavor of CSEL. */
|
so it must be some flavor of CSEL. */
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2014-06-03 Andrew Pinski <apinski@cavium.com>
|
||||||
|
|
||||||
|
* gcc.c-torture/compile/20140528-1.c: New testcase.
|
||||||
|
|
||||||
2014-06-03 Dehao Chen <dehao@google.com>
|
2014-06-03 Dehao Chen <dehao@google.com>
|
||||||
|
|
||||||
* gcc.dg/tree-prof/merge_block.c: New test.
|
* gcc.dg/tree-prof/merge_block.c: New test.
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
unsigned f(unsigned flags, unsigned capabilities)
|
||||||
|
{
|
||||||
|
unsigned gfp_mask;
|
||||||
|
unsigned gfp_notmask = 0;
|
||||||
|
gfp_mask = flags & ((1 << 25) - 1);
|
||||||
|
if (!(capabilities & 0x00000001))
|
||||||
|
gfp_mask |= 0x1000000u;
|
||||||
|
return (gfp_mask & ~gfp_notmask);
|
||||||
|
}
|
Loading…
Reference in New Issue