public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/wschmidt/heads/dd2)] rs6000: Add -mprivileged
@ 2021-03-18 16:13 William Schmidt
  0 siblings, 0 replies; only message in thread
From: William Schmidt @ 2021-03-18 16:13 UTC (permalink / raw)
  To: gcc-cvs

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

commit cd4ccbd6378e5aa92238ef6dd54400d141477490
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Thu Mar 18 11:12:54 2021 -0500

    rs6000: Add -mprivileged
    
    2021-03-18  Bill Schmidt  <wschmidt@linux.ibm.com>
    
    gcc/
            * config/rs6000/rs6000.md (hashstp): Restrict to -mprivileged.
            (hashchkp): Likewise.
            * config/rs6000/rs6000.opt (mprivileged): New option.
            * doc/invoke.texi: Document -m[no-]privileged.

Diff:
---
 gcc/config/rs6000/rs6000.md  |  6 ++----
 gcc/config/rs6000/rs6000.opt |  3 +++
 gcc/doc/invoke.texi          | 12 ++++++++++--
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 827c578b1e3..0fdcd5f27ba 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -14957,12 +14957,11 @@
   "hashst %1,%0"
   [(set_attr "type" "store")])
 
-;; TBD -- restrict to -mprivileged.
 (define_insn "hashstp"
   [(set (match_operand:DI 0 "memory_operand" "=m")
         (unspec:DI [(match_operand:DI 1 "int_reg_operand" "r")]
 	           UNSPEC_HASHSTP))]
-  "TARGET_POWER10 && rs6000_rop_protect"
+  "TARGET_POWER10 && rs6000_rop_protect && rs6000_privileged"
   "hashstp %1,%0"
   [(set_attr "type" "store")])
 
@@ -14974,12 +14973,11 @@
   "hashchk %0,%1"
   [(set_attr "type" "load")])
 
-;; TBD -- restrict to -mprivileged.
 (define_insn "hashchkp"
   [(match_operand:DI 0 "int_reg_operand" "=r")
    (unspec:DI [(match_operand:DI 1 "memory_operand" "m")]
 	      UNSPEC_HASHCHKP)]
-  "TARGET_POWER10 && rs6000_rop_protect"
+  "TARGET_POWER10 && rs6000_rop_protect && rs6000_privileged"
   "hashchkp %0,%1"
   [(set_attr "type" "load")])
 \f
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index ec5775e6f1d..d116fd12f7e 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -622,3 +622,6 @@ Target Undocumented Var(rs6000_relative_jumptables) Init(1) Save
 
 mrop-protect
 Target Var(rs6000_rop_protect) Init(0)
+
+mprivileged
+Target Var(rs6000_privileged) Init(0)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 16b43085d0b..6ec3f196bd3 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -1236,7 +1236,8 @@ See RS/6000 and PowerPC Options.
 -mgnu-attribute  -mno-gnu-attribute @gol
 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
 -mstack-protector-guard-offset=@var{offset} -mprefixed -mno-prefixed @gol
--mpcrel -mno-pcrel -mmma -mno-mmma -mrop-protect -mno-rop-protect}
+-mpcrel -mno-pcrel -mmma -mno-mmma -mrop-protect -mno-rop-protect @gol
+-mprivileged -mno-privileged}
 
 @emph{RX Options}
 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
@@ -26984,7 +26985,8 @@ following options:
 -mmulhw  -mdlmzb  -mmfpgpr  -mvsx @gol
 -mcrypto  -mhtm  -mpower8-fusion  -mpower8-vector @gol
 -mquad-memory  -mquad-memory-atomic  -mfloat128 @gol
--mfloat128-hardware -mprefixed -mpcrel -mmma -mrop-protect}
+-mfloat128-hardware -mprefixed -mpcrel -mmma @gol
+-mrop-protect -mprivileged}
 
 The particular options set for any particular CPU varies between
 compiler versions, depending on what setting seems to produce optimal
@@ -27996,6 +27998,12 @@ Generate (do not generate) the MMA instructions when the option
 Generate (do not generate) ROP protection instructions when the option
 @option{-mcpu=power10} is used.
 
+@item -mprivileged
+@itemx -mno-privileged
+@opindex mprivileged
+@opindex mno-privileged
+Generate (do not generate) instructions for privileged state.
+
 @item -mblock-ops-unaligned-vsx
 @itemx -mno-block-ops-unaligned-vsx
 @opindex block-ops-unaligned-vsx


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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 16:13 [gcc(refs/users/wschmidt/heads/dd2)] rs6000: Add -mprivileged William Schmidt

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).