From: Iain Sandoe Date: Sun, 29 Sep 2019 19:09:13 +0000 (+0000) Subject: [Darwin, PPC, Mode Iterators 5/n] Update macho_low. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7a40dd5a26ee497e80c86c939542de96d5e2a474;p=gcc.git [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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e94f63867e4..864dc694e54 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 1f72c07ab72..3a1be5a29b9 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 0c63a31755e..3994447f38e 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 a34415349e6..1eb13176dd0 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; }