From 7a40dd5a26ee497e80c86c939542de96d5e2a474 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Sun, 29 Sep 2019 19:09:13 +0000 Subject: [PATCH] [Darwin, PPC, Mode Iterators 5/n] Update macho_low. Replace the define_expand and two define_insns with a single @macho_low_ and update callers. gcc/ChangeLog: 2019-09-29 Iain Sandoe * config/darwin.c (gen_macho_low):Amend to include the mode argument. (machopic_indirect_data_reference): Amend gen_macho_low call to include mode argument * config/rs6000/rs6000.c (emit_move): Likewise. Amend a comment. * config/rs6000/darwin.md (@macho_low_): New, replaces the macho_high expander and two define_insn entries. From-SVN: r276271 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/darwin.c | 4 ++-- gcc/config/rs6000/darwin.md | 29 ++++------------------------- gcc/config/rs6000/rs6000.c | 5 ++++- 4 files changed, 20 insertions(+), 28 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e94f638..864dc69 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2019-09-29 Iain Sandoe + + * config/darwin.c (gen_macho_low):Amend to include the mode + argument. + (machopic_indirect_data_reference): Amend gen_macho_low call + to include mode argument + * config/rs6000/rs6000.c (emit_move): Likewise. Amend a comment. + * config/rs6000/darwin.md (@macho_low_): New, replaces + the macho_high expander and two define_insn entries. + 2019-09-29 Jakub Jelinek PR bootstrap/90543 diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 1f72c07..3a1be5a 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -110,7 +110,7 @@ section * darwin_sections[NUM_DARWIN_SECTIONS]; /* While we transition to using in-tests instead of ifdef'd code. */ #if !HAVE_lo_sum #define gen_macho_high(m,a,b) (a) -#define gen_macho_low(a,b,c) (a) +#define gen_macho_low(m,a,b,c) (a) #endif /* True if we're setting __attribute__ ((ms_struct)). */ @@ -656,7 +656,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg) /* Create a new register for CSE opportunities. */ rtx hi_reg = (!can_create_pseudo_p () ? reg : gen_reg_rtx (Pmode)); emit_insn (gen_macho_high (Pmode, hi_reg, orig)); - emit_insn (gen_macho_low (reg, hi_reg, orig)); + emit_insn (gen_macho_low (Pmode, reg, hi_reg, orig)); return reg; } else if (DARWIN_X86) diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md index 0c63a31..3994447 100644 --- a/gcc/config/rs6000/darwin.md +++ b/gcc/config/rs6000/darwin.md @@ -158,32 +158,11 @@ You should have received a copy of the GNU General Public License "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN)" "lis %0,ha16(%1)") -(define_expand "macho_low" - [(set (match_operand 0 "") - (lo_sum (match_operand 1 "") - (match_operand 2 "")))] - "TARGET_MACHO" -{ - if (TARGET_64BIT) - emit_insn (gen_macho_low_di (operands[0], operands[1], operands[2])); - else - emit_insn (gen_macho_low_si (operands[0], operands[1], operands[2])); - - DONE; -}) - -(define_insn "macho_low_si" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b") - (match_operand 2 "" "")))] - "TARGET_MACHO && ! TARGET_64BIT" - "la %0,lo16(%2)(%1)") - -(define_insn "macho_low_di" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b") +(define_insn "@macho_low_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (lo_sum:P (match_operand:P 1 "gpc_reg_operand" "b") (match_operand 2 "" "")))] - "TARGET_MACHO && TARGET_64BIT" + "TARGET_MACHO && (DEFAULT_ABI == ABI_DARWIN)" "la %0,lo16(%2)(%1)") (define_split diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a344153..1eb1317 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -9682,6 +9682,8 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) if (DEFAULT_ABI == ABI_DARWIN) { #if TARGET_MACHO + /* This is not PIC code, but could require the subset of + indirections used by mdynamic-no-pic. */ if (MACHO_DYNAMIC_NO_PIC_P) { /* Take care of any required data indirection. */ @@ -9693,7 +9695,8 @@ rs6000_emit_move (rtx dest, rtx source, machine_mode mode) } #endif emit_insn (gen_macho_high (Pmode, target, operands[1])); - emit_insn (gen_macho_low (operands[0], target, operands[1])); + emit_insn (gen_macho_low (Pmode, operands[0], + target, operands[1])); return; } -- 2.7.4