public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work043)] Make xxsplt* insns prefixed.
@ 2021-03-30 18:31 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2021-03-30 18:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b2251719ce15526b8d9fc72cc7b6526306eac72b

commit b2251719ce15526b8d9fc72cc7b6526306eac72b
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Tue Mar 30 14:31:30 2021 -0400

    Make xxsplt* insns prefixed.
    
    The XXSPLTIW, XXSPLTIDP, and XXSPLTI32DX are prefixed instructions, but they
    don't use an initial 'p' in the instruction.  This patch marks these
    instructions as prefixed.
    
    A new attribute (prefixed_prepend_p) is added to control whether a prefixed
    instruction prepends a leading 'p'.  The XXSPLT instructions set this attribute
    to not prepend the 'p'.
    
    gcc/
    2021-03-30  Michael Meissner  <meissner@linux.ibm.com>
    
            * config/rs6000/altivec.md (xxspltiw_v4si): Set prefixed and
            prefixed_prepend_p attributes.
            (xxspltiw_v4sf): Set prefixed and prefixed_prepend_p attributes.
            (xxspltidp_v2df): Set prefixed and prefixed_prepend_p attributes.
            (xxsplti32dx_v4si): Set prefixed and prefixed_prepend_p
            attributes.
            (xxsplti32dx_v4sf): Set prefixed and prefixed_prepend_p
            attributes.
            * config/rs6000/rs6000.c (rs6000_final_prescan_insn): If the
            prefixed_prepend_p attribute is no, do not add a leading 'p'.
            * config/rs6000/rs6000.md (prefixed_prepend_p): New attribute.

Diff:
---
 gcc/config/rs6000/altivec.md | 20 +++++++++++++++-----
 gcc/config/rs6000/rs6000.c   |  5 ++++-
 gcc/config/rs6000/rs6000.md  |  4 ++++
 3 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 27a269b9e72..4799560e2c3 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -826,7 +826,9 @@
 		     UNSPEC_XXSPLTIW))]
  "TARGET_POWER10"
  "xxspltiw %x0,%1"
- [(set_attr "type" "vecsimple")])
+ [(set_attr "type" "vecsimple")
+  (set_attr "prefixed" "yes")
+  (set_attr "prefixed_prepend_p" "no")])
 
 (define_expand "xxspltiw_v4sf"
   [(set (match_operand:V4SF 0 "register_operand" "=wa")
@@ -845,7 +847,9 @@
 		     UNSPEC_XXSPLTIW))]
  "TARGET_POWER10"
  "xxspltiw %x0,%1"
- [(set_attr "type" "vecsimple")])
+ [(set_attr "type" "vecsimple")
+  (set_attr "prefixed" "yes")
+  (set_attr "prefixed_prepend_p" "no")])
 
 (define_expand "xxspltidp_v2df"
   [(set (match_operand:V2DF 0 "register_operand" )
@@ -864,7 +868,9 @@
 		     UNSPEC_XXSPLTID))]
   "TARGET_POWER10"
   "xxspltidp %x0,%1"
-  [(set_attr "type" "vecsimple")])
+  [(set_attr "type" "vecsimple")
+  (set_attr "prefixed" "yes")
+  (set_attr "prefixed_prepend_p" "no")])
 
 (define_expand "xxsplti32dx_v4si"
   [(set (match_operand:V4SI 0 "register_operand" "=wa")
@@ -893,7 +899,9 @@
 		     UNSPEC_XXSPLTI32DX))]
   "TARGET_POWER10"
   "xxsplti32dx %x0,%2,%3"
-  [(set_attr "type" "vecsimple")])
+  [(set_attr "type" "vecsimple")
+   (set_attr "prefixed" "yes")
+   (set_attr "prefixed_prepend_p" "no")])
 
 (define_expand "xxsplti32dx_v4sf"
   [(set (match_operand:V4SF 0 "register_operand" "=wa")
@@ -921,7 +929,9 @@
 		     UNSPEC_XXSPLTI32DX))]
   "TARGET_POWER10"
   "xxsplti32dx %x0,%2,%3"
-  [(set_attr "type" "vecsimple")])
+  [(set_attr "type" "vecsimple")
+   (set_attr "prefixed" "yes")
+   (set_attr "prefixed_prepend_p" "no")])
 
 (define_insn "xxblend_<mode>"
   [(set (match_operand:VM3 0 "register_operand" "=wa")
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 407da363f2a..7de058a1b91 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -26348,7 +26348,10 @@ static bool prepend_p_to_next_insn;
 void
 rs6000_final_prescan_insn (rtx_insn *insn, rtx [], int)
 {
-  prepend_p_to_next_insn = (get_attr_prefixed (insn) != PREFIXED_NO);
+  prepend_p_to_next_insn
+    = (get_attr_prefixed (insn) != PREFIXED_NO
+       && get_attr_prefixed_prepend_p (insn) != PREFIXED_PREPEND_P_NO);
+
   return;
 }
 
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 3bb776b1dde..26202a5db74 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -292,6 +292,10 @@
 
 	(const_string "no")))
 
+;; Whether we need to prepend a 'p' to the next insn if the insn is prefixed.
+(define_attr "prefixed_prepend_p" "no,yes"
+  (const_string "yes"))
+
 ;; Whether an insn loads an external address for the PCREL_OPT optimizaton.
 (define_attr "loads_external_address" "no,yes"
   (const_string "no"))


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-30 18:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 18:31 [gcc(refs/users/meissner/heads/work043)] Make xxsplt* insns prefixed Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).