public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] Delete obsolete CC_ZESWP and CC_SESWP CC modes
@ 2016-04-27 14:12 Kyrill Tkachov
  2016-05-11  9:00 ` Kyrill Tkachov
  2016-05-27 10:15 ` James Greenhalgh
  0 siblings, 2 replies; 4+ messages in thread
From: Kyrill Tkachov @ 2016-04-27 14:12 UTC (permalink / raw)
  To: GCC Patches; +Cc: Marcus Shawcroft, Richard Earnshaw, James Greenhalgh

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

Hi all,

The CC_ZESWP and CC_SESWP are not used anywhere and seem to be a remmant of some
old code that was removed. The various compare+extend patterns in aarch64.md don't
use these modes. So it should be safe to remove them to avoid future confusion.

Bootstrapped and tested on aarch64.

Ok for trunk?

Thanks,
Kyrill

2016-04-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/aarch64/aarch64-modes.def (CC_ZESWP, CC_SESWP): Delete.
     * config/aarch64/aarch64.c (aarch64_select_cc_mode): Remove condition
     that returns CC_SESWPmode and CC_ZESWPmode.
     (aarch64_get_condition_code_1): Remove handling of CC_SESWPmode
     and CC_SESWPmode.
     (aarch64_rtx_costs): Likewise.

[-- Attachment #2: aarch64-cc-modes.patch --]
[-- Type: text/x-patch, Size: 2281 bytes --]

diff --git a/gcc/config/aarch64/aarch64-modes.def b/gcc/config/aarch64/aarch64-modes.def
index 7de0b3f2fec1024946e40c66088b5b48675c4b7a..de8227f0ce47f4268761047d4e7bc46627c34bc7 100644
--- a/gcc/config/aarch64/aarch64-modes.def
+++ b/gcc/config/aarch64/aarch64-modes.def
@@ -21,8 +21,6 @@
 CC_MODE (CCFP);
 CC_MODE (CCFPE);
 CC_MODE (CC_SWP);
-CC_MODE (CC_ZESWP); /* zero-extend LHS (but swap to make it RHS).  */
-CC_MODE (CC_SESWP); /* sign-extend LHS (but swap to make it RHS).  */
 CC_MODE (CC_NZ);    /* Only N and Z bits of condition flags are valid.  */
 CC_MODE (CC_Z);     /* Only Z bit of condition flags is valid.  */
 CC_MODE (CC_C);     /* Only C bit of condition flags is valid.  */
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 466712e0c1e9c99ed76cb55728e9eeb6783eaa13..5ca2ae820335e9e656fb2c1b929f903bf0287f19 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4192,14 +4192,6 @@ aarch64_select_cc_mode (RTX_CODE code, rtx x, rtx y)
       && GET_CODE (x) == NEG)
     return CC_Zmode;
 
