aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2019-09-24 19:28:08 +0000
committerIain Sandoe <iains@gcc.gnu.org>2019-09-24 19:28:08 +0000
commitdd9ed099056a247286a43a33cafa2cfd0d0a1524 (patch)
treecb5cb4c01cb6091b5b10f6478a32950b8249cfff
parent42eb48017d5cf2a7c76b73cb829871e67635536a (diff)
downloadgcc-dd9ed099056a247286a43a33cafa2cfd0d0a1524.zip
gcc-dd9ed099056a247286a43a33cafa2cfd0d0a1524.tar.gz
gcc-dd9ed099056a247286a43a33cafa2cfd0d0a1524.tar.bz2
[Darwin, PPC, Mode Iterators 1/n] Use mode iterators in picbase patterns.
This switches the picbase load and reload patterns to use the 'P' mode iterator instead of writing an SI and DI pattern for each. gcc/ChangeLog: 2019-09-24 Iain Sandoe <iain@sandoe.co.uk> * config/rs6000/rs6000.md (load_macho_picbase_<mode>): New, using the 'P' mode iterator, replacing the (removed) SI and DI variants. (reload_macho_picbase_<mode>): Likewise. From-SVN: r276107
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/rs6000/darwin.md55
2 files changed, 14 insertions, 47 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 420b3ac..6450f18 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2019-09-24 Iain Sandoe <iain@sandoe.co.uk>
+ * config/rs6000/rs6000.md (load_macho_picbase_<mode>): New, using
+ the 'P' mode iterator, replacing the (removed) SI and DI variants.
+ (reload_macho_picbase_<mode>): Likewise.
+
+2019-09-24 Iain Sandoe <iain@sandoe.co.uk>
+
* config/rs6000/rs6000.md: Move darwin.md include until
after the definition of the mode iterators.
diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md
index 471058d..4a28421 100644
--- a/gcc/config/rs6000/darwin.md
+++ b/gcc/config/rs6000/darwin.md
@@ -217,7 +217,7 @@ You should have received a copy of the GNU General Public License
"")
(define_expand "load_macho_picbase"
- [(set (reg:SI LR_REGNO)
+ [(set (reg LR_REGNO)
(unspec [(match_operand 0 "")]
UNSPEC_LD_MPIC))]
"(DEFAULT_ABI == ABI_DARWIN) && flag_pic"
@@ -230,9 +230,9 @@ You should have received a copy of the GNU General Public License
DONE;
})
-(define_insn "load_macho_picbase_si"
- [(set (reg:SI LR_REGNO)
- (unspec:SI [(match_operand:SI 0 "immediate_operand" "s")
+(define_insn "load_macho_picbase_<mode>"
+ [(set (reg:P LR_REGNO)
+ (unspec:P [(match_operand:P 0 "immediate_operand" "s")
(pc)] UNSPEC_LD_MPIC))]
"(DEFAULT_ABI == ABI_DARWIN) && flag_pic"
{
@@ -246,22 +246,6 @@ You should have received a copy of the GNU General Public License
[(set_attr "type" "branch")
(set_attr "cannot_copy" "yes")])
-(define_insn "load_macho_picbase_di"
- [(set (reg:DI LR_REGNO)
- (unspec:DI [(match_operand:DI 0 "immediate_operand" "s")
- (pc)] UNSPEC_LD_MPIC))]
- "(DEFAULT_ABI == ABI_DARWIN) && flag_pic && TARGET_64BIT"
-{
-#if TARGET_MACHO
- machopic_should_output_picbase_label (); /* Update for new func. */
-#else
- gcc_unreachable ();
-#endif
- return "bcl 20,31,%0\n%0:";
-}
- [(set_attr "type" "branch")
- (set_attr "cannot_copy" "yes")])
-
(define_expand "macho_correct_pic"
[(set (match_operand 0 "")
(plus (match_operand 1 "")
@@ -301,7 +285,7 @@ You should have received a copy of the GNU General Public License
[(set_attr "length" "8")])
(define_expand "reload_macho_picbase"
- [(set (reg:SI LR_REGNO)
+ [(set (reg LR_REGNO)
(unspec [(match_operand 0 "")]
UNSPEC_RELD_MPIC))]
"(DEFAULT_ABI == ABI_DARWIN) && flag_pic"
@@ -314,9 +298,9 @@ You should have received a copy of the GNU General Public License
DONE;
})
-(define_insn "reload_macho_picbase_si"
- [(set (reg:SI LR_REGNO)
- (unspec:SI [(match_operand:SI 0 "immediate_operand" "s")
+(define_insn "reload_macho_picbase_<mode>"
+ [(set (reg:P LR_REGNO)
+ (unspec:P [(match_operand:P 0 "immediate_operand" "s")
(pc)] UNSPEC_RELD_MPIC))]
"(DEFAULT_ABI == ABI_DARWIN) && flag_pic"
{
@@ -337,29 +321,6 @@ You should have received a copy of the GNU General Public License
[(set_attr "type" "branch")
(set_attr "cannot_copy" "yes")])
-(define_insn "reload_macho_picbase_di"
- [(set (reg:DI LR_REGNO)
- (unspec:DI [(match_operand:DI 0 "immediate_operand" "s")
- (pc)] UNSPEC_RELD_MPIC))]
- "(DEFAULT_ABI == ABI_DARWIN) && flag_pic && TARGET_64BIT"
-{
-#if TARGET_MACHO
- if (machopic_should_output_picbase_label ())
- {
- static char tmp[64];
- const char *cnam = machopic_get_function_picbase ();
- snprintf (tmp, 64, "bcl 20,31,%s\n%s:\n%%0:", cnam, cnam);
- return tmp;
- }
- else
-#else
- gcc_unreachable ();
-#endif
- return "bcl 20,31,%0\n%0:";
-}
- [(set_attr "type" "branch")
- (set_attr "cannot_copy" "yes")])
-
;; We need to restore the PIC register, at the site of nonlocal label.
(define_insn_and_split "nonlocal_goto_receiver"