]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arc: Honor SWAP option for lsl16 instruction
authorClaudiu Zissulescu <claziss@gmail.com>
Tue, 29 Aug 2023 06:00:09 +0000 (09:00 +0300)
committerClaudiu Zissulescu <claziss@gmail.com>
Thu, 31 Aug 2023 04:55:19 +0000 (07:55 +0300)
The LSL16 instruction is only available if SWAP (-mswap) option is
turned on.

gcc/ChangeLog:

* config/arc/arc.cc (arc_split_mov_const): Use LSL16 only when
SWAP option is enabled.
* config/arc/arc.md (ashlsi2_cnt16): Likewise.

Signed-off-by: Claudiu Zissulescu <claziss@gmail.com>
gcc/config/arc/arc.cc
gcc/config/arc/arc.md

index 266ba8b00bb7bb4c7e879938b6749e3df49723bd..8ee7387286e3a21b9818fdf7e5d8984e41928bb4 100644 (file)
@@ -11647,7 +11647,7 @@ arc_split_mov_const (rtx *operands)
     }
 
   /* 3. Check if we can just shift by 16 to fit into the u6 of LSL16.  */
-  if (TARGET_BARREL_SHIFTER && TARGET_V2
+  if (TARGET_SWAP && TARGET_V2
       && ((ival & ~0x3f0000) == 0))
     {
       shimm = (ival >> 16) & 0x3f;
index 1f122d9507f27ce8bdc88aaaeb5fc74604e860ea..a4e77a207bf7d8931bb4e6b53c620ccbade61f75 100644 (file)
@@ -5991,7 +5991,7 @@ archs4x, archs4xd"
   [(set (match_operand:SI 0 "register_operand"            "=r")
        (ashift:SI (match_operand:SI 1 "nonmemory_operand" "rL")
                   (const_int 16)))]
-  "TARGET_BARREL_SHIFTER && TARGET_V2"
+  "TARGET_SWAP && TARGET_V2"
   "lsl16\\t%0,%1"
   [(set_attr "type" "shift")
    (set_attr "iscompact" "false")