-  /* A compare of a mode narrower than SI mode against zero can be done
-     by extending the value in the comparison.  */
-  if ((GET_MODE (x) == QImode || GET_MODE (x) == HImode)
-      && y == const0_rtx)
-    /* Only use sign-extension if we really need it.  */
-    return ((code == GT || code == GE || code == LE || code == LT)
-	    ? CC_SESWPmode : CC_ZESWPmode);
-
   /* A test for unsigned overflow.  */
   if ((GET_MODE (x) == DImode || GET_MODE (x) == TImode)
       && code == NE
@@ -4268,8 +4260,6 @@ aarch64_get_condition_code_1 (enum machine_mode mode, enum rtx_code comp_code)
       break;
 
     case CC_SWPmode:
-    case CC_ZESWPmode:
-    case CC_SESWPmode:
       switch (comp_code)
 	{
 	case NE: return AARCH64_NE;
@@ -6402,10 +6392,6 @@ aarch64_rtx_costs (rtx x, machine_mode mode, int outer ATTRIBUTE_UNUSED,
           /* TODO: A write to the CC flags possibly costs extra, this
 	     needs encoding in the cost tables.  */
 
-          /* CC_ZESWPmode supports zero extend for free.  */
-          if (mode == CC_ZESWPmode && GET_CODE (op0) == ZERO_EXTEND)
-            op0 = XEXP (op0, 0);
-
 	  mode = GET_MODE (op0);
           /* ANDS.  */
           if (GET_CODE (op0) == AND)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][AArch64] Delete obsolete CC_ZESWP and CC_SESWP CC modes
  2016-04-27 14:12 [PATCH][AArch64] Delete obsolete CC_ZESWP and CC_SESWP CC modes Kyrill Tkachov
@ 2016-05-11  9:00 ` Kyrill Tkachov
  2016-05-19 13:26   ` Kyrill Tkachov
  2016-05-27 10:15 ` James Greenhalgh
  1 sibling, 1 reply; 4+ messages in thread
From: Kyrill Tkachov @ 2016-05-11  9:00 UTC (permalink / raw)
  To: GCC Patches; +Cc: Marcus Shawcroft, Richard Earnshaw, James Greenhalgh

Ping.
https://gcc.gnu.org/ml/gcc-patches/2016-04/msg01652.html

Thanks,
Kyrill
On 27/04/16 15:12, Kyrill Tkachov wrote:
> Hi all,
>
> The CC_ZESWP and CC_SESWP are not used anywhere and seem to be a remmant of some
> old code that was removed. The various compare+extend patterns in aarch64.md don't
> use these modes. So it should be safe to remove them to avoid future confusion.
>
> Bootstrapped and tested on aarch64.
>
> Ok for trunk?
>
> Thanks,
> Kyrill
>
> 2016-04-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     * config/aarch64/aarch64-modes.def (CC_ZESWP, CC_SESWP): Delete.
>     * config/aarch64/aarch64.c (aarch64_select_cc_mode): Remove condition
>     that returns CC_SESWPmode and CC_ZESWPmode.
>     (aarch64_get_condition_code_1): Remove handling of CC_SESWPmode
>     and CC_SESWPmode.
>     (aarch64_rtx_costs): Likewise.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][AArch64] Delete obsolete CC_ZESWP and CC_SESWP CC modes
  2016-05-11  9:00 ` Kyrill Tkachov
@ 2016-05-19 13:26   ` Kyrill Tkachov
  0 siblings, 0 replies; 4+ messages in thread
From: Kyrill Tkachov @ 2016-05-19 13:26 UTC (permalink / raw)
  To: GCC Patches; +Cc: Marcus Shawcroft, Richard Earnshaw, James Greenhalgh

Ping.
Thanks,
Kyrill

On 11/05/16 10:00, Kyrill Tkachov wrote:
> Ping.
> https://gcc.gnu.org/ml/gcc-patches/2016-04/msg01652.html
>
> Thanks,
> Kyrill
> On 27/04/16 15:12, Kyrill Tkachov wrote:
>> Hi all,
>>
>> The CC_ZESWP and CC_SESWP are not used anywhere and seem to be a remmant of some
>> old code that was removed. The various compare+extend patterns in aarch64.md don't
>> use these modes. So it should be safe to remove them to avoid future confusion.
>>
>> Bootstrapped and tested on aarch64.
>>
>> Ok for trunk?
>>
>> Thanks,
>> Kyrill
>>
>> 2016-04-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>>
>>     * config/aarch64/aarch64-modes.def (CC_ZESWP, CC_SESWP): Delete.
>>     * config/aarch64/aarch64.c (aarch64_select_cc_mode): Remove condition
>>     that returns CC_SESWPmode and CC_ZESWPmode.
>>     (aarch64_get_condition_code_1): Remove handling of CC_SESWPmode
>>     and CC_SESWPmode.
>>     (aarch64_rtx_costs): Likewise.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][AArch64] Delete obsolete CC_ZESWP and CC_SESWP CC modes
  2016-04-27 14:12 [PATCH][AArch64] Delete obsolete CC_ZESWP and CC_SESWP CC modes Kyrill Tkachov
  2016-05-11  9:00 ` Kyrill Tkachov
@ 2016-05-27 10:15 ` James Greenhalgh
  1 sibling, 0 replies; 4+ messages in thread
From: James Greenhalgh @ 2016-05-27 10:15 UTC (permalink / raw)
  To: Kyrill Tkachov; +Cc: GCC Patches, Marcus Shawcroft, Richard Earnshaw, nd

On Wed, Apr 27, 2016 at 03:12:10PM +0100, Kyrill Tkachov wrote:
> Hi all,
> 
> The CC_ZESWP and CC_SESWP are not used anywhere and seem to be a remmant of some
> old code that was removed. The various compare+extend patterns in aarch64.md don't
> use these modes. So it should be safe to remove them to avoid future confusion.
> 
> Bootstrapped and tested on aarch64.
> 
> Ok for trunk?

OK.

Thanks for the cleanup.
James

> 2016-04-27  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>     * config/aarch64/aarch64-modes.def (CC_ZESWP, CC_SESWP): Delete.
>     * config/aarch64/aarch64.c (aarch64_select_cc_mode): Remove condition
>     that returns CC_SESWPmode and CC_ZESWPmode.
>     (aarch64_get_condition_code_1): Remove handling of CC_SESWPmode
>     and CC_SESWPmode.
>     (aarch64_rtx_costs): Likewise.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-27  8:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-27 14:12 [PATCH][AArch64] Delete obsolete CC_ZESWP and CC_SESWP CC modes Kyrill Tkachov
2016-05-11  9:00 ` Kyrill Tkachov
2016-05-19 13:26   ` Kyrill Tkachov
2016-05-27 10:15 ` James Greenhalgh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).