https://gcc.gnu.org/g:8ce5e39048138fb92ebebc4a72114d9e55fa7a91

commit r17-5976-g8ce5e39048138fb92ebebc4a72114d9e55fa7a91
Author: Robin Dapp <[email protected]>
Date:   Wed Oct 28 21:37:35 2026 +0100

    RISC-V: Extract subvectors via vec_perm_const.
    
    This patch adds a const-perm recoginzer for subvector extractions.  The
    implementation is exactly the same as what vec_extract is doing, just
    that we're independent of optab modes here and can extract arbitrary
    pieces.
    
    With that, we can finally get rid of all special cases and rely on
    generic handling.  Every possible extract should be just a slidedown.
    
    gcc/ChangeLog:
    
            * config/riscv/autovec.md (vec_extract<mode><v_half>): Remove.
            (vec_extract<mode><vls_quarter>): Remove.
            * config/riscv/riscv-v.cc (shuffle_extract_patterns): New.
            (expand_vec_perm_const_1): Use it.
            (expand_vec_perm_const): Reject tuple modes and use OP_MODE's
            number of units.
            (expand_vector_subreg_extract): Remove.
            (legitimize_move): Don't call expand_vector_subreg_extract.
            * config/riscv/vector-iterators.md: Remove vec_extract-specific
            iterators.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/riscv/rvv/autovec/subreg-extract.c: Remove xfail.

Diff:
---
 gcc/config/riscv/autovec.md                        |  63 -------
 gcc/config/riscv/riscv-v.cc                        | 148 +++++++----------
 gcc/config/riscv/vector-iterators.md               | 184 ---------------------
 .../gcc.target/riscv/rvv/autovec/subreg-extract.c  |   6 +-
 4 files changed, 59 insertions(+), 342 deletions(-)

diff --git a/gcc/config/riscv/autovec.md b/gcc/config/riscv/autovec.md
index 6084027ce6f5..607b9891405d 100644
--- a/gcc/config/riscv/autovec.md
+++ b/gcc/config/riscv/autovec.md
@@ -1601,69 +1601,6 @@
   DONE;
 })
 
-;; -------------------------------------------------------------------------
-;; ---- [INT,FP] Extract a vector from a vector.
-;; -------------------------------------------------------------------------
-;; TODO: This can be extended to allow basically any extract mode.
-;; For now this helps optimize VLS subregs like (subreg:V2DI (reg:V4DI) 16)
-;; that would otherwise need to go via memory.
-
-(define_expand "vec_extract<mode><v_half>"
-  [(set (match_operand:<V_HALF>         0 "nonimmediate_operand")
-     (vec_select:<V_HALF>
-       (match_operand:VLS_HAS_HALF      1 "register_operand")
-       (parallel
-        [(match_operand                 2 "immediate_operand")])))]
-  "TARGET_VECTOR"
-{
-  int sz = GET_MODE_NUNITS (<V_HALF>mode).to_constant ();
-  int part = INTVAL (operands[2]);
-
-  rtx start = GEN_INT (part * sz);
-  rtx tmp = operands[1];
-
-  if (part != 0)
-    {
-      tmp = gen_reg_rtx (<MODE>mode);
-
-      rtx ops[] = {tmp, operands[1], start};
-      riscv_vector::emit_vlmax_insn
-       (code_for_pred_slide (UNSPEC_VSLIDEDOWN, <MODE>mode),
-        riscv_vector::BINARY_OP, ops);
-    }
-
-  emit_move_insn (operands[0], gen_lowpart (<V_HALF>mode, tmp));
-  DONE;
-})
-
-(define_expand "vec_extract<mode><vls_quarter>"
-  [(set (match_operand:<VLS_QUARTER>    0 "nonimmediate_operand")
-     (vec_select:<VLS_QUARTER>
-       (match_operand:VLS_HAS_QUARTER   1 "register_operand")
-       (parallel
-        [(match_operand                 2 "immediate_operand")])))]
-  "TARGET_VECTOR"
-{
-  int sz = GET_MODE_NUNITS (<VLS_QUARTER>mode).to_constant ();
-  int part = INTVAL (operands[2]);
-
-  rtx start = GEN_INT (part * sz);
-  rtx tmp = operands[1];
-
-  if (part != 0)
-    {
-      tmp = gen_reg_rtx (<MODE>mode);
-
-      rtx ops[] = {tmp, operands[1], start};
-      riscv_vector::emit_vlmax_insn
-       (code_for_pred_slide (UNSPEC_VSLIDEDOWN, <MODE>mode),
-        riscv_vector::BINARY_OP, ops);
-    }
-
-  emit_move_insn (operands[0], gen_lowpart (<VLS_QUARTER>mode, tmp));
-  DONE;
-})
-
 ;; -------------------------------------------------------------------------
 ;; ---- [FP] Binary operations
 ;; -------------------------------------------------------------------------
diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index cd45f7049e30..6ae806e01aa4 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -1799,76 +1799,6 @@ get_frm_mode (rtx operand)
   gcc_unreachable ();
 }
 
-/* Expand vector extraction from a SUBREG source using slidedown.
-   Handles patterns like (subreg:V4DI (reg:V8DI) 32) by emitting
-   a slidedown instruction when extracting non-low parts.
-   Return true if the move was handled and emitted.  */
-static bool
-expand_vector_subreg_extract (rtx dest, rtx src)
-{
-  gcc_assert (SUBREG_P (src) && REG_P (SUBREG_REG (src)));
-
-  machine_mode mode = GET_MODE (dest);
-  machine_mode inner_mode = GET_MODE (SUBREG_REG (src));
-
-  gcc_assert (VECTOR_MODE_P (mode));
-  gcc_assert (VECTOR_MODE_P (inner_mode));
-
-  poly_uint16 outer_size = GET_MODE_BITSIZE (mode);
-  poly_uint16 inner_size = GET_MODE_BITSIZE (inner_mode);
-
-  poly_uint16 factor;
-  if (riscv_tuple_mode_p (inner_mode)
-      || !multiple_p (inner_size, outer_size, &factor)
-      || !factor.is_constant ()
-      || !pow2p_hwi (factor.to_constant ())
-      || factor.to_constant () <= 1)
-    return false;
-
-  enum vlmul_type lmul = get_vlmul (mode);
-  enum vlmul_type inner_lmul = get_vlmul (inner_mode);
-
-  /* These are just "renames".  */
-  if ((inner_lmul == LMUL_2 || inner_lmul == LMUL_4 || inner_lmul == LMUL_8)
-      && (lmul == LMUL_1 || lmul == LMUL_2 || lmul == LMUL_4))
-    return false;
-
-  poly_uint64 outer_nunits = GET_MODE_NUNITS (mode);
-  poly_uint64 subreg_byte = SUBREG_BYTE (src);
-
-  /* Calculate which part we're extracting (0 for low half, 1 for
-     higher half/quarter, etc.)  */
-  uint64_t part;
-  if (!exact_div (subreg_byte * BITS_PER_UNIT, outer_size).is_constant (&part))
-    return false;
-
-  rtx inner_reg = SUBREG_REG (src);
-  rtx tmp_out = gen_reg_rtx (mode);
-
-  if (part == 0)
-    {
-      /* Emit a direct reg-reg set here instead of emit_move_insn as that
-        would trigger another legitimize_move.  */
-      emit_insn (gen_rtx_SET (tmp_out, gen_lowpart (mode, inner_reg)));
-    }
-  else
-    {
-      /* Extracting a non-zero part means we need to slide down.  */
-      poly_uint64 slide_count = part * outer_nunits;
-
-      rtx tmp = gen_reg_rtx (inner_mode);
-      rtx ops[] = {tmp, inner_reg, gen_int_mode (slide_count, Pmode)};
-      insn_code icode = code_for_pred_slide (UNSPEC_VSLIDEDOWN, inner_mode);
-      emit_vlmax_insn (icode, BINARY_OP, ops);
-
-      /* Extract the low part after sliding.  */
-      emit_insn (gen_rtx_SET (tmp_out, gen_lowpart (mode, tmp)));
-    }
-
-  emit_move_insn (dest, tmp_out);
-  return true;
-}
-
 /* Expand a pre-RA RVV data move from SRC to DEST.
    It expands move for RVV fractional vector modes.
    Return true if the move as already been emitted.  */
@@ -1883,24 +1813,6 @@ legitimize_move (rtx dest, rtx *srcp)
       return true;
     }
 
