]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa: tidy extzvsi-1bit patterns
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Thu, 25 May 2023 15:11:50 +0000 (00:11 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Fri, 26 May 2023 10:22:54 +0000 (03:22 -0700)
gcc/ChangeLog:

* config/xtensa/xtensa.md (*extzvsi-1bit_ashlsi3):
Retract excessive line folding, and correct the value of
the "length" insn attribute related to TARGET_DENSITY.
(*extzvsi-1bit_addsubx): Ditto.

gcc/config/xtensa/xtensa.md

index 6c1d8ee8f81575574d00a49ca341272d37dcc6a7..1125812516513c1e8a81316222b7de12e93c77fd 100644 (file)
        (ashift:SI (match_dup 0)
                   (match_dup 3)))]
 {
-  int pos = INTVAL (operands[2]),
-      shift = floor_log2 (INTVAL (operands[3]));
+  int pos = INTVAL (operands[2]), shift = floor_log2 (INTVAL (operands[3]));
   switch (GET_CODE (operands[4]))
     {
     case ASHIFT:
 }
   [(set_attr "type"    "arith")
    (set_attr "mode"    "SI")
-   (set_attr "length"  "6")])
+   (set (attr "length")
+        (if_then_else (match_test "TARGET_DENSITY && INTVAL (operands[3]) == 2")
+                     (const_int 5)
+                     (const_int 6)))])
 
 (define_insn_and_split "*extzvsi-1bit_addsubx"
   [(set (match_operand:SI 0 "register_operand" "=a")
                            (match_dup 4))
                 (match_dup 2)]))]
 {
-  int pos = INTVAL (operands[3]),
-      shift = floor_log2 (INTVAL (operands[4]));
+  int pos = INTVAL (operands[3]), shift = floor_log2 (INTVAL (operands[4]));
   switch (GET_CODE (operands[6]))
     {
     case ASHIFT: