https://gcc.gnu.org/g:1ba513fb7cd2616c6c26a93bb52af98671e3b6a7

commit 1ba513fb7cd2616c6c26a93bb52af98671e3b6a7
Author: Michael Meissner <[email protected]>
Date:   Wed Nov 4 20:31:30 2026 -0500

    Add -mvector-pair-fp
    
    2026-11-04  Michael Meissner  <[email protected]>
    
            * config/rs6000/constraints.md (eF): New constraint.
            * config/rs6000/float16.md (truncv8sfv8hf2): New insn.
            (truncv8sfv8bf2): Likewise.
            * config/rs6000/predicates.md (easy_vector_constant): Add support 
for
            vector pair constants.
            (easy_vpair_fp_constant): New insn.
            * config/rs6000/rs6000-cpus.def (POWERPC_MASKS): Add 
-mvector-pair-fp.
            * config/rs6000/rs6000-protos.h (vec_const_256bit_to_bytes): New
            declaration.
            (vect_const_method); New enum typedef.
            (vect_const_can_be_generated): New declaration.
            * config/rs6000/rs6000.cc (rs6000_hard_regno_mode_ok_uncached): Add
            support for -mvector-pair-fp.
            (rs6000_debug_reg_global): Likewise.
            (rs6000_setup_reg_addr_masks): Likewise.
            (rs6000_init_hard_regno_mode_ok): Likewise.
            (rs6000_option_override_internal): Likewise.
            (rs6000_builtin_vectorization_cost): Likewise.
            (rs6000_expand_vector_init): Likewise.
            (rs6000_expand_vector_set): Likewise.
            (rs6000_expand_vector_extract): Likewise.
            (reg_offset_addressing_ok_p): Likewise.
            (rs6000_emit_move): Likewise.
            (rs6000_handle_altivec_attribute): Likewise.
            (rs6000_load_constant_and_splat): Likewise.
            (opt_masks): Likewise.
            (rs6000_split_multireg_move): Likewise.
            (vec_const_256bit_to_bytes): New function.
            (vect_const_can_be_generated): Likewise.
            * config/rs6000/rs6000.h (VPAIR_FP_P): New macro.
            * config/rs6000/rs6000.md (RELOAD): Add V8SF and V4DF.
            * config/rs6000/rs6000.opt (-mvector-pair-fp): New option.
            * config/rs6000/vector.md (VEC_E): Add V8SF and V4DF.
            (VEC_base): Likewise.
            (VEC_base_l): Likewise.
            * config/rs6000/vsx.md (VStype_simple): Likewise.
            (VPAIR_FP): New mode iterator.
            (mov<mode>): New insns for V8SFmode and V4DFmode.
            (VPAIR_FP_unary): New code iterator.
            (VPAIR_FP_binary): Likewise.
            (VPAIR_FP_name): New code attribute.
            (VPAIR_FP_BASE): Likewise.
            (VPAIR_FP_SINGLE): Likewise.
            (*dup): New insns.
            (<VPAIR_FP_name><mode>2): Likewise.
            (nabs<mode>2): Likewise.
            (<VPAIR_FP_name><mode>3): Likewise.
            (fma<mode>4): Likewise.
            (fms<mode>4): Likewise.
            (nfma<mode>4): Likewise.
            (nfms<mode>4): Likewise.

Diff:
---
 gcc/config/rs6000/constraints.md  |   6 +
 gcc/config/rs6000/float16.md      |  42 +++++
 gcc/config/rs6000/predicates.md   |  37 +++-
 gcc/config/rs6000/rs6000-cpus.def |   1 +
 gcc/config/rs6000/rs6000-protos.h |  16 ++
 gcc/config/rs6000/rs6000.cc       | 356 +++++++++++++++++++++++++++++++++++++-
 gcc/config/rs6000/rs6000.h        |   4 +
 gcc/config/rs6000/rs6000.md       |   2 +-
 gcc/config/rs6000/rs6000.opt      |   4 +
 gcc/config/rs6000/vector.md       |   8 +-
 gcc/config/rs6000/vsx.md          | 341 ++++++++++++++++++++++++++++++++++++
 11 files changed, 811 insertions(+), 6 deletions(-)

diff --git a/gcc/config/rs6000/constraints.md b/gcc/config/rs6000/constraints.md
index 292ca67efb57..038eb272e303 100644
--- a/gcc/config/rs6000/constraints.md
+++ b/gcc/config/rs6000/constraints.md
@@ -206,6 +206,12 @@
   (and (match_code "const_int")
        (match_test "((- (unsigned HOST_WIDE_INT) ival) + 0x8000) < 0x10000")))
 
+;; A 256-bit vector floating point constant that can be loaded into a
+;; pair of vectors
+(define_constraint "eF"
+  "A 256-bit vector floating point constant that can be loaded."
+  (match_operand 0 "easy_vpair_fp_constant"))
+
 ;; 34-bit signed integer constant
 (define_constraint "eI"
   "A signed 34-bit integer constant if prefixed instructions are supported."
diff --git a/gcc/config/rs6000/float16.md b/gcc/config/rs6000/float16.md
index 1bbad9729c5e..533dbfba46b0 100644
--- a/gcc/config/rs6000/float16.md
+++ b/gcc/config/rs6000/float16.md
@@ -1111,6 +1111,27 @@
   DONE;
 })
 
+(define_insn_and_split "truncv8sfv8hf2"
+  [(set (match_operand:V8HF 0 "vsx_register_operand")
+       (float_truncate:V8HF
+        (match_operand:V8SF 1 "vsx_register_operand")))]
+  "TARGET_FLOAT16_HW && can_create_pseudo_p ()"
+  "#"
+  "&& 1"
+  [(pc)]
+{
+  rtx r1 = gen_reg_rtx (V8HFmode);
+  rtx r2 = gen_reg_rtx (V8HFmode);
+  rtx op1 = operands[1];
+  rtx op1_hi = gen_rtx_SUBREG (V4SFmode, op1, BYTES_BIG_ENDIAN ?  0 : 16);
+  rtx op1_lo = gen_rtx_SUBREG (V4SFmode, op1, BYTES_BIG_ENDIAN ? 16 :  0);
+
+  emit_insn (gen_xvcvsphp_v8hf (r1, op1_hi));
+  emit_insn (gen_xvcvsphp_v8hf (r2, op1_lo));
+  rs6000_expand_extract_even (operands[0], r1, r2);
+  DONE;
+})
+
 (define_expand "vec_pack_trunc_v4sf_v8bf"
   [(match_operand:V8BF 0 "vfloat_operand")
    (match_operand:V4SF 1 "vfloat_operand")
@@ -1126,6 +1147,27 @@
   DONE;
 })
 
+(define_insn_and_split "truncv8sfv8bf2"
+  [(set (match_operand:V8BF 0 "vsx_register_operand")
+       (float_truncate:V8BF
+        (match_operand:V8SF 1 "vsx_register_operand")))]
+  "TARGET_FLOAT16_HW && can_create_pseudo_p ()"
+  "#"
+  "&& 1"
+  [(pc)]
+{
+  rtx r1 = gen_reg_rtx (V8BFmode);
+  rtx r2 = gen_reg_rtx (V8BFmode);
+  rtx op1 = operands[1];
+  rtx op1_hi = gen_rtx_SUBREG (V4SFmode, op1, BYTES_BIG_ENDIAN ?  0 : 16);
+  rtx op1_lo = gen_rtx_SUBREG (V4SFmode, op1, BYTES_BIG_ENDIAN ? 16 :  0);
+
+  emit_insn (gen_xvcvspbf16_v8bf (r1, op1_hi));
+  emit_insn (gen_xvcvspbf16_v8bf (r2, op1_lo));
+  rs6000_expand_extract_even (operands[0], r1, r2);
+  DONE;
+})
+
 ;; Unfortunately the machine independent code assumes there is only one
 ;; 16-bit floating point type.  This means we have to choose whether to
 ;; support packing _Float16 or __bfloat16.  It looks like __bfloat16 is
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index b46739b7a7f7..da9f0b8d85a1 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -842,6 +842,10 @@
       if (zero_constant (op, mode) || all_ones_constant (op, mode))
        return true;
 
+      /* Handle paired constants.  */
+      if (VPAIR_FP_P (mode))
+       return easy_vpair_fp_constant (op, mode);
+
       /* Constants that can be generated with ISA 3.1 instructions are
          easy.  */
       vec_const_128bit_type vsx_const;
@@ -926,6 +930,38 @@
            (and (match_test "easy_altivec_constant (op, mode)")
                 (match_test "vspltis_shifted (op) != 0")))))
 
+
+;; Return 1 if the vector is a paired vector constant that can be
+;; loaded into a vector register using a combination or XXLXOR,
+;; XXSPLTIB, XXSPLTIW, or XXSPLTIDP instructions.
+(define_predicate "easy_vpair_fp_constant"
+  (match_code "const_vector,vec_duplicate")
+{
+  if (!VPAIR_FP_P (mode))
+    return false;
+
+  if (op == CONST0_RTX (mode))
+    return true;
+
+  vec_const_128bit_type hi_const;
+  vec_const_128bit_type lo_const;
+  unsigned info = 0;
+
+  /* Decode the constant into 2 128-bit parts.  */
+  if (!vec_const_256bit_to_bytes (op, mode, &hi_const, &lo_const))
+    return false;
+
+  /* Can the first 128 bits be generated without a load?  */
+  if (vect_const_can_be_generated (&hi_const, &info) == VECT_CONST_MEMORY)
+    return false;
+
+  /* Can the second 128 bits be generated without a load?  */
+  if (vect_const_can_be_generated (&lo_const, &info) == VECT_CONST_MEMORY)
+    return false;
+
+  return true;
+})
+
 ;; Return true if this is a vector constant and each byte in
 ;; it is the same.
 (define_predicate "const_vector_each_byte_same"
@@ -2372,4 +2408,3 @@
 
   return bfloat16_to_v4sf_p (op, mode);
 })
-
diff --git a/gcc/config/rs6000/rs6000-cpus.def 
b/gcc/config/rs6000/rs6000-cpus.def
index cac42403fd94..40725ad78a74 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -164,6 +164,7 @@
                                 | OPTION_MASK_RECIP_PRECISION          \
                                 | OPTION_MASK_SOFT_FLOAT               \
                                 | OPTION_MASK_STRICT_ALIGN_OPTIONAL    \
+                                | OPTION_MASK_VECTOR_PAIR_FP           \
                                 | OPTION_MASK_VSX)
 
 #endif
diff --git a/gcc/config/rs6000/rs6000-protos.h 
b/gcc/config/rs6000/rs6000-protos.h
index 6a2a28ec37b0..8c61827ab51f 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -255,10 +255,26 @@ typedef struct {
 
 extern bool vec_const_128bit_to_bytes (rtx, machine_mode,
                                       vec_const_128bit_type *);
+extern bool vec_const_256bit_to_bytes (rtx, machine_mode,
+                                      vec_const_128bit_type *,
+                                      vec_const_128bit_type *);
 extern unsigned constant_generates_lxvkq (vec_const_128bit_type *);
 extern unsigned constant_generates_xxspltiw (vec_const_128bit_type *);
 extern unsigned constant_generates_xxspltidp (vec_const_128bit_type *);
 
+typedef enum {
+  VECT_CONST_MEMORY,           /* need to load constant from memory.  */
+  VECT_CONST_ZERO,             /* constant is all 0's.  */
+  VECT_CONST_ONES,             /* constant is all 1's.  */
+  VECT_CONST_XXSPLTIB,         /* constant can be loaded with XXSPLTIB.  */
+  VECT_CONST_XXSPLTIW,         /* constant can be loaded with XXSPLTIW.  */
+  VECT_CONST_XXSPLTIDP,                /* constant can be loaded with 
XXSPLTIDP.  */
+  VECT_CONST_LXVKG             /* constant can be loaded with LXVKQ.  */
+} vect_const_method;
+
+extern vect_const_method vect_const_can_be_generated (vec_const_128bit_type *,
+                                                     unsigned *);
+
 /* From float16.cc.  */
 /* Optimize bfloat16 and float16 operations.  */
 enum fp16_operation {
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 86df6a874477..f2c9a1e53ed4 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -1893,6 +1893,9 @@ rs6000_hard_regno_mode_ok_uncached (int regno, 
machine_mode mode)
   if (mode == OOmode)
     return ((TARGET_MMA || TARGET_DMF) && VSX_REGNO_P (regno) && (regno & 1) 
== 0);
 
+  if (VPAIR_FP_P (mode))
+    return (TARGET_P9_VECTOR && VSX_REGNO_P (regno) && (regno & 1) == 0);
+
   /* MMA accumulator modes need FPR registers divisible by 4.
      If TARGET_DMF is true, XOmode value can be held in a DMR register.  */
   if (mode == XOmode)
@@ -2718,6 +2721,12 @@ rs6000_debug_reg_global (void)
              rs6000_debug_fp_mode (V8HFmode);
            }
        }
+
+      if (TARGET_P9_VECTOR)
+       {
+         rs6000_debug_fp_mode (V8SFmode);
+         rs6000_debug_fp_mode (V4DFmode);
+       }
     }
 }
 
