From 893fc0a002522b9f49564334122fa0a99923e7f3 Mon Sep 17 00:00:00 2001 From: Segher Boessenkool Date: Thu, 1 Sep 2016 17:04:11 +0200 Subject: [PATCH] rs6000: Use LR_REGNO instead of constant 65 Many places still use 65 instead of the symbolic constant LR_REGNO. This fixes them all (I looked for the string "65" only, in config/rs6000/ only, I didn't read all code :-) ) I left it in *restore_world because Iain will remove it there soon. * config/rs6000/altivec.md (*save_world, *save_vregs__r11, save_vregs__r12, *restore_vregs__r11, *restore_vregs__r12): Use LR_REGNO instead of 65. * config/rs6000/darwin.md (load_macho_picbase, load_macho_picbase_si, load_macho_picbase_di, *call_indirect_nonlocal_darwin64, *call_nonlocal_darwin64, *call_value_indirect_nonlocal_darwin64, *call_value_nonlocal_darwin64, reload_macho_picbase, reload_macho_picbase_si, reload_macho_picbase_di): Ditto. * config/rs6000/rs6000.h (RETURN_ADDR_IN_PREVIOUS_FRAME): Ditto. * config/rs6000/rs6000.md (*save_gpregs__r11, *save_gpregs__r12, *save_gpregs__r1, *save_fpregs__r11, *save_fpregs__r12, *save_fpregs__r1): Ditto. * config/rs6000/spe.md (*save_gpregs_spe, *restore_gpregs_spe, *return_and_restore_gpregs_spe): Ditto. From-SVN: r239941 --- gcc/ChangeLog | 18 ++++++++++++++++++ gcc/config/rs6000/altivec.md | 12 ++++++------ gcc/config/rs6000/darwin.md | 20 ++++++++++---------- gcc/config/rs6000/rs6000.h | 2 +- gcc/config/rs6000/rs6000.md | 12 ++++++------ gcc/config/rs6000/spe.md | 6 +++--- 6 files changed, 44 insertions(+), 26 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24a56fa716a..03f96f4d5fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +2016-09-01 Segher Boessenkool + + * config/rs6000/altivec.md (*save_world, *save_vregs__r11, + save_vregs__r12, *restore_vregs__r11, + *restore_vregs__r12): Use LR_REGNO instead of 65. + * config/rs6000/darwin.md (load_macho_picbase, load_macho_picbase_si, + load_macho_picbase_di, *call_indirect_nonlocal_darwin64, + *call_nonlocal_darwin64, *call_value_indirect_nonlocal_darwin64, + *call_value_nonlocal_darwin64, reload_macho_picbase, + reload_macho_picbase_si, reload_macho_picbase_di): Ditto. + * config/rs6000/rs6000.h (RETURN_ADDR_IN_PREVIOUS_FRAME): Ditto. + * config/rs6000/rs6000.md (*save_gpregs__r11, + *save_gpregs__r12, *save_gpregs__r1, + *save_fpregs__r11, *save_fpregs__r12, + *save_fpregs__r1): Ditto. + * config/rs6000/spe.md (*save_gpregs_spe, *restore_gpregs_spe, + *return_and_restore_gpregs_spe): Ditto. + 2016-09-01 Segher Boessenkool * config/rs6000/rs6000.md diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index c39a0b655b4..25472c29725 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -397,7 +397,7 @@ (define_insn "*save_world" [(match_parallel 0 "save_world_operation" - [(clobber (reg:SI 65)) + [(clobber (reg:SI LR_REGNO)) (use (match_operand:SI 1 "call_operand" "s"))])] "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT" "bl %z1" @@ -407,7 +407,7 @@ (define_insn "*restore_world" [(match_parallel 0 "restore_world_operation" [(return) - (use (reg:SI 65)) + (use (reg:SI LR_REGNO)) (use (match_operand:SI 1 "call_operand" "s")) (clobber (match_operand:SI 2 "gpc_reg_operand" "=r"))])] "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN) && TARGET_32BIT" @@ -421,7 +421,7 @@ ;; to describe the operation to dwarf2out_frame_debug_expr. (define_insn "*save_vregs__r11" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (clobber (reg:P 11)) (use (reg:P 0)) @@ -435,7 +435,7 @@ (define_insn "*save_vregs__r12" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (clobber (reg:P 12)) (use (reg:P 0)) @@ -449,7 +449,7 @@ (define_insn "*restore_vregs__r11" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (clobber (reg:P 11)) (use (reg:P 0)) @@ -463,7 +463,7 @@ (define_insn "*restore_vregs__r12" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (clobber (reg:P 12)) (use (reg:P 0)) diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md index 57ce30e0cd1..5870e0a762f 100644 --- a/gcc/config/rs6000/darwin.md +++ b/gcc/config/rs6000/darwin.md @@ -238,7 +238,7 @@ You should have received a copy of the GNU General Public License "") (define_expand "load_macho_picbase" - [(set (reg:SI 65) + [(set (reg:SI LR_REGNO) (unspec [(match_operand 0 "" "")] UNSPEC_LD_MPIC))] "(DEFAULT_ABI == ABI_DARWIN) && flag_pic" @@ -252,7 +252,7 @@ You should have received a copy of the GNU General Public License }) (define_insn "load_macho_picbase_si" - [(set (reg:SI 65) + [(set (reg:SI LR_REGNO) (unspec:SI [(match_operand:SI 0 "immediate_operand" "s") (pc)] UNSPEC_LD_MPIC))] "(DEFAULT_ABI == ABI_DARWIN) && flag_pic" @@ -268,7 +268,7 @@ You should have received a copy of the GNU General Public License (set_attr "length" "4")]) (define_insn "load_macho_picbase_di" - [(set (reg:DI 65) + [(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" @@ -325,7 +325,7 @@ You should have received a copy of the GNU General Public License [(call (mem:SI (match_operand:DI 0 "register_operand" "c,*l,c,*l")) (match_operand 1 "" "g,g,g,g")) (use (match_operand:SI 2 "immediate_operand" "O,O,n,n")) - (clobber (reg:SI 65))] + (clobber (reg:SI LR_REGNO))] "DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT" { return "b%T0l"; @@ -337,7 +337,7 @@ You should have received a copy of the GNU General Public License [(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s,s")) (match_operand 1 "" "g,g")) (use (match_operand:SI 2 "immediate_operand" "O,n")) - (clobber (reg:SI 65))] + (clobber (reg:SI LR_REGNO))] "(DEFAULT_ABI == ABI_DARWIN) && (INTVAL (operands[2]) & CALL_LONG) == 0" { @@ -355,7 +355,7 @@ You should have received a copy of the GNU General Public License (call (mem:SI (match_operand:DI 1 "register_operand" "c,*l,c,*l")) (match_operand 2 "" "g,g,g,g"))) (use (match_operand:SI 3 "immediate_operand" "O,O,n,n")) - (clobber (reg:SI 65))] + (clobber (reg:SI LR_REGNO))] "DEFAULT_ABI == ABI_DARWIN" { return "b%T1l"; @@ -368,7 +368,7 @@ You should have received a copy of the GNU General Public License (call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s,s")) (match_operand 2 "" "g,g"))) (use (match_operand:SI 3 "immediate_operand" "O,n")) - (clobber (reg:SI 65))] + (clobber (reg:SI LR_REGNO))] "(DEFAULT_ABI == ABI_DARWIN) && (INTVAL (operands[3]) & CALL_LONG) == 0" { @@ -382,7 +382,7 @@ You should have received a copy of the GNU General Public License (set_attr "length" "4,8")]) (define_expand "reload_macho_picbase" - [(set (reg:SI 65) + [(set (reg:SI LR_REGNO) (unspec [(match_operand 0 "" "")] UNSPEC_RELD_MPIC))] "(DEFAULT_ABI == ABI_DARWIN) && flag_pic" @@ -396,7 +396,7 @@ You should have received a copy of the GNU General Public License }) (define_insn "reload_macho_picbase_si" - [(set (reg:SI 65) + [(set (reg:SI LR_REGNO) (unspec:SI [(match_operand:SI 0 "immediate_operand" "s") (pc)] UNSPEC_RELD_MPIC))] "(DEFAULT_ABI == ABI_DARWIN) && flag_pic" @@ -419,7 +419,7 @@ You should have received a copy of the GNU General Public License (set_attr "length" "4")]) (define_insn "reload_macho_picbase_di" - [(set (reg:DI 65) + [(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" diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index d54eaa1b5a2..446d388469e 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1958,7 +1958,7 @@ typedef struct rs6000_args #define TRAMPOLINE_SIZE rs6000_trampoline_size () /* Definitions for __builtin_return_address and __builtin_frame_address. - __builtin_return_address (0) should give link register (65), enable + __builtin_return_address (0) should give link register (LR_REGNO), enable this. */ /* This should be uncommented, so that the link register is used, but currently this would result in unmatched insns and spilling fixed diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index d86d27b9102..1ecbb9d930c 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -12455,7 +12455,7 @@ (define_insn "*save_gpregs__r11" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (use (reg:P 11)) (set (match_operand:P 2 "memory_operand" "=m") @@ -12467,7 +12467,7 @@ (define_insn "*save_gpregs__r12" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (use (reg:P 12)) (set (match_operand:P 2 "memory_operand" "=m") @@ -12479,7 +12479,7 @@ (define_insn "*save_gpregs__r1" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (use (reg:P 1)) (set (match_operand:P 2 "memory_operand" "=m") @@ -12491,7 +12491,7 @@ (define_insn "*save_fpregs__r11" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (use (reg:P 11)) (set (match_operand:DF 2 "memory_operand" "=m") @@ -12503,7 +12503,7 @@ (define_insn "*save_fpregs__r12" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (use (reg:P 12)) (set (match_operand:DF 2 "memory_operand" "=m") @@ -12515,7 +12515,7 @@ (define_insn "*save_fpregs__r1" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (use (reg:P 1)) (set (match_operand:DF 2 "memory_operand" "=m") diff --git a/gcc/config/rs6000/spe.md b/gcc/config/rs6000/spe.md index 87fb787a1c1..4b2220d38bb 100644 --- a/gcc/config/rs6000/spe.md +++ b/gcc/config/rs6000/spe.md @@ -3464,7 +3464,7 @@ ;; Out-of-line prologues and epilogues. (define_insn "*save_gpregs_spe" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (use (reg:P 11)) (set (match_operand:V2SI 2 "memory_operand" "=m") @@ -3476,7 +3476,7 @@ (define_insn "*restore_gpregs_spe" [(match_parallel 0 "any_parallel_operand" - [(clobber (reg:P 65)) + [(clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (use (reg:P 11)) (set (match_operand:V2SI 2 "gpc_reg_operand" "=r") @@ -3489,7 +3489,7 @@ (define_insn "*return_and_restore_gpregs_spe" [(match_parallel 0 "any_parallel_operand" [(return) - (clobber (reg:P 65)) + (clobber (reg:P LR_REGNO)) (use (match_operand:P 1 "symbol_ref_operand" "s")) (use (reg:P 11)) (set (match_operand:V2SI 2 "gpc_reg_operand" "=r") -- 2.30.2