https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125636

--- Comment #11 from Uroš Bizjak <ubizjak at gmail dot com> ---
Comment on attachment 64650
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64650
gcc/testsuite/gcc.target/i386/pr125636.c

>short
>test_sign_extend (unsigned char *p)

You want "signed char" here.

The patch can then be as simple as:

--cut here--
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 223fdb538cf..8db5d3b0152 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -5303,11 +5303,11 @@ (define_insn "extendqihi2"
     case 0:
       return "{cbtw|cbw}";
     default:
-      return "movs{bw|x}\t{%1, %0|%0, %1}";
+      return "movs{bl|x}\t{%1, %k0|%k0, %1}";
     }
 }
   [(set_attr "type" "imovx")
-   (set_attr "mode" "HI")
+   (set_attr "mode" "HI,SI")
    (set (attr "prefix_0f")
      ;; movsx is short decodable while cwtl is vector decoded.
      (if_then_else (and (eq_attr "cpu" "!k6")
--cut here--

Reply via email to