-  /* The canonical way of extracting vectors from vectors is the vec_extract
-     optab with appropriate source and dest modes.  This is rather a VLS style
-     approach, though as we would need to enumerate all dest modes that are
-     half, quarter, etc. the size of the source.  It becomes particularly
-     cumbersome if we have a mix of VLA and VLS, i.e. extracting a smaller
-     VLS vector from a "VLA" vector.  Therefore we recognize patterns like
-       (set reg:V4DI
-         (subreg:V4DI (reg:V8DI) offset))
-     and transform them into vector slidedowns.  */
-  if (SUBREG_P (src) && REG_P (SUBREG_REG (src))
-      && VECTOR_MODE_P (GET_MODE (SUBREG_REG (src)))
-      && VECTOR_MODE_P (mode)
-      && !lra_in_progress)
-    {
-      if (expand_vector_subreg_extract (dest, src))
-       return true;
-    }
-
   if (riscv_vls_mode_p (mode))
     {
       if (GET_MODE_NUNITS (mode).to_constant () <= 31)
@@ -3975,6 +3887,50 @@ shuffle_slide_patterns (struct expand_vec_perm_d *d)
   return true;
 }
 
+/* Implement extraction of a D.OP_MODE sized part of D.OP0.  */
+static bool
+shuffle_extract_patterns (struct expand_vec_perm_d *d)
+{
+  poly_uint64 extract_size = GET_MODE_SIZE (d->vmode);
+  poly_uint64 full_size = GET_MODE_SIZE (d->op_mode);
+
+  if (maybe_ge (extract_size, full_size))
+    return false;
+
+  if (maybe_ne (GET_MODE_UNIT_SIZE (d->vmode),
+               GET_MODE_UNIT_SIZE (d->op_mode)))
+    return false;
+
+  if (!d->one_vector_p)
+    return false;
+
+  if (maybe_gt (GET_MODE_NUNITS (d->vmode) + d->perm[0],
+               GET_MODE_NUNITS (d->op_mode)))
+    return false;
+
+  /* We can only extract consecutive parts.  */
+  if (!d->perm.series_p (0, 1, d->perm[0], 1))
+    return false;
+
+  if (d->testing_p)
+    return true;
+
+  rtx tmp;
+  if (known_ne (d->perm[0], 0))
+    {
+      tmp = gen_reg_rtx (d->op_mode);
+      rtx ops[] = {tmp, d->op0, gen_int_mode (d->perm[0], Pmode)};
+      insn_code icode = code_for_pred_slide (UNSPEC_VSLIDEDOWN, d->op_mode);
+      emit_vlmax_insn (icode, BINARY_OP, ops);
+    }
+  else
+    tmp = d->op0;
+
+  emit_move_insn (d->target, gen_lowpart (d->vmode, tmp));
+
+  return true;
+}
+
 /* Recognize interleaving patterns like [0 4 1 5].  */
 
 static bool
@@ -4559,7 +4515,11 @@ expand_vec_perm_const_1 (struct expand_vec_perm_d *d)
          return false;
        }
       else
-       return false;
+       {
+         if (shuffle_extract_patterns (d))
+           return true;
+         return false;
+       }
     }
   return false;
 }
@@ -4575,6 +4535,14 @@ expand_vec_perm_const (machine_mode vmode, machine_mode 
op_mode, rtx target,
   if (GET_MODE_CLASS (vmode) == MODE_VECTOR_BOOL)
     return false;
 
+  if (riscv_tuple_mode_p (vmode)
+      || !riscv_vector_mode_p (op_mode)
+      || riscv_tuple_mode_p (op_mode))
+    return false;
+
+  if (!ordered_p (GET_MODE_SIZE (vmode), REGMODE_NATURAL_SIZE (op_mode)))
+    return false;
+
   struct expand_vec_perm_d d;
 
   /* Check whether the mask can be applied to a single vector.  */
@@ -4594,7 +4562,7 @@ expand_vec_perm_const (machine_mode vmode, machine_mode 
op_mode, rtx target,
     d.one_vector_p = false;
 
   d.perm.new_vector (sel.encoding (), d.one_vector_p ? 1 : 2,
-                    sel.nelts_per_input ());
+                    GET_MODE_NUNITS (op_mode));
   d.vmode = vmode;
   d.op_mode = op_mode;
   d.target = target;
diff --git a/gcc/config/riscv/vector-iterators.md 
b/gcc/config/riscv/vector-iterators.md
index 275cbdcc18ff..f645da120b67 100644
--- a/gcc/config/riscv/vector-iterators.md
+++ b/gcc/config/riscv/vector-iterators.md
@@ -6398,190 +6398,6 @@
   (V512DF "v256df")
 ])
 