@@ -2890,6 +2899,13 @@ rs6000_setup_reg_addr_masks (void)
                }
            }
 
+         else if ((addr_mask != 0) && TARGET_P9_VECTOR && VPAIR_FP_P (m2))
+           {
+             addr_mask |= RELOAD_REG_OFFSET;
+             if (TARGET_POWER10)
+               addr_mask |= RELOAD_REG_INDEXED;
+           }
+
          /* VMX registers can do (REG & -16) and ((REG+REG) & -16)
             addressing on 128-bit types.  */
          if (rc == RELOAD_REG_VMX && msize == 16
@@ -3094,6 +3110,18 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
        rs6000_vector_unit[V8BFmode] = VECTOR_VSX;
     }
 
+  /* paired floating point vector mode.  */
+  if (TARGET_P9_VECTOR)
+    {
+      rs6000_vector_unit[V8SFmode] = VECTOR_VSX;
+      rs6000_vector_mem[V8SFmode] = VECTOR_VSX;
+      rs6000_vector_align[V8SFmode] = align32;
+
+      rs6000_vector_unit[V4DFmode] = VECTOR_VSX;
+      rs6000_vector_mem[V4DFmode] = VECTOR_VSX;
+      rs6000_vector_align[V4DFmode] = align32;
+    }
+
   /* DFmode, see if we want to use the VSX unit.  Memory is handled
      differently, so don't set rs6000_vector_mem.  */
   if (TARGET_VSX)
@@ -3221,6 +3249,14 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
              reg_addr[BFmode].reload_load  = CODE_FOR_reload_bf_di_load;
            }
 
+         if (TARGET_P9_VECTOR)
+           {
+             reg_addr[V8SFmode].reload_store = CODE_FOR_reload_v8sf_di_store;
+             reg_addr[V4DFmode].reload_store = CODE_FOR_reload_v4df_di_store;
+             reg_addr[V8SFmode].reload_load  = CODE_FOR_reload_v8sf_di_load;
+             reg_addr[V4DFmode].reload_load  = CODE_FOR_reload_v4df_di_load;
+           }
+
          /* Only provide a reload handler for SDmode if lfiwzx/stfiwx are
             available.  */
          if (TARGET_NO_SDMODE_STACK)
@@ -4130,6 +4166,20 @@ rs6000_option_override_internal (bool global_init_p)
     rs6000_isa_flags &= ~((OPTION_MASK_P8_VECTOR | OPTION_MASK_CRYPTO)
                         & ~rs6000_isa_flags_explicit);
 
+  /* See if -mvector-pair-fp can be used.  On power10 systems, we use the
+     load/store vector pair instructions.  On power9 systems, we limit the
+     addresses to offsettable instructions so we can do 2 loads or stores.
+     Don't allow the option on power8 or before.  */
+  if (TARGET_VECTOR_PAIR_FP
+      && (!TARGET_P9_VECTOR || BYTES_BIG_ENDIAN || !TARGET_POWERPC64))
+    {
+      rs6000_isa_flags &= ~OPTION_MASK_VECTOR_PAIR_FP;
+      if (rs6000_isa_flags_explicit & OPTION_MASK_VECTOR_PAIR_FP)
+       error ("%qs is only available on 64-bit little endian systems "
+              "that use at least %qs",
+              "-mvector-pair-fp", "-mcpu=power9");
+    }
+
   if (TARGET_DEBUG_REG || TARGET_DEBUG_TARGET)
     rs6000_print_isa_options (stderr, 0, "before defaults", rs6000_isa_flags);
 
