[gcc(refs/users/meissner/heads/work018)] Power10: Add PCREL_OPT store support.

Michael Meissner meissner@gcc.gnu.org
Thu Sep 17 06:32:04 GMT 2020


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

commit de4bc5a851f8dd60756de85991dbd7b78a598a95
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Thu Sep 17 02:31:21 2020 -0400

    Power10: Add PCREL_OPT store support.
    
    gcc/
    2020-09-17  Michael Meissner  <meissner@linux.ibm.com>
    
            * config/rs6000/pcrel-opt.c (pcrel_opt_store): New function.
            (pcrel_opt_address): Add PCREL_OPT support for stores.
            (pcrel_opt_pass): Print PCREL_OPT store statistics.
            * config/rs6000/pcrel-opt.md (UNSPEC_PCREL_OPT_ST_ADDR): New
            unspec.
            (UNSPEC_PCREL_OPT_ST_RELOC): New unspec.
            (pcrel_opt_st_addr<mode>): New insns for PCREL_OPT store support.
            (pcrel_opt_st<mode>, QHSI iterator): New insns for PCREL_OPT store
            support.
            (pcrel_opt_stdi): New insn for PCREL_OPT store support.
            (pcrel_opt_stsf): New insn for PCREL_OPT store support.
            (pcrel_opt_stdf): New insns for PCREL_OPT store support.
            (pcrel_opt_st<mode>, PO_VECT iterator):  New insns for PCREL_OPT
            store support.
            * config/rs6000/rs6000.c (rs6000_delegitimize_address): Add
            support for PCREL_OPT store.

Diff:
---
 gcc/config/rs6000/rs6000.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e99b2c6bb5f..b589f4566c2 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -8557,7 +8557,17 @@ rs6000_delegitimize_address (rtx orig_x)
 	(set (reg:DI <base-reg>)
 	     (unspec:DI [(symbol_ref <symbol>)
 	                 (const_int <marker>)]
-			UNSPEC_PCREL_OPT_LD_ADDR_SAME_REG))  */
+			UNSPEC_PCREL_OPT_LD_ADDR_SAME_REG))
+
+     UNSPEC_PCREL_OPT_ST_ADDR is used by the power10 PCREL_OPT pass.  This
+     UNSPEC include the external SYMBOL_REF along with the value being loaded.
+     We return the original SYMBOL_REF.
+
+	(parallel [(set (reg:DI <base-reg>)
+	                (unspec:DI [(symbol_ref <symbol>)
+	                            (const_int <marker>)]
+	                           UNSPEC_PCREL_OPT_ST_ADDR))
+	           (use (reg <store-reg>))])  */
 
   if (GET_CODE (orig_x) == UNSPEC)
     switch (XINT (orig_x, 1))
@@ -8565,6 +8575,7 @@ rs6000_delegitimize_address (rtx orig_x)
       case UNSPEC_FUSION_GPR:
       case UNSPEC_PCREL_OPT_LD_ADDR:
       case UNSPEC_PCREL_OPT_LD_ADDR_SAME_REG:
+      case UNSPEC_PCREL_OPT_ST_ADDR:
 	orig_x = XVECEXP (orig_x, 0, 0);
 	break;


More information about the Gcc-cvs mailing list