aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2019-09-29 19:09:13 +0000
committerIain Sandoe <iains@gcc.gnu.org>2019-09-29 19:09:13 +0000
commit7a40dd5a26ee497e80c86c939542de96d5e2a474 (patch)
treec8e56552fa915361d14ceb45c6f2c69617dcdfca /gcc/config
parentc4770ba091d96aea469c79067b549bbc8f8c7c63 (diff)
downloadgcc-7a40dd5a26ee497e80c86c939542de96d5e2a474.zip
gcc-7a40dd5a26ee497e80c86c939542de96d5e2a474.tar.gz
gcc-7a40dd5a26ee497e80c86c939542de96d5e2a474.tar.bz2
[Darwin, PPC, Mode Iterators 5/n] Update macho_low.
Replace the define_expand and two define_insns with a single @macho_low_<mode> and update callers. gcc/ChangeLog: 2019-09-29 Iain Sandoe <iain@sandoe.co.uk> * 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_<mode>): New, replaces the macho_high expander and two define_insn entries. From-SVN: r276271
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/darwin.c4
-rw-r--r--gcc/config/rs6000/darwin.md29
-rw-r--r--gcc/config/rs6000/rs6000.c5
3 files changed, 10 insertions, 28 deletions
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_<mode>"
+ [(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;
}