@@ -5427,6 +5477,15 @@ rs6000_builtin_vectorization_cost (enum 
vect_cost_for_stmt type_of_cost,
 static machine_mode
 rs6000_preferred_simd_mode (scalar_mode mode)
 {
+  if (TARGET_VECTOR_PAIR_FP)
+    {
+      if (mode == SFmode)
+       return V8SFmode;
+
+      if (mode == DFmode)
+       return V4DFmode;
+    }
+
   opt_machine_mode vmode = mode_for_vector (mode, 16 / GET_MODE_SIZE (mode));
 
   if (vmode.exists () && !VECTOR_MEM_NONE_P (vmode.require ()))
@@ -7134,6 +7193,66 @@ rs6000_expand_vector_init (rtx target, rtx vals)
        all_same = false;
     }
 
+  /* Expand vector pairs into separate initializations.  */
+  if (mode == V4DFmode)
+    {
+      rtx target_hi = gen_rtx_SUBREG (V2DFmode, target, BYTES_BIG_ENDIAN ? 0 : 
16);
+      rtvec rtvec_hi = gen_rtvec (2,
+                                 XVECEXP (vals, 0, 0),
+                                 XVECEXP (vals, 0, 1));
+      rtx vals_hi = gen_rtx_PARALLEL (V2DFmode, rtvec_hi);
+
+      rs6000_expand_vector_init (target_hi, vals_hi);
+
+      rtx target_lo = gen_rtx_SUBREG (V2DFmode, target, BYTES_BIG_ENDIAN ? 16 
: 0);
+      if (all_same)
+       emit_move_insn (target_lo, target_hi);
+
+      else
+       {
+         rtvec rtvec_lo = gen_rtvec (2,
+                                     XVECEXP (vals, 0, 2),
+                                     XVECEXP (vals, 0, 3));
+         rtx vals_lo = gen_rtx_PARALLEL (V2DFmode, rtvec_lo);
+
+         rs6000_expand_vector_init (target_lo, vals_lo);
+       }
+
+      return;
+    }
+
+  else if (mode == V8SFmode)
+    {
+      rtx target_hi = gen_rtx_SUBREG (V4SFmode, target, BYTES_BIG_ENDIAN ? 0 : 
16);
+      rtvec rtvec_hi = gen_rtvec (4,
+                                 XVECEXP (vals, 0, 0),
+                                 XVECEXP (vals, 0, 1),
+                                 XVECEXP (vals, 0, 2),
+                                 XVECEXP (vals, 0, 3));
+      rtx vals_hi = gen_rtx_PARALLEL (V4SFmode, rtvec_hi);
+
+      rs6000_expand_vector_init (target_hi, vals_hi);
+
+      rtx target_lo = gen_rtx_SUBREG (V4SFmode, target, BYTES_BIG_ENDIAN ? 16 
: 0);
+
+      if (all_same)
+       emit_move_insn (target_lo, target_hi);
+
+      else
+       {
+         rtvec rtvec_lo = gen_rtvec (4,
+                                     XVECEXP (vals, 0, 4),
+                                     XVECEXP (vals, 0, 5),
+                                     XVECEXP (vals, 0, 6),
+                                     XVECEXP (vals, 0, 7));
+         rtx vals_lo = gen_rtx_PARALLEL (V4SFmode, rtvec_lo);
+
+         rs6000_expand_vector_init (target_lo, vals_lo);
+       }
+
+      return;
+    }
+
   if (n_var == 0)
     {
       rtx const_vec = gen_rtx_CONST_VECTOR (mode, XVEC (vals, 0));
@@ -7791,6 +7910,35 @@ rs6000_expand_vector_set (rtx target, rtx val, rtx 
elt_rtx)
   int width = GET_MODE_SIZE (inner_mode);
   int i;
 
+  /* For vector pairs with constant elements, change it into a vector set of
+     the single register.  */
+  if (VPAIR_FP_P (mode))
+    {
+      if (!CONST_INT_P (elt_rtx))
+       gcc_unreachable ();
+
+      size_t nunits = GET_MODE_NUNITS (mode);
+      size_t elt = (size_t) UINTVAL (elt_rtx);
+      size_t vnum;
+      machine_mode vmode;
+
+      if (BYTES_BIG_ENDIAN)
+       vnum = (elt >= nunits) ? 16 : 0;
+      else
+       vnum = (elt < nunits) ? 16 : 0;
+
+      if (mode == V4DFmode)
+       vmode = V2DFmode;
+      else if (mode == V8SFmode)
+       vmode = V4SFmode;
+      else
+       gcc_unreachable ();
+
+      rtx vtarget = gen_rtx_SUBREG (vmode, target, vnum);
+      rs6000_expand_vector_set (vtarget, val, GEN_INT (elt % nunits));
+      return;
+    }
+
   val = force_reg (GET_MODE (val), val);
 
   if (VECTOR_MEM_VSX_P (mode))
@@ -7914,6 +8062,36 @@ rs6000_expand_vector_extract (rtx target, rtx vec, rtx 
elt)
   machine_mode inner_mode = GET_MODE_INNER (mode);
   rtx mem;
 
+  /* For vector pairs with constant elements, change it into a vector extract
+     of the single register.  */
+  if (VPAIR_FP_P (mode))
+    {
+      if (!CONST_INT_P (elt))
+       gcc_unreachable ();
+
+      size_t nunits = GET_MODE_NUNITS (mode);
+      size_t elt_num = (size_t) UINTVAL (elt);
+      size_t vnum;
+      machine_mode vmode;
+
+      if (BYTES_BIG_ENDIAN)
+       vnum = (elt_num >= nunits) ? 16 : 0;
+      else
+       vnum = (elt_num < nunits) ? 16 : 0;
+
+      if (mode == V4DFmode)
+       vmode = V2DFmode;
+      else if (mode == V8SFmode)
+       vmode = V4SFmode;
+      else
+       gcc_unreachable ();
+
+      rtx v_vec = gen_rtx_SUBREG (vmode, vec, vnum);
+      rs6000_expand_vector_extract (target, v_vec,
+                                   GEN_INT (elt_num % nunits));
+      return;
+    }
+
   if (VECTOR_MEM_VSX_P (mode) && CONST_INT_P (elt))
     {
       switch (mode)
@@ -9014,6 +9192,8 @@ reg_offset_addressing_ok_p (machine_mode mode)
     case E_TImode:
     case E_TFmode:
     case E_KFmode:
+    case E_V8SFmode:
+    case E_V4DFmode:
       /* AltiVec/VSX vector modes.  Only reg+reg addressing was valid until the
         ISA 3.0 vector d-form addressing mode was added.  While TImode is not
         a vector mode, if we want to use the VSX registers to move it around,
@@ -11130,11 +11310,13 @@ rs6000_const_vec (machine_mode mode)
       break;
     case E_V4SFmode:
     case E_V4SImode:
+    case E_V4DFmode:
       subparts = 4;
       break;
     case E_V8HImode:
     case E_V8HFmode:
     case E_V8BFmode:
+    case E_V8SFmode:
       subparts = 8;
       break;
     case E_V16QImode:
@@ -11597,6 +11779,8 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode 
mode)
     case E_V2DFmode:
     case E_V2DImode:
     case E_V1TImode:
+    case E_V8SFmode:
+    case E_V4DFmode:
       if (CONSTANT_P (operands[1])
          && !easy_vector_constant (operands[1], mode))
        operands[1] = force_const_mem (mode, operands[1]);
@@ -21196,6 +21380,7 @@ rs6000_handle_altivec_attribute (tree *node,
             proper type in the 'b' case below.  */
        case E_V4SImode: case E_V8HImode: case E_V16QImode: case E_V4SFmode:
        case E_V2DImode: case E_V2DFmode:
+       case E_V8SFmode: case E_V4DFmode:
          result = type;
        default: break;
        }
@@ -23626,14 +23811,14 @@ rs6000_load_constant_and_splat (machine_mode mode, 
REAL_VALUE_TYPE dconst)
       rtx d = const_double_from_real_value (dconst, mode);
       reg = force_reg (mode, d);
     }
-  else if (mode == V4SFmode)
+  else if (mode == V4SFmode || mode == V8SFmode)
     {
       rtx d = const_double_from_real_value (dconst, SFmode);
       rtvec v = gen_rtvec (4, d, d, d, d);
       reg = gen_reg_rtx (mode);
       rs6000_expand_vector_init (reg, gen_rtx_PARALLEL (mode, v));
     }
-  else if (mode == V2DFmode)
+  else if (mode == V2DFmode || mode == V4DFmode)
     {
       rtx d = const_double_from_real_value (dconst, DFmode);
       rtvec v = gen_rtvec (2, d, d);
@@ -25241,6 +25426,7 @@ static struct rs6000_opt_mask const rs6000_opt_masks[] =
   { "save-toc-indirect",       OPTION_MASK_SAVE_TOC_INDIRECT,  false, true  },
   { "string",                  0,                              false, true  },
   { "update",                  OPTION_MASK_NO_UPDATE,          true , true  },
+  { "vector-pair-fp",          OPTION_MASK_VECTOR_PAIR_FP,     false, true  },
   { "vsx",                     OPTION_MASK_VSX,                false, true  },
 #ifdef OPTION_MASK_64BIT
 #if TARGET_AIX_OS
@@ -28167,6 +28353,10 @@ rs6000_split_multireg_move (rtx dst, rtx src)
      vectors.  */
   else if (mode == OOmode || mode == XOmode || mode == TDOmode)
     reg_mode = V1TImode;
+  else if (mode == V8SFmode)
+    reg_mode = V4SFmode;
+  else if (mode == V4DFmode)
+    reg_mode = V2DFmode;
   else if (FP_REGNO_P (reg))
     reg_mode = DECIMAL_FLOAT_MODE_P (mode) ? DDmode :
        (TARGET_HARD_FLOAT ? DFmode : SFmode);
@@ -28217,7 +28407,7 @@ rs6000_split_multireg_move (rtx dst, rtx src)
      below.  This means the last register gets the first memory
      location.  We also need to be careful of using the right register
      numbers if we are splitting XO to OO.  */
-  if (mode == OOmode || mode == XOmode || mode == TDOmode)
+  if (mode == OOmode || mode == XOmode || mode == TDOmode || VPAIR_FP_P (mode))
     {
       nregs = hard_regno_nregs (reg, mode);
       int reg_mode_nregs = hard_regno_nregs (reg, reg_mode);
@@ -29890,6 +30080,113 @@ vec_const_128bit_to_bytes (rtx op,
   return true;
 }
 
+/* Convert a vector constant OP with mode MODE to a pair of vector 128-bit
+   constant structures INFO similar to vec_const_256bit_to_bytes.  This is to
+   handle constants of paired vectors such as V8SFmode and V4DFmode.
+
+   Break out the constant out to bytes, half words, words, and double words.
+   Return true if we have successfully converted the constant.  We use the
+   128-bit constant infrastructure, returning two separate structures.
+
+   We handle CONST_VECTOR and VEC_DUPLICATE of constants.  */
+
+bool
+vec_const_256bit_to_bytes (rtx op,
+                          machine_mode mode,
+                          vec_const_128bit_type *info_hi,
+                          vec_const_128bit_type *info_lo)
+{
+  /* Initialize the constant structures.  */
+  memset ((void *)info_hi, 0, sizeof (vec_const_128bit_type));
+  memset ((void *)info_lo, 0, sizeof (vec_const_128bit_type));
+
+  machine_mode vmode;                  /* single vector mode.  */
+
+  if (mode == V8SFmode)
+    vmode = V4SFmode;
+
+  else if (mode == V4DFmode)
+    vmode = V2DFmode;
+
+  else
+    return false;
+
+  switch (GET_CODE (op))
+    {
+      /* Treat VEC_DUPLICATE of a constant just like a vector constant.
+        Since we are duplicating the element, we don't have to worry about
+        endian issues.  */
+    case VEC_DUPLICATE:
+      {
+       rtx vdup = gen_rtx_VEC_DUPLICATE (vmode, XEXP (op, 0));
+       if (vec_const_128bit_to_bytes (vdup, vmode, info_hi))
+         {
+           *info_lo = *info_hi;
+           return true;
+         }
+      }
+      break;
+
+      /* Vector constants, use vec_const_128bit_to_bytes to handle each
+        vector's worth.  On little endian systems, we have to reverse the
+        vectors, and vec_const_128bit_to_bytes will reverse the elements
+        within that vector.  */
+    case CONST_VECTOR:
+      {
+       if (!BYTES_BIG_ENDIAN)
+         std::swap (info_hi, info_lo);
+
+       size_t nunits = GET_MODE_NUNITS (vmode);
+
+      /* Split V4DFmode/V4DImode into 2 V2DFmode/V2DImode tests.  */
+       if (nunits == 2)
+         {
+           /* Validate the first 2 elements.  */
+           rtvec v = gen_rtvec (2,
+                                CONST_VECTOR_ELT (op, 0),
+                                CONST_VECTOR_ELT (op, 1));
+
+           rtx cv = gen_rtx_CONST_VECTOR (V2DFmode, v);
+           if (!vec_const_128bit_to_bytes (cv, vmode, info_hi))
+             return false;
+
+           /* Validate the last 2 elements.  */
+           RTVEC_ELT (v, 0) = CONST_VECTOR_ELT (op, 2);
+           RTVEC_ELT (v, 1) = CONST_VECTOR_ELT (op, 3);
+           return vec_const_128bit_to_bytes (cv, vmode, info_lo);
+         }
+
+       /* Split V8SFmode/V8SImode into 2 V4SFmode/V4SImode tests.  */
+       else if (nunits == 4)
+         {
+           /* Validate the first 4 elements.  */
+           rtvec v = gen_rtvec (4,
+                                CONST_VECTOR_ELT (op, 0),
+                                CONST_VECTOR_ELT (op, 1),
+                                CONST_VECTOR_ELT (op, 2),
+                                CONST_VECTOR_ELT (op, 3));
+
+           rtx cv = gen_rtx_CONST_VECTOR (vmode, v);
+           if (!vec_const_128bit_to_bytes (cv, vmode, info_hi))
+             return false;
+
+           /* Validate the last 4 elements.  */
+           RTVEC_ELT (v, 0) = CONST_VECTOR_ELT (op, 4);
+           RTVEC_ELT (v, 1) = CONST_VECTOR_ELT (op, 5);
+           RTVEC_ELT (v, 2) = CONST_VECTOR_ELT (op, 6);
+           RTVEC_ELT (v, 3) = CONST_VECTOR_ELT (op, 7);
+           return vec_const_128bit_to_bytes (cv, vmode, info_lo);
+         }
+      }
+      break;
+
+    default:
+      break;
+    }
+
+  return false;
+}
+
 /* Determine if an IEEE 128-bit constant can be loaded with LXVKQ.  Return zero
    if the LXVKQ instruction cannot be used.  Otherwise return the immediate
    value to be used with the LXVKQ instruction.  */
@@ -30074,6 +30371,59 @@ constant_generates_xxspltidp (vec_const_128bit_type 
*vsx_const)
   return sf_value;
 }
 
+/* Return how to generate a vector constant if it can be loaded into a vector
+   register via any means without doing a load.  INFO returns the value that
+   the constant_generate_<xxx> instructions return.  */
+
+vect_const_method
+vect_const_can_be_generated (vec_const_128bit_type *vect_const,
+                            unsigned *info)
+{
+  if (vect_const->all_bytes_same)
+    {
+      unsigned char value = vect_const->bytes[0];
+      *info = value;
+      if (value == 0)
+       return VECT_CONST_ZERO;         /* XXLXOR.  */
+
+      if (TARGET_P9_VECTOR)
+       return VECT_CONST_XXSPLTIB;
+
+      if (value == 0xff && TARGET_P8_VECTOR)
+       return VECT_CONST_ONES;         /* XXLORC.  */
+    }
+
+  if (TARGET_POWER10)
+    {
+      unsigned info2;
+
+      info2 = constant_generates_xxspltiw (vect_const);
+      if (info2 != 0)
+       {
+         *info = info2;
+         return VECT_CONST_XXSPLTIW;
+       }
+
+      info2 = constant_generates_xxspltidp (vect_const);
+      if (info2 != 0)
+       {
+         *info = info2;
+         return VECT_CONST_XXSPLTIDP;
+       }
+
+      info2 = constant_generates_lxvkq (vect_const);
+      if (info2 != 0)
+       {
+         *info = info2;
+         return VECT_CONST_LXVKG;
+       }
+    }
+
+  /* Constant can't be loaded.  */
+  *info = 0;
+  return VECT_CONST_MEMORY;
+}
+
 /* Now we have three opaque types: the __vector_quad, __vector_pair and
    __dmr1024 built-in types.  They are target specific and each one is
    only available when its required ISA support is enabled:
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 05c0b30bef6c..e19fca899005 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -338,6 +338,10 @@ extern const char *host_detect_local_cpu (int argc, const 
char **argv);
                                         && !BYTES_BIG_ENDIAN           \
                                         && TARGET_HARD_FLOAT)
 
+/* Whether a given mode represents a paired vector used for floating point
+   arithmetic operations.  */
+#define VPAIR_FP_P(MODE)       ((MODE) == V8SFmode || (MODE) == V4DFmode)
+
 /* Helper macros for TFmode.  Quad floating point (TFmode) can be either IBM
    long double format that uses a pair of doubles, or IEEE 128-bit floating
    point.  KFmode was added as a way to represent IEEE 128-bit floating point,
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 2ae89ca8e229..9bb71f38b41a 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -872,7 +872,7 @@
 ;; supplement addressing modes.
 (define_mode_iterator RELOAD [V16QI V8HI V8BF V8HF V4SI V2DI V4SF V2DF V1TI
                              SF SD SI DF DD DI TI PTI KF IF TF HF BF
-                             OO XO])
+                             OO XO V8SF V4DF])
 
 ;; Iterate over smin, smax
 (define_code_iterator fp_minmax        [smin smax])
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index f7c34f0d6e39..79bff4a7c2ba 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -650,6 +650,10 @@ mfloat16-warn-call-return
 Target Var(TARGET_FLOAT16_WARN_CALL_RETURN) Init(-1) Save
 Enable or disable 16-bit floating point warning of use in function calls.
 
+mvector-pair-fp
+Target Mask(VECTOR_PAIR_FP) Var(rs6000_isa_flags)
+Enable or disable using paired vectors for floating point operations
+
 mfloat16-libgcc-gpr
 Target Undocumented Var(TARGET_FLOAT16_LIBGCC_GPR) Init(-1) Save
 Pass/return (do not pass/return) 16-it float libgcc functions in GPR registers.
diff --git a/gcc/config/rs6000/vector.md b/gcc/config/rs6000/vector.md
index 5fd4e470ade0..cda17e877df0 100644
--- a/gcc/config/rs6000/vector.md
+++ b/gcc/config/rs6000/vector.md
@@ -90,7 +90,9 @@
                             V8BF
                             V8HF
                             V4SF
-                            V2DF])
+                            V2DF
+                            V8SF
+                            V4DF])
 
 ;; Vector modes for 64-bit base types
 (define_mode_iterator VEC_64 [V2DI V2DF])
@@ -107,6 +109,8 @@
                            (V8HF  "HF")
                            (V4SF  "SF")
                            (V2DF  "DF")
+                           (V8SF  "SF")
+                           (V4DF  "DF")
                            (V1TI  "TI")
                            (TI    "TI")])
 
@@ -119,6 +123,8 @@
                              (V8HF  "hf")
                              (V4SF  "sf")
                              (V2DF  "df")
+                             (V8SF  "sf")
+                             (V4DF  "df")
                              (V1TI  "ti")
                              (TI    "ti")])
 
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index 7c87ecb50023..8a52a420eeee 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -195,6 +195,8 @@
 ;; Appropriate type for add ops (and other simple FP ops)
 (define_mode_attr VStype_simple        [(V2DF "vecdouble")
                                 (V4SF "vecfloat")
+                                (V4DF "vecdouble")
+                                (V8SF "vecfloat")
                                 (DF   "fp")])
 
 ;; Appropriate type for multiply ops
@@ -286,6 +288,9 @@
 ;; and Vector Integer Multiply/Divide/Modulo Instructions
 (define_mode_iterator VIlong [V2DI V4SI])
 
+;; Mode iterator for floating point vectors paired together
+(define_mode_iterator VPAIR_FP [V8SF V4DF])
+
 ;; Constants for creating unspecs
 (define_c_enum "unspec"
   [UNSPEC_VSX_CONCAT
@@ -7336,3 +7341,339 @@
                     UNSPEC_XSREBASE3T3UQM))]
   "TARGET_FUTURE"
   "xsrebase3t3uqm %x0,%x2,%x3")
+
+
+;; Vector pair load/store for floating point.
+(define_insn_and_split "mov<mode>"
+  [(set (match_operand:VPAIR_FP 0 "nonimmediate_operand"
+               "=wa,  Z, wa, wO, wa, wa")
+       (match_operand:VPAIR_FP 1 "any_operand"
+                 "Z, wa, wO, wa, wa, eF"))]
+  "TARGET_P9_VECTOR"
+  "@
+   lxvp%X1 %x0,%1
+   stxvp%X0 %x1,%0
+   #
+   #
+   #
+   #"
+  "&& reload_completed
+   && (!TARGET_POWER10
+       || (MEM_P (operands[0])
+           && !indexed_or_indirect_operand (operands[0], <MODE>mode))
+       || (MEM_P (operands[1])
+           && !indexed_or_indirect_operand (operands[1], <MODE>mode))
+       || (!MEM_P (operands[0]) && !MEM_P (operands[1])))"
+  [(const_int 0)]
+{
+  rs6000_split_multireg_move (operands[0], operands[1]);
+  DONE;
+}
+  [(set_attr "type"   "vecload,   vecstore,  vecload, vecstore, veclogical,
+                       veclogical")
+   (set_attr "isa"    "p10,       p10,       *,       *,        *,
+                       *")
+   (set_attr "length" "*,         *,         8,       8,        8,
+                       16")])
+
+;; Unary/binary operators supporting vector pair splits
+(define_code_iterator VPAIR_FP_unary [abs neg])
+
+(define_code_iterator VPAIR_FP_binary [plus minus mult div])
+
+;; Insn name for the unary/binary operators
+(define_code_attr VPAIR_FP_name [(abs   "abs")
+                                (div   "div")
+                                (minus "sub")
+                                (mult  "mult")
+                                (neg   "neg")
+                                (plus  "add")])
+
+;; Map a paired vector mode to the base mode
+(define_mode_attr VPAIR_FP_BASE [(V8SF  "SF")
+                                (V4DF  "DF")])
+
+;; Map a paired vector mode back into the single vector mode
+(define_mode_attr VPAIR_FP_SINGLE [(V8SF "V4SF")
+                                  (V4DF "V2DF")])
+
+(define_insn_and_split "*dup<mode>"
+  [(set (match_operand:VPAIR_FP 0 "vsx_register_operand" "=wa,wa,wa")
+       (vec_duplicate:VPAIR_FP
+        (match_operand:<VPAIR_FP_BASE> 1 "splat_input_operand" "Z,wa,eP")))]
+  "TARGET_VECTOR_PAIR_FP"
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 2)
+       (vec_duplicate:VPAIR_FP
+        (match_dup 1)))
+   (set (match_dup 3)
+       (vec_duplicate:VPAIR_FP
+        (match_dup 1)))]
+{
+  machine_mode mode = <VPAIR_FP_SINGLE>mode;
+  unsigned r0 = reg_or_subregno (operands[0]);
+
+  operands[2] = gen_rtx_REG (mode, r0);
+  operands[3] = gen_rtx_REG (mode, r0 + 1);
+}
+  [(set_attr "type" "vecload,vecperm,veclogical")
+   (set_attr "length" "8,8,16")
+   (set_attr "prefixed" "*,*,yes")])
+
+(define_insn_and_split "<VPAIR_FP_name><mode>2"
+  [(set (match_operand:VPAIR_FP 0 "vsx_register_operand" "=wa")
+       (VPAIR_FP_unary:VPAIR_FP
+        (match_operand:VPAIR_FP 1 "vsx_register_operand" "wa")))]
+  "TARGET_VECTOR_PAIR_FP"
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 2)
+       (VPAIR_FP_unary:<VPAIR_FP_SINGLE>
+        (match_dup 3)))
+   (set (match_dup 4)
+       (VPAIR_FP_unary:<VPAIR_FP_SINGLE>
+        (match_dup 5)))]
+{
+  machine_mode mode = <VPAIR_FP_SINGLE>mode;
+  unsigned r0 = reg_or_subregno (operands[0]);
+  unsigned r1 = reg_or_subregno (operands[1]);
+
+  operands[2] = gen_rtx_REG (mode, r0);
+  operands[3] = gen_rtx_REG (mode, r1);
+
+  operands[4] = gen_rtx_REG (mode, r0 + 1);
+  operands[5] = gen_rtx_REG (mode, r1 + 1);
+}
+  [(set_attr "type" "<VStype_simple>")
+   (set_attr "length" "8")])
+
+(define_insn_and_split "*nabs<mode>2"
+  [(set (match_operand:VPAIR_FP 0 "vsx_register_operand" "=wa")
+       (VPAIR_FP_unary:VPAIR_FP
+        (match_operand:VPAIR_FP 1 "vsx_register_operand" "wa")))]
+  "TARGET_VECTOR_PAIR_FP"
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 2)
+       (neg:<VPAIR_FP_SINGLE>
+        (abs:<VPAIR_FP_SINGLE>
+         (match_dup 3))))
+   (set (match_dup 4)
+       (neg:<VPAIR_FP_SINGLE>
+        (abs:<VPAIR_FP_SINGLE>
+         (match_dup 5))))]
+{
+  machine_mode mode = <VPAIR_FP_SINGLE>mode;
+  unsigned r0 = reg_or_subregno (operands[0]);
+  unsigned r1 = reg_or_subregno (operands[1]);
+
+  operands[2] = gen_rtx_REG (mode, r0);
+  operands[3] = gen_rtx_REG (mode, r1);
+
+  operands[4] = gen_rtx_REG (mode, r0 + 1);
+  operands[5] = gen_rtx_REG (mode, r1 + 1);
+}
+  [(set_attr "type" "<VStype_simple>")
+   (set_attr "length" "8")])
+
+(define_insn_and_split "<VPAIR_FP_name><mode>3"
+  [(set (match_operand:VPAIR_FP 0 "vsx_register_operand" "=wa")
+       (VPAIR_FP_binary:VPAIR_FP
+        (match_operand:VPAIR_FP 1 "vsx_register_operand" "wa")
+        (match_operand:VPAIR_FP 2 "vsx_register_operand" "wa")))]
+  "TARGET_VECTOR_PAIR_FP"
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 3)
+       (VPAIR_FP_binary:<VPAIR_FP_SINGLE>
+        (match_dup 4)
+        (match_dup 5)))
+   (set (match_dup 6)
+       (VPAIR_FP_binary:<VPAIR_FP_SINGLE>
+        (match_dup 7)
+        (match_dup 8)))]
+{
+  machine_mode mode = <VPAIR_FP_SINGLE>mode;
+  unsigned r0 = reg_or_subregno (operands[0]);
+  unsigned r1 = reg_or_subregno (operands[1]);
+  unsigned r2 = reg_or_subregno (operands[2]);
+
+  operands[3] = gen_rtx_REG (mode, r0);
+  operands[4] = gen_rtx_REG (mode, r1);
+  operands[5] = gen_rtx_REG (mode, r2);
+
+  operands[6] = gen_rtx_REG (mode, r0 + 1);
+  operands[7] = gen_rtx_REG (mode, r1 + 1);
+  operands[8] = gen_rtx_REG (mode, r2 + 1);
+}
+  [(set_attr "type" "<VStype_simple>")
+   (set_attr "length" "8")])
+
+(define_insn_and_split "fma<mode>4"
+  [(set (match_operand:VPAIR_FP 0 "vsx_register_operand" "=wa,wa")
+       (fma:VPAIR_FP
+        (match_operand:VPAIR_FP 1 "vsx_register_operand" "%wa,wa")
+        (match_operand:VPAIR_FP 2 "vsx_register_operand" "wa,0")
+        (match_operand:VPAIR_FP 3 "vsx_register_operand" "0,wa")))]
+  "TARGET_VECTOR_PAIR_FP"
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 4)
+       (fma:<VPAIR_FP_SINGLE>
+        (match_dup 5)
+        (match_dup 6)
+        (match_dup 7)))
+   (set (match_dup 8)
+       (fma:<VPAIR_FP_SINGLE>
+        (match_dup 9)
+        (match_dup 10)
+        (match_dup 11)))]
+{
+  machine_mode mode = <VPAIR_FP_SINGLE>mode;
+  unsigned r0 = reg_or_subregno (operands[0]);
+  unsigned r1 = reg_or_subregno (operands[1]);
+  unsigned r2 = reg_or_subregno (operands[2]);
+  unsigned r3 = reg_or_subregno (operands[3]);
+
+  operands[4] = gen_rtx_REG (mode, r0);
+  operands[5] = gen_rtx_REG (mode, r1);
+  operands[6] = gen_rtx_REG (mode, r2);
+  operands[7] = gen_rtx_REG (mode, r3);
+
+  operands[8] = gen_rtx_REG (mode, r0 + 1);
+  operands[9] = gen_rtx_REG (mode, r1 + 1);
+  operands[10] = gen_rtx_REG (mode, r2 + 1);
+  operands[11] = gen_rtx_REG (mode, r3 + 1);
+}
+  [(set_attr "type" "<VStype_simple>")
+   (set_attr "length" "8")])
+
+(define_insn_and_split "*fms<mode>4"
+  [(set (match_operand:VPAIR_FP 0 "vsx_register_operand" "=wa,wa")
+       (fma:VPAIR_FP
+        (match_operand:VPAIR_FP 1 "vsx_register_operand" "%wa,wa")
+        (match_operand:VPAIR_FP 2 "vsx_register_operand" "wa,0")
+        (neg:VPAIR_FP
+         (match_operand:VPAIR_FP 3 "vsx_register_operand" "0,wa"))))]
+  "TARGET_VECTOR_PAIR_FP"
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 4)
+       (fma:<VPAIR_FP_SINGLE>
+        (match_dup 5)
+        (match_dup 6)
+        (neg:<VPAIR_FP_SINGLE>
+         (match_dup 7))))
+   (set (match_dup 8)
+       (fma:<VPAIR_FP_SINGLE>
+        (match_dup 9)
+        (match_dup 10)
+        (neg:<VPAIR_FP_SINGLE>
+         (match_dup 11))))]
+{
+  machine_mode mode = <VPAIR_FP_SINGLE>mode;
+  unsigned r0 = reg_or_subregno (operands[0]);
+  unsigned r1 = reg_or_subregno (operands[1]);
+  unsigned r2 = reg_or_subregno (operands[2]);
+  unsigned r3 = reg_or_subregno (operands[3]);
+
+  operands[4] = gen_rtx_REG (mode, r0);
+  operands[5] = gen_rtx_REG (mode, r1);
+  operands[6] = gen_rtx_REG (mode, r2);
+  operands[7] = gen_rtx_REG (mode, r3);
+
+  operands[8] = gen_rtx_REG (mode, r0 + 1);
+  operands[9] = gen_rtx_REG (mode, r1 + 1);
+  operands[10] = gen_rtx_REG (mode, r2 + 1);
+  operands[11] = gen_rtx_REG (mode, r3 + 1);
+}
+  [(set_attr "type" "<VStype_simple>")
+   (set_attr "length" "8")])
+
+(define_insn_and_split "*nfma<mode>4"
+  [(set (match_operand:VPAIR_FP 0 "vsx_register_operand" "=wa,wa")
+       (neg:VPAIR_FP
+        (fma:VPAIR_FP
+         (match_operand:VPAIR_FP 1 "vsx_register_operand" "%wa,wa")
+         (match_operand:VPAIR_FP 2 "vsx_register_operand" "wa,0")
+         (match_operand:VPAIR_FP 3 "vsx_register_operand" "0,wa"))))]
+  "TARGET_VECTOR_PAIR_FP"
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 4)
+       (neg:<VPAIR_FP_SINGLE>
+        (fma:<VPAIR_FP_SINGLE>
+         (match_dup 5)
+         (match_dup 6)
+         (match_dup 7))))
+   (set (match_dup 8)
+       (neg:<VPAIR_FP_SINGLE>
+        (fma:<VPAIR_FP_SINGLE>
+         (match_dup 9)
+         (match_dup 10)
+         (match_dup 11))))]
+{
+  machine_mode mode = <VPAIR_FP_SINGLE>mode;
+  unsigned r0 = reg_or_subregno (operands[0]);
+  unsigned r1 = reg_or_subregno (operands[1]);
+  unsigned r2 = reg_or_subregno (operands[2]);
+  unsigned r3 = reg_or_subregno (operands[3]);
+
+  operands[4] = gen_rtx_REG (mode, r0);
+  operands[5] = gen_rtx_REG (mode, r1);
+  operands[6] = gen_rtx_REG (mode, r2);
+  operands[7] = gen_rtx_REG (mode, r3);
+
+  operands[8] = gen_rtx_REG (mode, r0 + 1);
+  operands[9] = gen_rtx_REG (mode, r1 + 1);
+  operands[10] = gen_rtx_REG (mode, r2 + 1);
+  operands[11] = gen_rtx_REG (mode, r3 + 1);
+}
+  [(set_attr "type" "<VStype_simple>")
+   (set_attr "length" "8")])
+
+(define_insn_and_split "*nfms<mode>4"
+  [(set (match_operand:VPAIR_FP 0 "vsx_register_operand" "=wa,wa")
+       (neg:VPAIR_FP
+        (fma:VPAIR_FP
+         (match_operand:VPAIR_FP 1 "vsx_register_operand" "%wa,wa")
+         (match_operand:VPAIR_FP 2 "vsx_register_operand" "wa,0")
+         (neg:VPAIR_FP
+          (match_operand:VPAIR_FP 3 "vsx_register_operand" "0,wa")))))]
+  "TARGET_VECTOR_PAIR_FP"
+  "#"
+  "&& reload_completed"
+  [(set (match_dup 4)
+       (neg:<VPAIR_FP_SINGLE>
+        (fma:<VPAIR_FP_SINGLE>
+         (match_dup 5)
+         (match_dup 6)
+         (neg:<VPAIR_FP_SINGLE>
+          (match_dup 7)))))
+   (set (match_dup 8)
+       (neg:<VPAIR_FP_SINGLE>
+        (fma:<VPAIR_FP_SINGLE>
+         (match_dup 9)
+         (match_dup 10)
+         (neg:<VPAIR_FP_SINGLE>
+          (match_dup 11)))))]
+{
+  machine_mode mode = <VPAIR_FP_SINGLE>mode;
+  unsigned r0 = reg_or_subregno (operands[0]);
+  unsigned r1 = reg_or_subregno (operands[1]);
+  unsigned r2 = reg_or_subregno (operands[2]);
+  unsigned r3 = reg_or_subregno (operands[3]);
+
+  operands[4] = gen_rtx_REG (mode, r0);
+  operands[5] = gen_rtx_REG (mode, r1);
+  operands[6] = gen_rtx_REG (mode, r2);
+  operands[7] = gen_rtx_REG (mode, r3);
+
+  operands[8] = gen_rtx_REG (mode, r0 + 1);
+  operands[9] = gen_rtx_REG (mode, r1 + 1);
+  operands[10] = gen_rtx_REG (mode, r2 + 1);
+  operands[11] = gen_rtx_REG (mode, r3 + 1);
+}
+  [(set_attr "type" "<VStype_simple>")
+   (set_attr "length" "8")])

Reply via email to