-(define_mode_iterator VLS_HAS_QUARTER [
-  (V4QI "riscv_vector::vls_mode_valid_p (V4QImode)")
-  (V8QI "riscv_vector::vls_mode_valid_p (V8QImode)")
-  (V16QI "riscv_vector::vls_mode_valid_p (V16QImode)")
-  (V4HI "riscv_vector::vls_mode_valid_p (V4HImode)")
-  (V8HI "riscv_vector::vls_mode_valid_p (V8HImode)")
-  (V16HI "riscv_vector::vls_mode_valid_p (V16HImode)")
-  (V4SI "riscv_vector::vls_mode_valid_p (V4SImode)")
-  (V8SI "riscv_vector::vls_mode_valid_p (V8SImode)")
-  (V16SI "riscv_vector::vls_mode_valid_p (V16SImode) && TARGET_MIN_VLEN >= 64")
-  (V4DI "riscv_vector::vls_mode_valid_p (V4DImode) && TARGET_VECTOR_ELEN_64")
-  (V8DI "riscv_vector::vls_mode_valid_p (V8DImode) && TARGET_VECTOR_ELEN_64 && 
TARGET_MIN_VLEN >= 64")
-  (V16DI "riscv_vector::vls_mode_valid_p (V16DImode) && TARGET_VECTOR_ELEN_64 
&& TARGET_MIN_VLEN >= 128")
-  (V4SF "riscv_vector::vls_mode_valid_p (V4SFmode) && 
TARGET_VECTOR_ELEN_FP_32")
-  (V8SF "riscv_vector::vls_mode_valid_p (V8SFmode) && 
TARGET_VECTOR_ELEN_FP_32")
-  (V16SF "riscv_vector::vls_mode_valid_p (V16SFmode) && 
TARGET_VECTOR_ELEN_FP_32 && TARGET_MIN_VLEN >= 64")
-  (V4DF "riscv_vector::vls_mode_valid_p (V4DFmode) && 
TARGET_VECTOR_ELEN_FP_64")
-  (V8DF "riscv_vector::vls_mode_valid_p (V8DFmode) && TARGET_VECTOR_ELEN_FP_64 
&& TARGET_MIN_VLEN >= 64")
-  (V16DF "riscv_vector::vls_mode_valid_p (V16DFmode) && 
TARGET_VECTOR_ELEN_FP_64 && TARGET_MIN_VLEN >= 128")
-  (V32QI "riscv_vector::vls_mode_valid_p (V32QImode)")
-  (V64QI "riscv_vector::vls_mode_valid_p (V64QImode) && TARGET_MIN_VLEN >= 64")
-  (V128QI "riscv_vector::vls_mode_valid_p (V128QImode) && TARGET_MIN_VLEN >= 
128")
-  (V256QI "riscv_vector::vls_mode_valid_p (V256QImode) && TARGET_MIN_VLEN >= 
256")
-  (V512QI "riscv_vector::vls_mode_valid_p (V512QImode) && TARGET_MIN_VLEN >= 
512")
-  (V1024QI "riscv_vector::vls_mode_valid_p (V1024QImode) && TARGET_MIN_VLEN >= 
1024")
-  (V2048QI "riscv_vector::vls_mode_valid_p (V2048QImode) && TARGET_MIN_VLEN >= 
2048")
-  (V4096QI "riscv_vector::vls_mode_valid_p (V4096QImode) && TARGET_MIN_VLEN >= 
4096")
-  (V32HI "riscv_vector::vls_mode_valid_p (V32HImode) && TARGET_MIN_VLEN >= 64")
-  (V64HI "riscv_vector::vls_mode_valid_p (V64HImode) && TARGET_MIN_VLEN >= 
128")
-  (V128HI "riscv_vector::vls_mode_valid_p (V128HImode) && TARGET_MIN_VLEN >= 
256")
-  (V256HI "riscv_vector::vls_mode_valid_p (V256HImode) && TARGET_MIN_VLEN >= 
512")
-  (V512HI "riscv_vector::vls_mode_valid_p (V512HImode) && TARGET_MIN_VLEN >= 
1024")
-  (V1024HI "riscv_vector::vls_mode_valid_p (V1024HImode) && TARGET_MIN_VLEN >= 
2048")
-  (V2048HI "riscv_vector::vls_mode_valid_p (V2048HImode) && TARGET_MIN_VLEN >= 
4096")
-  (V32SI "riscv_vector::vls_mode_valid_p (V32SImode) && TARGET_MIN_VLEN >= 
128")
-  (V64SI "riscv_vector::vls_mode_valid_p (V64SImode) && TARGET_MIN_VLEN >= 
256")
-  (V128SI "riscv_vector::vls_mode_valid_p (V128SImode) && TARGET_MIN_VLEN >= 
512")
-  (V256SI "riscv_vector::vls_mode_valid_p (V256SImode) && TARGET_MIN_VLEN >= 
1024")
-  (V512SI "riscv_vector::vls_mode_valid_p (V512SImode) && TARGET_MIN_VLEN >= 
2048")
-  (V1024SI "riscv_vector::vls_mode_valid_p (V1024SImode) && TARGET_MIN_VLEN >= 
4096")
-  (V32DI "riscv_vector::vls_mode_valid_p (V32DImode) && TARGET_VECTOR_ELEN_64 
&& TARGET_MIN_VLEN >= 256")
-  (V64DI "riscv_vector::vls_mode_valid_p (V64DImode) && TARGET_VECTOR_ELEN_64 
&& TARGET_MIN_VLEN >= 512")
-  (V128DI "riscv_vector::vls_mode_valid_p (V128DImode) && 
TARGET_VECTOR_ELEN_64 && TARGET_MIN_VLEN >= 1024")
-  (V256DI "riscv_vector::vls_mode_valid_p (V256DImode) && 
TARGET_VECTOR_ELEN_64 && TARGET_MIN_VLEN >= 2048")
-  (V512DI "riscv_vector::vls_mode_valid_p (V512DImode) && 
TARGET_VECTOR_ELEN_64 && TARGET_MIN_VLEN >= 4096")
-  (V32SF "riscv_vector::vls_mode_valid_p (V32SFmode) && 
TARGET_VECTOR_ELEN_FP_32 && TARGET_MIN_VLEN >= 128")
-  (V64SF "riscv_vector::vls_mode_valid_p (V64SFmode) && 
TARGET_VECTOR_ELEN_FP_32 && TARGET_MIN_VLEN >= 256")
-  (V128SF "riscv_vector::vls_mode_valid_p (V128SFmode) && 
TARGET_VECTOR_ELEN_FP_32 && TARGET_MIN_VLEN >= 512")
-  (V256SF "riscv_vector::vls_mode_valid_p (V256SFmode) && 
TARGET_VECTOR_ELEN_FP_32 && TARGET_MIN_VLEN >= 1024")
-  (V512SF "riscv_vector::vls_mode_valid_p (V512SFmode) && 
TARGET_VECTOR_ELEN_FP_32 && TARGET_MIN_VLEN >= 2048")
-  (V1024SF "riscv_vector::vls_mode_valid_p (V1024SFmode) && 
TARGET_VECTOR_ELEN_FP_32 && TARGET_MIN_VLEN >= 4096")
-  (V32DF "riscv_vector::vls_mode_valid_p (V32DFmode) && 
TARGET_VECTOR_ELEN_FP_64 && TARGET_MIN_VLEN >= 256")
-  (V64DF "riscv_vector::vls_mode_valid_p (V64DFmode) && 
TARGET_VECTOR_ELEN_FP_64 && TARGET_MIN_VLEN >= 512")
-  (V128DF "riscv_vector::vls_mode_valid_p (V128DFmode) && 
TARGET_VECTOR_ELEN_FP_64 && TARGET_MIN_VLEN >= 1024")
-  (V256DF "riscv_vector::vls_mode_valid_p (V256DFmode) && 
TARGET_VECTOR_ELEN_FP_64 && TARGET_MIN_VLEN >= 2048")
-  (V512DF "riscv_vector::vls_mode_valid_p (V512DFmode) && 
TARGET_VECTOR_ELEN_FP_64 && TARGET_MIN_VLEN >= 4096")
-])
-
-(define_mode_attr VLS_QUARTER [
-  (V4QI "V1QI")
-  (V8QI "V2QI")
-  (V16QI "V4QI")
-  (V32QI "V8QI")
-  (V64QI "V16QI")
-  (V128QI "V32QI")
-  (V256QI "V64QI")
-  (V512QI "V128QI")
-  (V1024QI "V256QI")
-  (V2048QI "V512QI")
-  (V4096QI "V1024QI")
-
-  (V4HI "V1HI")
-  (V8HI "V2HI")
-  (V16HI "V4HI")
-  (V32HI "V8HI")
-  (V64HI "V16HI")
-  (V128HI "V32HI")
-  (V256HI "V64HI")
-  (V512HI "V128HI")
-  (V1024HI "V256HI")
-  (V2048HI "V512HI")
-
-  (V4SI "V1SI")
-  (V8SI "V2SI")
-  (V16SI "V4SI")
-  (V32SI "V8SI")
-  (V64SI "V16SI")
-  (V128SI "V32SI")
-  (V256SI "V64SI")
-  (V512SI "V128SI")
-  (V1024SI "V256SI")
-
-  (V4DI "V1DI")
-  (V8DI "V2DI")
-  (V16DI "V4DI")
-  (V32DI "V8DI")
-  (V64DI "V16DI")
-  (V128DI "V32DI")
-  (V256DI "V64DI")
-  (V512DI "V128DI")
-
-  (V4SF "V1SF")
-  (V8SF "V2SF")
-  (V16SF "V4SF")
-  (V32SF "V8SF")
-  (V64SF "V16SF")
-  (V128SF "V32SF")
-  (V256SF "V64SF")
-  (V512SF "V128SF")
-  (V1024SF "V256SF")
-
-  (V4DF "V1DF")
-  (V8DF "V2DF")
-  (V16DF "V4DF")
-  (V32DF "V8DF")
-  (V64DF "V16DF")
-  (V128DF "V32DF")
-  (V256DF "V64DF")
-  (V512DF "V128DF")
-])
-
-(define_mode_attr vls_quarter [
-  (V4QI "v1qi")
-  (V8QI "v2qi")
-  (V16QI "v4qi")
-  (V32QI "v8qi")
-  (V64QI "v16qi")
-  (V128QI "v32qi")
-  (V256QI "v64qi")
-  (V512QI "v128qi")
-  (V1024QI "v256qi")
-  (V2048QI "v512qi")
-  (V4096QI "v1024qi")
-
-  (V4HI "v1hi")
-  (V8HI "v2hi")
-  (V16HI "v4hi")
-  (V32HI "v8hi")
-  (V64HI "v16hi")
-  (V128HI "v32hi")
-  (V256HI "v64hi")
-  (V512HI "v128hi")
-  (V1024HI "v256hi")
-  (V2048HI "v512hi")
-
-  (V4SI "v1si")
-  (V8SI "v2si")
-  (V16SI "v4si")
-  (V32SI "v8si")
-  (V64SI "v16si")
-  (V128SI "v32si")
-  (V256SI "v64si")
-  (V512SI "v128si")
-  (V1024SI "v256si")
-
-  (V4DI "v1di")
-  (V8DI "v2di")
-  (V16DI "v4di")
-  (V32DI "v8di")
-  (V64DI "v16di")
-  (V128DI "v32di")
-  (V256DI "v64di")
-  (V512DI "v128di")
-
-  (V4SF "v1sf")
-  (V8SF "v2sf")
-  (V16SF "v4sf")
-  (V32SF "v8sf")
-  (V64SF "v16sf")
-  (V128SF "v32sf")
-  (V256SF "v64sf")
-  (V512SF "v128sf")
-  (V1024SF "v256sf")
-
-  (V4DF "v1df")
-  (V8DF "v2df")
-  (V16DF "v4df")
-  (V32DF "v8df")
-  (V64DF "v16df")
-  (V128DF "v32df")
-  (V256DF "v64df")
-  (V512DF "v128df")
-])
-
 (define_mode_iterator SF_VSI [
   RVVM8SI RVVM4SI RVVM2SI RVVM1SI
 ])
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/subreg-extract.c 
b/gcc/testsuite/gcc.target/riscv/rvv/autovec/subreg-extract.c
index af78f912900b..a2b568a0ee74 100644
--- a/gcc/testsuite/gcc.target/riscv/rvv/autovec/subreg-extract.c
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/subreg-extract.c
@@ -16,8 +16,4 @@ foo ()
     }
 }
 
-/* Since the regmode-natural-size changes we cannot build half-vector subregs
-   of regs.  Xfail this until we have a better way of describing and especially
-   querying vec_extract support.  */
-
-/* { dg-final { scan-assembler-times "vslidedown" 2 { xfail *-*-* } } } */
+/* { dg-final { scan-assembler-times "vslidedown" 2 } } */

Reply via email to